protected function setup_form() { $form = new Petro_Form(); $form->add_model('Model_Group'); $form->add_form_action(\Form::submit('submit', 'Submit', array('class' => 'btn btn-primary'))); $form->add_form_action(\Html::anchor('groups', 'Cancel', array('class' => 'btn'))); return $form; }
protected function setup_form() { $form = new Petro_Form(array('class' => 'form-horizontal')); $form->add_model('Model_Client'); $form->add_form_action(\Form::submit('submit', 'Submit', array('class' => 'btn btn-primary'))); $form->add_form_action(\Html::anchor('clients', 'Cancel', array('class' => 'btn'))); // $form->sequence(array('status', '<hr/>', 'name_en', 'name', 'code')); $this->sidebars->add('New Client!', '<form action="#">' . 'Edit Client: This is the demo sidebar section inspired ' . 'by the <a href="#">ActiveAdmin</a> package for ruby' . '</form>'); return $form; }
protected function setup_form_change_password() { $form = new Petro_Form(); $form->set_fields(array('old_password' => array('validation' => array('required'), 'form' => array('type' => 'password')), '<hr/>', 'new_password' => array('validation' => array('required', 'min_length' => array(6)), 'form' => array('type' => 'password')), 'confirm_password' => array('validation' => array('match_field' => array('new_password')), 'form' => array('type' => 'password')))); $form->add_form_action(\Form::submit('submit', 'Submit', array('class' => 'btn btn-primary'))); $form->add_form_action(\Html::anchor('users', 'Cancel', array('class' => 'btn'))); return $form; }