Skip to content

Instantly share code, notes, and snippets.

@robzienert
Created October 20, 2010 13:48
Show Gist options
  • Select an option

  • Save robzienert/636430 to your computer and use it in GitHub Desktop.

Select an option

Save robzienert/636430 to your computer and use it in GitHub Desktop.
This bootstrap process doesn't seem correct.
<?php
class Sites_Bootstrap extends Zend_Application_Module_Bootstrap
{
public function initResourceLoader()
{
$loader = $this->getResourceLoader();
$loader->addResourceType('helper', 'helpers', 'Helper');
}
protected function _initHelpers()
{
Zend_Controller_Action_HelperBroker::addPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'helpers', 'Sites_Helper');
}
// Using this method, the Action Controller still acts like it can't find
// a helper by the name of 'search'...
// protected function _initHelpers()
// {
// Zend_Controller_Action_HelperBroker::addHelper(new Sites_Helper_Search());
// }
}
<?php
class Sites_FooController extends Zend_Controller_Action
{
public function searchAction()
{
$this->_helper->search($this->_getParam('query', null), $this->_getParam('page', 1));
exit;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment