Validate Rule

Hello friends.

I created a function on my model to validate a field. The function run ok, but I don´t know how to show in my view the error messenger. How can I do this?

Follow my model code:

public function rules()


		return array(



			array('grupo, id, sincronizado, tipo_sequencia, qtd_andares, qtd_aptos, nomenclatura', 'safe', 'on'=>'search'),




        public function validaSequencia(){

            if($this->tipo_sequencia == "numerica"){

                if(empty($this->qtd_andares) || empty($this->qtd_aptos)){

                    $this->addError('tipo_sequencia','error menssenger');





I fix the problem, I add in my form:

<?php echo $form->error($model,‘qtd_aptos’); ?>


Refere this link too for your future reference. ;)

According to your code it sould be

echo $form->error($model,'tipo_sequencia');

Thank you