Created
February 6, 2013 14:41
-
-
Save onre/4722939 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// if Yii::app()->controller doesn't exist create a dummy | |
// controller to render the view (needed in the console app) | |
if(!($controller = Yii::app()->controller)) | |
$controller = new CController('YiiMail'); | |
// renderPartial won't work with CConsoleApplication, so use | |
// renderInternal - this requires that we use an actual path to the | |
// view rather than the usual alias | |
$viewPath = Yii::app()->findLocalizedFile(Yii::getPathOfAlias(Yii::app()->mail->viewPath.'.'.$this->view).'.php'); | |
$body = $controller->renderInternal($viewPath, array_merge($body, array('mail'=>$this)), true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment