PHP 8.3.4 Released!

Yaf_Dispatcher::registerPlugin

(Yaf >=1.0.0)

Yaf_Dispatcher::registerPluginRegistra un complemento

Descripción

public Yaf_Dispatcher::registerPlugin(Yaf_Plugin_Abstract $plugin): Yaf_Dispatcher

Registra un complemento (véase Yaf_Plugin_Abstract). Generalmente se registran complementos en el Arranque (véase la clase Yaf_Bootstrap_Abstract).

Parámetros

plugin

Valores devueltos

Ejemplos

Ejemplo #1 Yaf_Dispatcher::registerPlugin()example

<?php
class Bootstrap extends Yaf_Bootstrap_Abstract{
public function
_initPlugin(Yaf_Dispatcher $despachador) {
/**
* Yaf asume que los scripts de complementos están en [application.directory] . "/plugins"
* para este caso, será:
* [application.directory] . "/plugins/" . "User" . [application.ext]
*/
$usuario = new UserPlugin();
$despachador->registerPlugin($usuario);
}
add a note

User Contributed Notes

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