Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
When processing the form in the controller, simply delete the rule in the text field from the rules array.
Please write how you solved this problem. Others, I think, will also be interesting.
In general, everything is done very simply:
public function rules()
{
$rules = array(
// здесь все наши правила без правила для "text"
);
if (Auth::instance()->logged_in('moderator'))
{
$rules['text'] = array(
array('not_empty'),
);
}
return $rules;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question