Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

6. hello popescu 2

75 Aufrufe

Veröffentlicht am

http://www.rraducanu.ro

Veröffentlicht in: Bildung
  • Login to see the comments

  • Gehören Sie zu den Ersten, denen das gefällt!

6. hello popescu 2

  1. 1. Hello Popescu 2
  2. 2. FormController ……………………. public function popescuAction() { $form=new FormeFormMyForm(); $viewModel = new ViewModel(array('form'=>$form)); $viewModel->setTemplate('forme/index/popescu_form'); return $viewModel; }
  3. 3. public function showpopescuAction() { if(empty($_POST["nume"])){ $msg="Hello! Please return and enter your name: <br/>"; }else{ $msg="Welcome <b>".$_POST["nume"]."</b>!<br/>"; } $viewModel = new ViewModel(array('msg' => $msg)); $viewModel->setTemplate('forme/index/popescu_show'); return $viewModel; }
  4. 4. view/forme/index/popescu_form.phtml <?php $form=$this->form; $form->prepare(); echo $this->form()->openTag($form); echo $this->formRow($form->get('nume')); echo " "; echo $this->formSubmit($form->get('submit')); echo '<br/>'; echo $this->form()->closeTag();
  5. 5. view/forme/index/popescu_show.phtml <?php echo $msg; ?>
  6. 6. module/Forme/config/module.config.php …………… 'popescu' => [ 'type' => Literal::class, 'options' => [ 'route' => '/popescu', 'defaults' => [ 'controller' => ControllerFormController::class, 'action' => 'popescu', ], ], ], ……………………………………..
  7. 7. 'showpopescu' => [ 'type' => Literal::class, 'options' => [ 'route' => '/showpopescu', 'defaults' => [ 'controller' => ControllerFormController::class, 'action' => 'showpopescu', ], ], ], …………………………………
  8. 8. ………………. 'controllers' => [ 'factories' => [ ControllerIndexController::class => InvokableFactory::class, ControllerFormController::class=>InvokableFactory::class, ], ………………………….
  9. 9. ……………………….. 'view_manager' => [ 'display_not_found_reason' => true, 'display_exceptions' => true, 'doctype' => 'HTML5', 'not_found_template' => 'error/404', 'exception_template' => 'error/index', 'template_map' => [ 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml', 'forme/index/index' => __DIR__ . '/../view/forme/index/index.phtml', 'forme/index/hello' => __DIR__ . '/../view/forme/index/hello.phtml', 'forme/index/popescu' => __DIR__ . '/../view/forme/index/popescu_form.phtml', 'forme/index/showpopescu' => __DIR__ . '/../view/forme/index/popescu_show.phtml', 'error/404' => __DIR__ . '/../view/error/404.phtml', 'error/index' => __DIR__ . '/../view/error/index.phtml', ],………………………
  10. 10. /src/Form/MyForm.php ……………. public function __construct() { parent::__construct('myform');//my_form este numele formei $this->setAttribute('method', 'post'); $this->setAttribute('action', '/showpopescu'); //text $this->add([ 'type'=>'text', ………………………………….

×