Fixing errors generated by ajaxProvider class not being loaded when checking for method implementation.

This commit is contained in:
mark_story 2009-08-31 11:38:31 -04:00
parent a43356c772
commit 4d7fc24850

View file

@ -88,10 +88,13 @@ class PaginatorHelper extends AppHelper {
$ajaxProvider = isset($config['ajax']) ? $config['ajax'] : 'Js';
$this->helpers[] = $ajaxProvider;
$this->_ajaxHelperClass = $ajaxProvider;
if (!method_exists($ajaxProvider . 'Helper', 'link')) {
App::import('Helper', $ajaxProvider);
$classname = $ajaxProvider . 'Helper';
if (!method_exists($classname, 'link')) {
$message = sprintf(
__('%s does not implement a link() method, it is incompatible with PaginatorHelper', true),
$ajaxProvider . 'Helper'
$classname
);
trigger_error($message, E_USER_WARNING);
}