当前位置: 首页>>代码示例>>PHP>>正文


PHP ClassRegistry::addObject方法代码示例

本文整理汇总了PHP中ClassRegistry::addObject方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassRegistry::addObject方法的具体用法?PHP ClassRegistry::addObject怎么用?PHP ClassRegistry::addObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ClassRegistry的用法示例。


在下文中一共展示了ClassRegistry::addObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 /**
  * setUp method
  *
  * @access public
  * @return void
  */
 function setUp()
 {
     $this->Html =& new HtmlHelper();
     $view =& new View(new TheHtmlTestController());
     ClassRegistry::addObject('view', $view);
     $this->_appEncoding = Configure::read('App.encoding');
 }
开发者ID:hikmanet,项目名称:HnsAutomobiles,代码行数:13,代码来源:html.test.php

示例2: startTest

 /**
  * setUp method
  *
  * @access public
  * @return void
  */
 function startTest()
 {
     $view = new View(new TheGoogleStaticChartEngineTestController());
     $this->GoogleStaticChartEngine = new GoogleStaticChartEngineHelper($view);
     $this->GoogleStaticChartEngine->Html = new HtmlHelper($view);
     ClassRegistry::addObject('view', $view);
 }
开发者ID:nani8124,项目名称:infinitas,代码行数:13,代码来源:GoogleStaticChartEngineHelperTest.php

示例3: startTest

 /**
  * Start Test
  *
  * Setup class vars for testing
  *
  * @return void
  */
 public function startTest()
 {
     $this->ShareThis = new ShareThisHelper();
     $this->ShareThis->Html = new HtmlHelper();
     $this->View =& new TheView(new TheJsTestController());
     ClassRegistry::addObject('view', $this->View);
 }
开发者ID:predominant,项目名称:cake_social,代码行数:14,代码来源:share_this.test.php

示例4: setUp

 /**
  * setUp
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->View = new View();
     $this->Form = new BoostCakeFormHelper($this->View);
     ClassRegistry::addObject('Contact', new Contact());
 }
开发者ID:hiryu85,项目名称:cakephp-boost-cake,代码行数:12,代码来源:BoostCakeFormHelperTest.php

示例5: startTest

 function startTest()
 {
     $this->User = new User();
     $this->MockMiEmail = new MockMiEmail();
     //$this->MockMiEmail->setReturnValue('send', true);
     ClassRegistry::addObject('MiEmail', $this->MockMiEmail);
 }
开发者ID:razzman,项目名称:mi_users,代码行数:7,代码来源:user_account.test.php

示例6: setup

 function setup()
 {
     $this->Menu = new MenuHelper();
     $this->Menu->Html = new HtmlHelper();
     $view =& new View(new TheMenuTestController());
     ClassRegistry::addObject('view', $view);
 }
开发者ID:vuthaiphat,项目名称:CakePHP-Assets,代码行数:7,代码来源:menu.test.php

示例7: initialize

 /**
  * Configuration method.
  *
  * In addition to configuring the settings (see $__defaults above for settings explanation),
  * this function also loops through the installed plugins and 'registers' those that have a
  * PluginNameCallback class.
  *
  * @param object $controller    Controller object
  * @param array $settings       Component settings
  * @access public
  * @return void
  */
 public function initialize(&$controller, $settings = array())
 {
     $this->__controller =& $controller;
     $this->settings = array_merge($this->__defaults, $settings);
     if (empty($this->settings['priority'])) {
         $this->settings['priority'] = Configure::listobjects('plugin');
     } else {
         foreach (Configure::listobjects('plugin') as $plugin) {
             if (!in_array($plugin, $this->settings['priority'])) {
                 array_push($this->settings['priority'], $plugin);
             }
         }
     }
     foreach ($this->settings['priority'] as $plugin) {
         $file = Inflector::underscore($plugin) . '_callback';
         $className = $plugin . 'Callback';
         if (App::import('File', $className, true, array(APP . 'plugins' . DS . Inflector::underscore($plugin)), $file . '.php')) {
             if (class_exists($className)) {
                 $class = new $className();
                 ClassRegistry::addObject($className, $class);
                 $this->__registered[] = $className;
             }
         }
     }
     /**
      * Called before the controller's beforeFilter method.
      */
     $this->executeCallbacks('initialize');
 }
开发者ID:jamienay,项目名称:register_callbacks_component,代码行数:41,代码来源:register_callbacks.php

示例8: initialize

 /**
  * Initialization method. Attaches our error handlers into the current
  * execution and loads all of our error listeners.
  * 
  * @return null
  * @access public
  */
 public function initialize()
 {
     // Tell ClassRegistry about ourself
     ClassRegistry::addObject('Referee.Whistle', $this);
     // Get our grubby paws on the errors and load our listeners
     $this->attachHandlers();
     $this->loadListeners();
 }
开发者ID:predominant,项目名称:referee,代码行数:15,代码来源:whistle.php

示例9: startTest

 /**
  * startTest
  *
  * @return void
  */
 public function startTest()
 {
     $this->View = new View($controller = null);
     ClassRegistry::addObject('view', $this->View);
     Configure::write('Favorites', array('types' => array('favorite' => 'Article', 'watch' => 'Article'), 'defaultTexts' => array('favorite' => 'Favorite it', 'watch' => 'Watch it'), 'modelCategories' => array('Article')));
     $this->Favorites = new FavoritesHelper($this->View);
     $this->Favorites->Html = new HtmlHelper($this->View);
 }
开发者ID:rodrigorm,项目名称:favorites,代码行数:13,代码来源:FavoritesHelperTest.php

示例10: setUp

 /**
  * setUp method
  *
  * The mailHide keys have to be in a certain format see https://groups.google.com/group/recaptcha/browse_thread/thread/3edc0ad4adc33073?pli=1#msg_73107610db1a1c15
  *
  * @return void
  */
 public function setUp()
 {
     Configure::write('Recaptcha.mailHide.publicKey', '01J_tiDKknxUV8w-2NbVFNAQ==');
     Configure::write('Recaptcha.mailHide.privateKey', '411744faf004d447f8208fc51159dc03');
     $this->View = new View(new PostsTestController());
     ClassRegistry::addObject('view', $this->View);
     $this->Recaptcha = new RecaptchaHelper($this->View);
 }
开发者ID:blueangelcpt,项目名称:recaptcha,代码行数:15,代码来源:RecaptchaHelperTest.php

示例11: setUp

 function setUp()
 {
     $this->Javascript = new JavascriptHelper();
     $this->Javascript->Html = new HtmlHelper();
     $this->Javascript->Form = new FormHelper();
     $view =& new View(new TheJsTestController());
     ClassRegistry::addObject('view', $view);
 }
开发者ID:kaz0636,项目名称:openflp,代码行数:8,代码来源:javascript.test.php

示例12: setUp

 function setUp()
 {
     $this->Controller =& new EmailTestController();
     restore_error_handler();
     @$this->Controller->_initComponents();
     set_error_handler('simpleTestErrorHandler');
     $this->Controller->Email->startup($this->Controller);
     ClassRegistry::addObject('view', new View($this->Controller));
 }
开发者ID:rhencke,项目名称:mozilla-cvs-history,代码行数:9,代码来源:email.test.php

示例13: setUp

 public function setUp()
 {
     parent::setUp();
     $Controller = new Controller();
     $View = new View($Controller);
     $this->GanacheFormHelper = new GanacheFormHelper($View);
     $this->FormHelper = new FormHelper($View);
     ClassRegistry::addObject('Contact', new Contact());
 }
开发者ID:gezeresolutionsweb,项目名称:cakeganache,代码行数:9,代码来源:GanacheFormHelperTest.php

示例14: __construct

 /**
  * Construction method.
  * @param array $mappings
  * @return null
  * @access public
  */
 public function __construct($mappings = array())
 {
     parent::__construct();
     // Grab our View object for use later...
     $this->View = ClassRegistry::getObject('view');
     // Merge our mappings together...
     $this->mappings = am($this->mappings, $mappings);
     // Add ourself to the ClassRegistry in case anyone wants to use us
     ClassRegistry::addObject('Analogue', $this);
 }
开发者ID:joebeeson,项目名称:analogue,代码行数:16,代码来源:analogue.php

示例15: setUp

 /**
  * setUp method
  *
  * @return void
  */
 function setUp()
 {
     $request = new CakeRequest('controller_posts/index');
     $response = new CakeResponse();
     $this->Controller = new ArticlesTestController($request, $response);
     $this->Controller->modelClass = 'Article';
     $this->Controller->Referer = new RefererComponent();
     $this->Controller->Referer->initialize($this->Controller, array());
     ClassRegistry::addObject('view', new View($this->Controller));
 }
开发者ID:asadaqain,项目名称:Guide-on-the-Side,代码行数:15,代码来源:RefererComponentTest.php


注:本文中的ClassRegistry::addObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。