Dutch PHP Conference 2027

Yaf_Controller_Abstract::getView

(Yaf >=1.0.0)

Yaf_Controller_Abstract::getViewRetrieve the view engine

Опис

public function Yaf_Controller_Abstract::getView(): ?Yaf_View_Interface

Returns the view engine bound to this controller.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

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

Приклади

Приклад #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"));
    }
}
?>

Прогляньте також

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top