jablonka.czprosek.czf

freenet-router

Subversion Repositories:
[/] [trunk/] [freenet-router/] [var/] [www/] [freenet-router/] [Framework/] [Controllers/] [FormController.php] - Blame information for rev 2

 

Line No. Rev Author Line
12simandl<?php
2 
3namespace Phem\Controllers;
4 
5use Phem\Controllers\SimpleViewController;
6use Phem\Libraries\Forms\AnnotationFormBuilder;
7use Srovnavac\Libraries\Environment\EnvironmentManager;
8 
9/**
10 * Administration
11 *
12 * @author Jakub PetrŞílka <petrzilka@czweb.net>
13 */
14class FormController extends SimpleViewController
15{
16 
17 function __construct()
18 {
19 parent::__construct();
20 $classPathArray = explode("\\", get_class($this));
21 $classShortName = end($classPathArray);
22 $controllerName = str_replace("Controller", "", $classShortName);
23 
24 $this->getModel()->set('updateFormUrl', EnvironmentManager::getLinkBuilder()->link(array("controller" => $controllerName, "task" => "updateForm")));
25 }
26 
27 public function updateForm()
28 {
29 $data = EnvironmentManager::getSubmittedFormObject();
30 $ab = new AnnotationFormBuilder();
31 $form = $ab->buildForm(get_class($data), $data);
32 $this->model->put("form", $form);
33 $this->template = "@Phem/simpleForm.twig";
34 }
35 
36}

Powered by WebSVN 2.2.1