Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Yaf_Controller_Abstract::getResponseYaf_Controller_Abstract::getViewpath>
^Yaf_Controller_AbstractLast updated: Mon, 26 Oct 2026

Yaf_Controller_Abstract::getView

(Yaf >=1.0.0)

Yaf_Controller_Abstract::getView — Retrieve the view engine

Description

public function Yaf_Controller_Abstract::getView(): ?Yaf_View_Interface

Returns the view engine bound to this controller.

Parameters

This function has no parameters.

Return Values

A Yaf_View_Interface instance, or null if no view engine is available.

Examples

Example #1 Yaf_Controller_Abstract::getView() example

<?php
class ProductController extends Yaf_Controller_Abstract
{
    public function indexAction() {
        $view = $this->getView();

        // export $products to the template product/index.phtml
        $view->assign("products", array("yaf", "php"));
    }
}
?>

See Also


<Yaf_Controller_Abstract::getResponseYaf_Controller_Abstract::getViewpath>
^Yaf_Controller_AbstractLast updated: Mon, 26 Oct 2026