callback_add_field例子

分享于 

1分钟阅读

Web开发

  简体

callback_add_field例子


function example_callback_add_field(){
 $crud = new grocery_CRUD();
 
 $crud->set_table('offices');
 $crud->set_subject('Office');
 $crud->required_fields('city');
 $crud->columns('city','country','phone','addressLine1','postalCode');
 
 $crud->callback_add_field('phone',array($this,'add_field_callback_1'));
 $crud->callback_add_field('state',array($this,'add_field_callback_2'));
 
 $output = $crud->render();
 
 $this->_example_output($output);
}
 
function add_field_callback_1()
{
 return '+30 <input type="text" maxlength="50" value="" name="phone" style="width:462px">';
}
 
function add_field_callback_2()
{
 return '<input type="text" maxlength="50" value="" name="state" style="width:400px"> ( for U.S. only )';
} 



CAL  调用  回调  
相关文章