Yaf_Controller_Abstract::init

(Yaf >=1.0.0)

Yaf_Controller_Abstract::initInitialisateur du contrôleur

Description

public function Yaf_Controller_Abstract::init(): void

La méthode Yaf_Controller_Abstract::__construct() n'est pas destinée à être surchargée avec une logique personnalisée. La méthode Yaf_Controller_Abstract::init() est donc fournie comme point d'entrée d'initialisation côté utilisateur. Si elle est définie dans un contrôleur, elle est appelée juste après l'instanciation de l'objet contrôleur.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Aucune valeur n'est retournée.

Exemples

Exemple #1 Exemple avec Yaf_Controller_Abstract::init()

<?php
class IndexController extends Yaf_Controller_Abstract
{
    // init() est appelée juste après l'instanciation du contrôleur,
    // avant que la moindre action ne soit distribuée
    public function init() {
        $this->getView()->assign("sitename", "Tutoriel Yaf");
    }

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

Voir aussi

add a note

User Contributed Notes

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