In order to have the dump() function always available when running any PHP code, you can install it globally on your computer:
- Run composer global require symfony/var-dumper;
- Add auto_prepend_file = ${HOME}/.composer/vendor/autoload.php to your php.ini file;
- From time to time, run composer global update to have the latest bug fixes.
$process->run();
$process->mustRun();
php -i
в консоле и так:$process = new \Symfony\Component\Process\Process("php -i");
$process->run();
return new Response($process->getOutput());
/**
* @Route("/cpanel/{p}", defaults={"p" = "start"})
* @Template()
*/
public function cpanelAction($p=null, Request $r){
return array("p"=>$p);
}
class SomeService
/**
* @var \Symfony\Bundle\FrameworkBundle\Templating\EngineInterface
*/
private $templating;
public function __construct(EngineInterface $templating)
{
$this->templating = $templating;
}
public function doSome()
{
$template = $this->templating->render('AppBundle::foo.html.twig', array(
'foo' => 'bar'
));
}
services:
app.service.foo:
class: %app.service.foo.class%
arguments:
- @templating
entity_managers:
default:
dql:
string_functions:
GROUP_CONCAT: DoctrineExtensions\Query\Mysql\GroupConcat
symfony.com/doc/current/cookbook/controller/servic...
В настройках роута надо заменитьdefaults: { _controller: TestTestBundle:Test:index }
наdefaults: { _controller: test:indexAction }
$builder
->add(
$builder->create('destination', 'text', array(
'attr' => array(
'class' => 'select_station'
)
))
->addModelTransformer(new EntityToStringTransformer(
$options['em'],
'Acme\DemoBundle\Entity\Station',
'id'
)
)
)
;