Search code examples
staticcallyiiinstance

HowTo: Call method: renderPartial() - statically?


How can I call this method in Yii Framework:

$this->renderPartial(string $fileNameToRenderData, bool $wheaterToReturnOrEchoDirectly);

Statically, like this:

GodForbiddenClassName::renderPartial(string $fileNameToRenderData, bool $wheaterToReturnOrEchoDirectly);

Solution

  • You might want to look at renderInternal which I've used in custom class functions, etc. It can be called like:

    $ccc = new CController('context');
    $html = $ccc->renderInternal($view_file_string, array('data'=>$data), true);