PHP 8.6.0 Beta 3 is available for testing

Yaf_Controller_Abstract::setViewpath

(Yaf >=1.0.0)

Yaf_Controller_Abstract::setViewpathSet the view path

Descrizione

public function Yaf_Controller_Abstract::setViewpath(string $view_directory): ?bool

Sets the template directory of the view engine bound to this controller.

Elenco dei parametri

view_directory

The directory that holds the view templates.

Valori restituiti

Returns true on success, or false / null on failure.

Esempi

Example #1 Yaf_Controller_Abstract::setViewpath() example

<?php
class ProductController extends Yaf_Controller_Abstract
{
    public function init() {
        // from now on templates of this controller are looked up
        // under application/themes/dark/views/
        $this->setViewpath(APPLICATION_PATH . "/themes/dark/views");
    }

    public function indexAction() {
        // renders application/themes/dark/views/product/index.phtml
        $this->display("product/index.phtml");
    }
}
?>

Vedere anche:

add a note

User Contributed Notes

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