How do you customize/style codeigniter errors?

后端 未结 5 1015
野性不改
野性不改 2021-01-04 19:17

I\'m trying to customize the CSS/HTML for error message displays in codeigniter so I can apply a tag too each and style them up.

I tried to Google this and search t

5条回答
  •  一向
    一向 (楼主)
    2021-01-04 20:03

    I recommend more elegant way.

    Сreated a MY_Form_validation.php file and dropped it into application/libraries with the following code overriding the default delimiters.

    class MY_Form_validation extends CI_Form_validation {
    
        public function __construct()
        {
            parent::__construct();
    
            $this->_error_prefix = '

    '; $this->_error_suffix = '

    '; } }

    Link to original: http://chris-schmitz.com/changing-default-error-delimiters-in-codeigniter/

提交回复
热议问题