/explore
|
You are here |
gonzalo123.com | ||
| | | | |
www.beberlei.de
|
|
| | | | | ||
| | | | |
fabien.potencier.org
The blog of Fabien Potencier about web technology and the symfony framework |
|
| | | | | ||
| | | | |
matthiasnoback.nl
In the previous part of this series we decreased coupling of a Symfony controller to the Symfony2 framework by removing its dependency on the standard Controller class from the FrameworkBundle. Now we take a look at annotations. They were initially introduced for rapid development (no need to create/modify some configuration file, just solve the issues inline!): namespace Matthias\ClientBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; /** * @Route("/client") */ class ClientController { /** * @Route('/{id}') * @Method("GET") * @ParamConvert... |
|
| | | | | ||
| | | | |
matthiasnoback.nl
As you may have read on the Symfony blog: as of Symfony 2.4 you can register console commands using the service tag console.command. What is the big deal, you would say. Well, let's discover it now. This is how the documentation tells you to write your console commands: namespace Matthias\ConsoleBundle\Command; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class MyCommand extends ContainerAwareCommand { protected function configure() { $this->setName('my:action'); } protected function execute(InputInterface $input, OutputInterface $output) { // do something } } How to make sure your command will be noticed? Until Symfony 2.4 there wer... |
|
| | | |||