当前位置: 首页>>代码示例>>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;未经允许,请勿转载。