Making helpers load

This commit is contained in:
José Lorenzo Rodríguez 2010-12-04 13:40:24 -04:30
parent be9bcb3627
commit f3eb2159eb
14 changed files with 30 additions and 18 deletions

View file

@ -18,6 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::uses('AppHelper', 'View/Helper');
/** /**
* CacheHelper helps create full page view caching. * CacheHelper helps create full page view caching.
* *

View file

@ -20,6 +20,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::uses('AppHelper', 'View/Helper');
/** /**
* Form helper library. * Form helper library.
* *

View file

@ -17,6 +17,9 @@
* @since CakePHP(tm) v 0.9.1 * @since CakePHP(tm) v 0.9.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::uses('AppHelper', 'View/Helper');
/** /**
* Html Helper class for easy use of HTML widgets. * Html Helper class for easy use of HTML widgets.
* *

View file

@ -18,6 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::uses('AppHelper', 'View/Helper');
App::uses('Multibyte', 'Core'); App::uses('Multibyte', 'Core');
/** /**

View file

@ -25,6 +25,7 @@
* @since CakePHP(tm) v 1.3 * @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::uses('JsHelper', 'Helper'); App::uses('JsHelper', 'Helper');
class MootoolsEngineHelper extends JsBaseEngineHelper { class MootoolsEngineHelper extends JsBaseEngineHelper {

View file

@ -20,6 +20,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::uses('AppHelper', 'View/Helper');
/** /**
* Number helper library. * Number helper library.
* *

View file

@ -18,6 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::uses('AppHelper', 'View/Helper');
/** /**
* Pagination Helper class for easy generation of pagination links. * Pagination Helper class for easy generation of pagination links.
* *

View file

@ -20,6 +20,7 @@
* @since CakePHP(tm) v 1.3 * @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::uses('JsHelper', 'Helper'); App::uses('JsHelper', 'Helper');
class PrototypeEngineHelper extends JsBaseEngineHelper { class PrototypeEngineHelper extends JsBaseEngineHelper {

View file

@ -17,7 +17,9 @@
* @since CakePHP(tm) v 1.2 * @since CakePHP(tm) v 1.2
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::uses('Xml', 'Core');
App::uses('AppHelper', 'View/Helper');
App::uses('Xml', 'Utility');
/** /**
* RSS Helper class for easy output RSS structures. * RSS Helper class for easy output RSS structures.

View file

@ -17,9 +17,10 @@
* @since CakePHP(tm) v 1.1.7.3328 * @since CakePHP(tm) v 1.1.7.3328
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
if (!class_exists('CakeSession')) {
require LIBS . 'cake_session.php'; App::uses('AppHelper', 'View/Helper');
} App::uses('CakeSession', 'Model');
/** /**
* Session Helper. * Session Helper.
* *

View file

@ -24,8 +24,9 @@
* Included libraries. * Included libraries.
* *
*/ */
App::uses('AppHelper', 'View/Helper');
App::uses('HtmlHelper', 'Helper'); App::uses('HtmlHelper', 'Helper');
App::uses('Multibyte', 'Core'); App::uses('Multibyte', 'Utility');
/** /**
* Text helper library. * Text helper library.

View file

@ -18,6 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::uses('AppHelper', 'View/Helper');
/** /**
* Time Helper class for easy use of time data. * Time Helper class for easy use of time data.
* *

View file

@ -54,19 +54,12 @@ class HelperCollection extends ObjectCollection {
return $this->_loaded[$name]; return $this->_loaded[$name];
} }
$helperClass = $name . 'Helper'; $helperClass = $name . 'Helper';
App::uses($helperClass, 'View/Helper');
if (!class_exists($helperClass)) { if (!class_exists($helperClass)) {
if (!App::import('Helper', $helper)) { throw new MissingHelperClassException(array(
throw new MissingHelperFileException(array( 'class' => $helperClass,
'class' => $helperClass, 'file' => Inflector::underscore($name) . '.php'
'file' => Inflector::underscore($name) . '.php' ));
));
}
if (!class_exists($helperClass)) {
throw new MissingHelperClassException(array(
'class' => $helperClass,
'file' => Inflector::underscore($name) . '.php'
));
}
} }
$this->_loaded[$name] = new $helperClass($this->_View, $settings); $this->_loaded[$name] = new $helperClass($this->_View, $settings);

View file

@ -22,7 +22,6 @@
* Included libraries. * Included libraries.
*/ */
App::uses('HelperCollection', 'View'); App::uses('HelperCollection', 'View');
App::uses('Helper', 'View');
/** /**
* View, the V in the MVC triad. * View, the V in the MVC triad.