Currently, I created a command, and I'm trying to use the command to call one function in the controller.
So I think the first step is to make the controller as a service that the command line can call.
According to the Symfony2 online book: in the services.yml:
parameters:
property.controller.core.class: Ladoo\Brolly\CoreBundle\Controller\PropertyController
services:
property.core.controller:
class: '%property.controller.core.class'
And in the command php file:
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->forward('property.core.controller:updatePropertyAction');
}
But the result says that forward is not defined.
And my question is how to fix that problem, and how to run a function in controller using the command line. Let me know if my steps are wrong.