Use a helper inside a Controller in Cakephp


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. class UsersController extends AppController {
  2. function index() {
  3. App::import('Helper', 'Html'); // loadHelper('Html'); in CakePHP 1.1.x.x
  4. $html = new HtmlHelper();
  5. debug($html->link('Cake!', 'http://cakephp.org'));
  6. }
  7. }

URL: http://cakebaker.42dh.com/2007/08/09/how-to-use-a-helper-in-a-controller/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.