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
<? | |
// src/Acme/SocialBundle/DependencyInjection/AcmeSocialExtension.php | |
public function load(array $configs, ContainerBuilder $container) | |
{ | |
$configuration = new Configuration(); | |
$config = $this->processConfiguration($configuration, $configs); | |
// simdi iki config anahtari var |
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
<?php | |
// src/Acme/SocialBundle/DependencyInjection/Configuration.php | |
namespace Acme\SocialBundle\DependencyInjection; | |
use Symfony\Component\Config\Definition\Builder\TreeBuilder; | |
use Symfony\Component\Config\Definition\ConfigurationInterface; | |
class Configuration implements ConfigurationInterface | |
{ |
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
[ | |
[ | |
'twitter' => [ | |
'client_id' => 123, | |
'client_secret' => 'your_secret', | |
], | |
], | |
] |
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
<?php | |
public function load(array $configs, ContainerBuilder $container) | |
{ | |
// ... | |
$this->addAnnotatedClassesToCompile([ | |
// you can define the fully qualified class names... | |
'App\\Controller\\DefaultController', | |
// ... but glob patterns are also supported: | |
'**Bundle\\Controller\\', |
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
<?php | |
use Symfony\Component\Config\FileLocator; | |
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; | |
// ... | |
public function load(array $configs, ContainerBuilder $container) | |
{ | |
$loader = new XmlFileLoader( | |
$container, |
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
<?php | |
use Acme\HelloBundle\DependencyInjection\UnconventionalExtensionClass; | |
class AcmeHelloBundle extends Bundle | |
{ | |
public function getContainerExtension() | |
{ | |
return new UnconventionalExtensionClass(); | |
} |
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
<?php | |
// src/Acme/HelloBundle/DependencyInjection/AcmeHelloExtension.php | |
namespace Acme\HelloBundle\DependencyInjection; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\DependencyInjection\Extension\Extension; | |
class AcmeHelloExtension extends Extension | |
{ |
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
// autoload anahtar adi namespace olarak belirtilir | |
"autoload": { | |
"psr-4": { "SomeVendor\\BlogBundle\\": "" } | |
} | |
// autoload adresi bundle class olan dizin | |
"autoload": { | |
"psr-4": { | |
"SomeVendor\\BlogBundle\\": "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
<?php | |
// src/Kernel.php | |
namespace App; | |
use App\Event\MyCustomEvent; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\EventDispatcher\DependencyInjection\AddEventAliasesPass; | |
use Symfony\Component\HttpKernel\Kernel as BaseKernel; | |
class Kernel extends BaseKernel | |
{ |
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
<?php | |
// src/EventSubscriber/RequestSubscriber.php | |
namespace App\EventSubscriber; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
use Symfony\Component\HttpKernel\Event\RequestEvent; | |
class RequestSubscriber implements EventSubscriberInterface | |
{ |