controller - launch command from url in Symfony 2.5 -


i try eg router:debug slug :

there no commands defined in "router" namespace.

/**      * method      *      * @route("/command-execute/{slug}", name="execute")      *      * @template()      *      */     public function executeaction($slug)     {         //todo add params , add security         $kernel = $this->get('kernel');         $application = new application($kernel);         $application->setautoexit(false);          $options = array('command' => $slug);          $input = new arrayinput($options);         $output = new streamoutput(fopen('php://temp', 'w'));          $application->dorun($input, $output);          rewind($output->getstream());         $response =  stream_get_contents($output->getstream());         //<pre> output of string array on layout         echo '<pre>';          return array('response'=> $response);      } 

any idea's ?

try find command ->find($slug) , after perform $command->run($input, $output);


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -