本文整理汇总了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');
}
示例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);
}
示例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);
}
示例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());
}
示例5: startTest
function startTest()
{
$this->User = new User();
$this->MockMiEmail = new MockMiEmail();
//$this->MockMiEmail->setReturnValue('send', true);
ClassRegistry::addObject('MiEmail', $this->MockMiEmail);
}
示例6: setup
function setup()
{
$this->Menu = new MenuHelper();
$this->Menu->Html = new HtmlHelper();
$view =& new View(new TheMenuTestController());
ClassRegistry::addObject('view', $view);
}
示例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');
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
示例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());
}
示例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);
}
示例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));
}