* FUNCTION di CONTROLLER

class DocumentController extends Controller

{

public function testXY()

{

return “complex display”;

}

}

* PENGGUNAAN di VIEW

<?php echo $this->testXY(); ?>

Sumber : http://www.yiiframework.com/wiki/125/putting-function-to-be-called-in-view/