Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Yii Framework Captcha Conflict With Beforeaction() Function

$
0
0
I have app in Yii and i extend all classes from some base controller and i have these code in it :
protected function beforeAction($action)
    {
        $this->setglobalvariable();
        return parent::beforeAction($action);
    }


as i just understand , these code prevent the Captcha to show , because when i delete it , the captcha shows up ! the captcha function is :

public function actions()
    {
        return array(
            // captcha action renders the CAPTCHA image displayed on the contact page
            'captcha'=>array(
                'class'=>'CCaptchaAction',
                'backColor'=>0xFFFFFF,
                'minLength'=>2,
                'maxLength'=>3,
                'width'=>60,
            ),
            // page action renders "static" pages stored under 'protected/views/site/pages'
            // They can be accessed via: index.php?r=site/page&view=FileName
            'page'=>array(
                'class'=>'CViewAction',
            ),
        );
    }



So how could i use beforeAction and captcha in same time ?

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>