Skip to content

Instantly share code, notes, and snippets.

@mbischof
Last active October 13, 2015 12:58
Show Gist options
  • Save mbischof/4199867 to your computer and use it in GitHub Desktop.
Save mbischof/4199867 to your computer and use it in GitHub Desktop.
use of yii controller in legacy apps
<?php
function getController()
{
static $controller = null;
if ($controller == null) {
$tmp = Yii::app()->createController('site/index');
$controller = $tmp[0];
$controller->init();
}
return $controller;
}
getController()->renderPartial('index');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment