Yet Another Framework Yaf_Bootstrap_Abstract 클래스

(사용 가능한 버전 정보가 없으며 Git에만 있을 수 있음)


소개

부트스트랩은 애플리케이션이 실행되기 전에 일부 초기 구성을 수행하는 데 사용되는 메커니즘입니다.

사용자는 Yaf_Bootstrap_Abstract를 상속하여 자신의 Bootstrap 클래스를 정의할 수 있습니다.

선행 "_init"이 있는 Bootstrap 클래스에 선언된 모든 메서드는 정의된 순서에 따라 Yaf_Application::bootstrap()에 의해 하나씩 호출됩니다.


Examples

예제 #1 부트스트랩 예제

                  
<?php
   /* bootstrap class should be defined under ./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();
?>
                  
                

위의 예는 다음과 유사한 결과를 출력합니다.

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

클래스 개요

                  
abstract class Yaf_Bootstrap_Abstract {

  /* Properties */

  /* Methods */
}