當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Loader_Autoloader_Resource::addResourceTypes方法代碼示例

本文整理匯總了PHP中Zend_Loader_Autoloader_Resource::addResourceTypes方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Loader_Autoloader_Resource::addResourceTypes方法的具體用法?PHP Zend_Loader_Autoloader_Resource::addResourceTypes怎麽用?PHP Zend_Loader_Autoloader_Resource::addResourceTypes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Loader_Autoloader_Resource的用法示例。


在下文中一共展示了Zend_Loader_Autoloader_Resource::addResourceTypes方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _initAutoloader

 /**
  * Initialize pseudo-namespaces,
  * auto-loader and resource groups
  *
  * @return void
  */
 protected function _initAutoloader()
 {
     $moduleLoader = new Zend_Application_Module_Autoloader(['namespace' => ucfirst('Default'), 'basePath' => APPLICATION_PATH . '/modules/default']);
     $moduleLoader->addResourceTypes(['controller' => ['namespace' => 'Controller', 'path' => 'controllers']]);
     $appResources = new Zend_Loader_Autoloader_Resource(['basePath' => APPLICATION_PATH, 'namespace' => 'App']);
     $appResources->addResourceTypes(['models' => ['namespace' => 'Model', 'path' => 'models']]);
 }
開發者ID:execrot,項目名稱:sender-server,代碼行數:13,代碼來源:Bootstrap.php

示例2: _initAutoLoader

 protected function _initAutoLoader()
 {
     $loader = new Zend_Loader_Autoloader_Resource(array("basePath" => APPLICATION_PATH, "namespace" => "App"));
     $loader->addResourceTypes(array("form" => array("path" => "modules/default/forms", "namespace" => "Form"), "formp" => array("path" => "modules/painel/forms", "namespace" => "Painel_Form"), "class" => array("path" => "Class", "namespace" => "Class")));
     $loader->addResourceType("model", "models/", "Model");
     $loader->addResourceType("plugin", "plugins/", "Plugin");
     $loader->addResourceType("class", "Class/", "Class");
 }
開發者ID:alissonpirola,項目名稱:site-drandre,代碼行數:8,代碼來源:Bootstrap.php

示例3: _initAutoloader

 /**
  * Initialize pseudo-namespaces,
  * auto-loader and resource groups
  *
  * @return void
  */
 protected function _initAutoloader()
 {
     $modules = ['default'];
     foreach ($modules as $module) {
         $moduleLoader = new Zend_Application_Module_Autoloader(['namespace' => ucfirst($module), 'basePath' => APPLICATION_PATH . '/modules/' . $module]);
         $moduleLoader->addResourceTypes(['controller' => ['namespace' => 'Controller', 'path' => 'controllers']]);
     }
     $appResources = new Zend_Loader_Autoloader_Resource(['basePath' => APPLICATION_PATH, 'namespace' => 'App']);
     $appResources->addResourceTypes(['exceptions' => ['namespace' => 'Exception', 'path' => 'exceptions'], 'mappers' => ['namespace' => 'Map', 'path' => 'mappers'], 'helpers' => ['namespace' => 'Helper', 'path' => 'helpers'], 'models' => ['namespace' => 'Model', 'path' => 'models'], 'plugins' => ['namespace' => 'Plugin', 'path' => 'plugins'], 'services' => ['namespace' => 'Service', 'path' => 'services']]);
 }
開發者ID:execrot,項目名稱:storage-server,代碼行數:16,代碼來源:Bootstrap.php

示例4: testAutoloadShouldAllowEmptyNamespacing

 public function testAutoloadShouldAllowEmptyNamespacing()
 {
     $loader = new Zend_Loader_Autoloader_Resource(array('namespace' => '', 'basePath' => realpath(dirname(__FILE__) . '/_files')));
     $loader->addResourceTypes(array('service' => array('path' => 'services', 'namespace' => 'Service')));
     $test = $loader->load('ZendLoaderAutoloaderResourceTest', 'service');
     $this->assertTrue($test instanceof Service_ZendLoaderAutoloaderResourceTest);
 }
開發者ID:travisj,項目名稱:zf,代碼行數:7,代碼來源:ResourceTest.php

示例5: _setAutoloader

 /**
  * set Resource auto loader
  */
 public function _setAutoloader()
 {
     self::$_autoloader = new Zend_Loader_Autoloader_Resource(array('basePath' => SP_APP_PATH . '/modules', 'namespace' => 'SP_'));
     self::$_autoloader->addResourceTypes(array('user' => array('path' => 'user/models', 'namespace' => 'User_Model'), 'project' => array('path' => 'project/models', 'namespace' => 'Project_Model')));
 }
開發者ID:victorli,項目名稱:ShrimpProject,代碼行數:8,代碼來源:Application.php

示例6: _initLoaderResource

 protected function _initLoaderResource()
 {
     error_reporting(-1);
     $resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => $this->_docRoot . '/application', 'namespace' => 'Vslice'));
     $resourceLoader->addResourceTypes(array('model' => array('namespace' => 'Model', 'path' => 'models')));
 }
開發者ID:ankuradhey,項目名稱:laundry,代碼行數:6,代碼來源:Bootstrap.php

示例7: setResoucesToAutoloader

 /**
  * Set resouces to autoloader
  *
  * @param  array $resources Resources
  * @access public
  * @return Gene_Application_Setting_Path Fluent interface
  */
 public function setResoucesToAutoloader(array $resources)
 {
     if (isset($resources['namespace']) && isset($resources['basePath'])) {
         $resources = array($resources);
     }
     foreach ($resources as $val) {
         $loader = new Zend_Loader_Autoloader_Resource($val);
         $loader->addResourceTypes(array('services' => array('namespace' => 'Services', 'path' => 'services'), 'models' => array('namespace' => 'Models', 'path' => 'models')));
         $key = isset($val['namespace']) ? strtolower($val['namespace']) : '';
         $this->_loader[$key] = $loader;
     }
     return $this;
 }
開發者ID:heavenshell,項目名稱:gene,代碼行數:20,代碼來源:Path.php


注:本文中的Zend_Loader_Autoloader_Resource::addResourceTypes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。