-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
18,124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# YMCEmojiBundle | ||
|
||
Provides a list of emojis in twig | ||
|
||
### Usage | ||
```twig | ||
{{ emoji_groups().People[3] }} | ||
```yaml | ||
### Configuration | ||
```yaml | ||
ymc_emoji: | ||
definition_file: '%kernel.root_dir%/../app/Resources/config/emoji_list.json' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "ymc/emoji-bundle", | ||
"version": "1.0.0", | ||
"type": "library", | ||
"require": { | ||
"php": ">=7", | ||
"symfony/framework-bundle": "^2.7 || ^3.2" | ||
}, | ||
"autoload": { | ||
"psr-4": {"YMC\\EmojiBundle\\": "src/"} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace YMC\EmojiBundle\DependencyInjection; | ||
|
||
use Symfony\Component\Config\Definition\Builder\TreeBuilder; | ||
use Symfony\Component\Config\Definition\ConfigurationInterface; | ||
|
||
class Configuration implements ConfigurationInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getConfigTreeBuilder() | ||
{ | ||
$treeBuilder = new TreeBuilder(); | ||
$rootNode = $treeBuilder->root('ymc_emoji'); | ||
|
||
$rootNode | ||
->children() | ||
->scalarNode('definition_file') | ||
->defaultValue(__DIR__.'/../Resources/config/emoji.json') | ||
->end() | ||
->end(); | ||
|
||
return $treeBuilder; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace YMC\EmojiBundle\DependencyInjection; | ||
|
||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\Config\FileLocator; | ||
use Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension; | ||
use Symfony\Component\DependencyInjection\Loader; | ||
|
||
/** | ||
* This is the class that loads and manages your bundle configuration. | ||
* | ||
* @see http://symfony.com/doc/current/cookbook/bundles/extension.html | ||
*/ | ||
class YMCEmojiExtension extends ConfigurableExtension | ||
{ | ||
protected function loadInternal(array $mergedConfig, ContainerBuilder $container) | ||
{ | ||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | ||
$loader->load('services.yml'); | ||
$container->setParameter('ymc_emoji.definition_file', $mergedConfig['definition_file']); | ||
|
||
} | ||
} |
Oops, something went wrong.