我有一个网格视图,我想从另一个动作控制器获取列的值.现在我在控制器1中有这个
array(
'name'=>'title',
'value'=>array($this,'Action2'),
),
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
controller1 and its behaviors do not have a method or closure named "Action2".
Run Code Online (Sandbox Code Playgroud)
如果我用"controller2"替换$ this
array(
'name'=>'title',
'value'=>array('controller2','Action2'),
),
Run Code Online (Sandbox Code Playgroud)
我收到这个错误
call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argument is expected to be a valid callback, 'controller2::action2' was given
Run Code Online (Sandbox Code Playgroud)
也许这是不好的做法,但这是可行的吗?
我需要检查控制器中的CAPTCHA,所以我应该从会话表中获取CAPTCHA会话值.我检查会话表,我看到这样的事情:
Yii.CCaptchaAction.3bbe352e.controllername.captcha|s:7:"xemobin"
Run Code Online (Sandbox Code Playgroud)
这是什么"3bbe352e"?
这个值是不变的吗?
我能在这样的控制器中检查CAPTCHA会话吗?
if ($session['Yii.CCaptchaAction.3bbe352e.controllername.captcha']==$_POST['captcha'])
Run Code Online (Sandbox Code Playgroud)