Wednesday, July 28, 2010

php- Cakephp how to load helper in a component

Helpers can be loaded in to components and use as class objects

function index() {
App::import('Helper', 'Html'); // loadHelper('Html'); in CakePHP 1.1.x.x
$html = new HtmlHelper();
debug($html->link('Cake!', 'http://cakephp.org'));
}

No comments: