PHP 8.6.0 Beta 3 is available for testing

Yaf_Controller_Abstract::init

(Yaf >=1.0.0)

Yaf_Controller_Abstract::initController initializer

Açıklama

public function Yaf_Controller_Abstract::init(): void

Yaf_Controller_Abstract::__construct() is not meant to be overridden with custom logic, so Yaf_Controller_Abstract::init() is provided as the userland initialization hook. If it is defined in a controller, it is called right after the controller object is instantiated.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

No value is returned.

Örnekler

Örnek 1 Yaf_Controller_Abstract::init() example

<?php
class IndexController extends Yaf_Controller_Abstract
{
    // init() is called right after the controller is instantiated,
    // before any action is dispatched
    public function init() {
        $this->getView()->assign("sitename", "Yaf Tutorial");
    }

    public function indexAction() {
        // ...
    }
}
?>

Ayrıca Bakınız

add a note

User Contributed Notes

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