public function before() { parent::before(); \Fuel\Core\Module::load('basic'); if ($_POST) { $val = \Validation::forge(); $val->add_field('type', 'branch type', 'max_length[20]'); $val->add_field('id', 'subnet id', 'required|min_length[1]|max_length[20]'); if ($val->run()) { $this->id = $val->validated('id'); $this->type = $val->validated('type'); } } }
public function before() { parent::before(); if ($_POST) { $val = \Validation::forge('power'); $val->add_field('eid', 'template id', 'required|min_length[1]|max_length[20]'); $val->add_field('tmpl', 'template or realdevice', 'required|min_length[1]|max_length[20]'); if ($val->run()) { if ($val->validated('tmpl') == "true") { $this->tmpl = true; $this->field = Model_Device_Template_Field::find($val->validated('eid')); //$this->TempsetTypeOfDevice(); } else { $this->tmpl = false; $this->field = Model_Device_Fieldset::find($val->validated('eid')); //$this->setTypeOfDevice(); } } } }
public function before() { parent::before(); }