src/Controller/TestController.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Model\TestModel;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. class TestController extends AbstractController{
  7.     public function Index():Response{
  8.         $model = new TestModel();
  9.         //$this->$model->$ModelProp2 = "String set up in the controller, after the constructor";
  10.         return $this->render("test_view.html.twig",[
  11.             'ModelProp1' => 'value 1',//$this->$model->$ModelProp1,
  12.             'ModelProp2' => '2',
  13.             'ModelProp3' => rand(1,100),
  14.             //'partialHtml'=>  //$this->$model->$ModelProp2
  15.         ]);
  16.     }
  17. }