コード例 #1
0
ファイル: header.php プロジェクト: jasonmilli/FrameWork2
 public function render()
 {
     $paragraph = new \Frame\Views\Paragraph();
     $paragraph->text('Hello Frameworld!');
     $form = new \Frame\Views\Form('\\Work\\Controllers\\Main::welcome', 'welcome');
     $form->input('Name:', 'text', '', 'name');
     $form->input('Age:', 'text', '', 'age');
     $form->input('', 'submit', 'Submit', 'submit');
     $layout = new \Frame\Views\Layout(array(array($paragraph, 'welcome' => $form)));
     return $layout->render();
 }
コード例 #2
0
ファイル: testing.php プロジェクト: jasonmilli/FrameWork2
 public static function output($data)
 {
     $panels = array();
     $controller = arrayGet($data, 'output');
     list($class, $function) = explode('::', $controller);
     unset($data['output']);
     $result = $class::$function($data);
     $panels[] = array($result);
     $form = new \Frame\Views\Form('\\Work\\Controllers\\Testing::save', 'save_test');
     $form->input('', 'hidden', $result, 'result');
     $form->input('', 'hidden', $controller, 'output_controller');
     foreach ($data as $name => $input) {
         $form->input('', 'hidden', $input, $name);
     }
     $form->input('', 'submit', 'Save');
     $panels[] = array('save_test' => $form);
     $layout = new \Frame\Views\Layout($panels);
     return $layout->render();
 }
コード例 #3
0
ファイル: login.php プロジェクト: jasonmilli/FrameWork2
 public function render()
 {
     if (isset($this->data['target'])) {
         $target = $this->data['target'];
     } else {
         $target = 'body';
     }
     $form = new \Frame\Views\Form('\\Work\\Controllers\\Login::check', $target);
     $form->input('', 'hidden', $this->data['class'], 'class');
     $form->input('', 'hidden', $this->data['method'], 'method');
     if (isset($this->data['data'])) {
         foreach ($this->data['data'] as $name => $value) {
             $form->input('', 'hidden', $value, $name);
         }
     }
     $form->input('Username: '******'text', '', 'username');
     $form->input('Password: '******'password', '', 'password');
     $form->input('', 'submit', 'Login');
     return $form->render();
 }