public static function inputs($data) { $controller = arrayGet($data, 'inputs_submit'); $controller_id = \Work\Models\Controller::where('controller', '=', $controller)->pluck('controller_id'); $inputs = \Work\Models\Input::where('controller_id', '=', $controller_id)->get(); $form = new \Frame\Views\Form('\\Work\\Controllers\\Testing::output', 'output'); $form->input('', 'hidden', $controller, 'output'); foreach ($inputs as $input) { $form->input($input->label, $input->type, $input->value, $input->input); } return $form->render(); }
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(); }