How to pass Yii session to scripts out of Yii framework?
I have a self-made math captcha and it should be output without anything before it's image header, so I can't make it a 'View'. I put this captcha.php in the web root dir, but it can't share session with scripts in Yii. How to solve this?
Is there any way to pass the session from Yii to the other script开发者_开发问答s or clean anything before the header in view?
Though it is true that the default layout wraps the page's content with the typical html markup you'd expect, you have complete control over that by specifying the layout you'd like from the controller by using $this->layout = ...
You can set it to null to use module layout or false to disable the layout completely. See more details in Yii API Docs.
Alternatively you can call $this->renderPartial('view name') if you'd like the output of your captcha script displayed without the surrounding page content.
精彩评论