cakephp - Cake PHP drop down list -
I would like to know how to add a drop down list to "access control" with the value "staff" and "admin". This is my addiction function in the Employee Controller
add public function () (if ($ this-> Request-> ('Post')) {$ this-> Save ($ -> this-> employee-> Save ($ -> -> -> Data->); {$ this- & gt; session- & Gt; Set Flash (__ ('Employee has been saved.')); $$ -> (- 'Action' => Index;); Redirect;); } And {$ this- & gt; Session-> Set Flash (__ ('Employee could not be saved, please try again.')); }}} This add-on is the visual code:
Form- & gt; Input ('date_hired', array ('dateFormat' = & gt; 'DMY', 'minyear' => Date ('Y') - 100, 'Max-Year' => ('Y') + 100)); Sampling $ this- & gt; Form- & gt; Input ('employee_phone_number'); Copy $ this- & gt; Form- & gt; Input ('employee_email'); Echo $ the-> Form- & gt; Input ('employee_address'); Now $ $-> Form- & gt; Input ('employee_dob', array ('dateFormat' = & gt; 'DMY', 'miner' = & gt; date ('y') - 100, 'max-year' => ('Y') + 100)); Copy $ this- & gt; Form- & gt; Input ('access_level'); Copy $ this- & gt; Form- & gt; Input ('employee_username'); Copy $ this- & gt; Form- & gt; Input ('employee_pv'); ? & Gt; & Lt; / Fieldset & gt; & Lt ;? Php echo $ this- & gt; Form- & gt; End (__ ('send')); ? & Gt; & Lt; / Div & gt; Adding a drop down list to
with access control The value is employee and administrator . Add it to your Employee Controller $ client = $ this- & gt; Employee- & gt; ModelName- & gt; Search ('list'); $ This- & gt; Set (compact ('customers'); and view.ctp copy $ this-> Form- & gt; Input ('access_level');
Comments
Post a Comment