<<<<Yii 2.0>>>>
in vendor/yiisoft/yii2/Yii.php ,I add a function like
static private function mytest(){
$cc = Yii::$app->createController('site/show');
$cc[0]->runAction('show');
//cc[0]->runAction('show')->render("/site/show");
//$cc[0]->render("/site/show");
}
while in frontend/controllers/SiteContoller.php,action is such defined
public function actionShow(){
return $this->render('show');
}
and in frontend/themes/default/site/show.php,it,s just,
<?php echo "ssssssss";?>
question is ,when call,Yii::mytest,i just got a white page with nothing on it!
is there anything wrong on the function mytest()??
#######fixing########
sorry i cut some code for short,in fact,mytest is a public func
and is calling a private one named show():
static private function show(){
$cc = Yii::$app->createController('site/show');
$cc[0]->runAction('show');
//cc[0]->runAction('show')->render("/site/show");
//$cc[0]->render("/site/show");
}
//
static function mytest(){
self::show();
}
// i think problem is here
$cc = Yii::$app->createController('site/show');
$cc[0]->runAction('show');