php - How to access a different controller from inside a controller Symfony2 -


i need access method different controller inside controller. how can it? can use this->get method?

can include controller inside current controller , make object of , access method via object? "ok" way?

i want call form method --- newaction of other controller.

you can define controller service, in controller.

in services.yml define needed controller service:

services:     your_service_name:         class: yourcompany\yourbundle\controller\yourcontroller 

then in controller you'll able service via container:

$yourcontroller = $this->get('your_service_name'); 

there useful information controllers services in documentation


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -