downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Yaf_Dispatcher> <Yaf_Application::__wakeup
[edit] Last updated: Fri, 17 May 2013

view this page in

La classe Yaf_Bootstrap_Abstract

(No version information available, might only be in SVN)

Introduction

Bootstrap est un mécanisme utilisé pour réaliser des configurations initiales avant l'exécution d'une application.

Les utilisateurs peuvent définir leur propre classe de Bootstrap héritant de la classe Yaf_Bootstrap_Abstract

Toutes les méthodes déclarées dans la classe Bootstrap commençant par "_init", seront appelées par la méthode Yaf_Application::bootstrap() une par une, et en suivant leur ordre de définition.

Exemples

Exemple #1 Bootstrap example

<?php
   
/* La classe bootstrap doit être définie ici : ./application/Bootstrap.php */
   
class Bootstrap extends Yaf_Bootstrap_Abstract {
        public function 
_initConfig(Yaf_Dispatcher $dispatcher) {
            
var_dump(__METHOD__);
        }
        public function 
_initPlugin(Yaf_Dispatcher $dispatcher) {
            
var_dump(__METHOD__);
        }
   }

   
$config = array(
       
"application" => array(
           
"directory" => dirname(__FILE__) . "/application/",
       ),
   );
 
   
$app = new Yaf_Application($config);
   
$app->bootstrap();
?>

L'exemple ci-dessus va afficher quelque chose de similaire à :

string(22) "Bootstrap::_initConfig"
string(22) "Bootstrap::_initPlugin"

Synopsis de la classe

abstract Yaf_Bootstrap_Abstract {
/* Propriétés */
/* Méthodes */
}


add a note add a note User Contributed Notes Yaf_Bootstrap_Abstract - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites