M
M
magary42017-02-03 16:38:42
symfony
magary4, 2017-02-03 16:38:42

How to make friends with old legacy codes with symfony?

The project does not understand what old *.php files respond to some routes, they do it even there and render the answer in their template engine
, is it possible to call the controller somehow from them?
there is something like

$tpl = Template::factory();

$tpl->setVariable( 'module', $Module );
$tpl->setVariable( 'account_activated', $accountActivated );
$tpl->setVariable( 'already_active', $alreadyActive );
$tpl->setVariable( 'is_pending' , $isPending );

?>

do I need to do something like
call_user_func("MyController", ["module"=>$Module, "account_activated"=>$accountActivated] from the end of the file so
that the controller will work further and I could pull some service inside and further render the response to twig?
or
as far as I know, the kernel is available through a global variable
, you can access the kernel directly
, but it is necessary that the execution of the php file be interrupted and control transferred to the controller

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question