letThemCodeCake

Javascript Helper.

by Ian on Mar.30, 2007, under Learning Cakephp

How does the javascript helper work?

$javascript->link() function.
Youl’d think there’d be a section in the manual under the helpers saying:
Css helper, called by $css->function(). Here’s a list of fuctions.
Javascript helper, called by $javascript->function(). etc.

It looks like the rule of thumb is the full word, lowercase, prefixed with a $ sign, and be sure to add the Helper name in your controller. So to use the javascript ( along with html and form) helper:
I set $var $helpers = (’Html’, ‘Form’, ‘Javascript’); in my controller.


Leave a Reply

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...