|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2011-11-7 14:52:15
|
显示全部楼层
$config = array(
'signup' => array(
array(
'field' => 'title',
'label' => '标题',
'rules' => 'callback_null_check'
),
array(
'field' => 'neirong',
'label' => '内容',
'rules' => 'callback_null_check'
)
)
);
public function null_check($str){
if(empty($str)){
echo '1'.$str;
$this->form_validation->set_message('null_check', '%s不能为空');
return FALSE;
}
else{
echo '2'.$str;
return TRUE;
}
}
if($this->form_validation->run('signup')==TRUE){
$date = array(
'title' =>$this->input->post('title')
,'neirong' =>$this->input->post('neirong')
,'datetime' => time()
);
$this->mlyb->insert('lyb',$date);
} |
|