V-TEK Weblog about webdevelopment and linux

2Dec/0621

Undefined variable: javascript in cakePHP with scriptaculous

This weekend I was trying to get scriptaculous work with cakephp. Unfortunately I did always end up with the same error:

[code]Undefined variable: Javascript[/code]

After a couple of hours searching I found the following things can cause this problem:

  1. You do not have the html, javascript and ajax helper defined in your own controller (eg. user_controller.php)[php]var $helpers = array('Html','Javascript','Ajax'); [/php]
  2. Your render action points to a view where no view file is existing for. ( so the view file HAS to be created![php]$this->render('the_method','ajax'); [/php]

Hope it helps somebody who is experiencing the same problem I had.

   

Recent Comments

Tags

Apache cakephp cpanel dav dd-wrt DNS Ext3 Framework GIT GNU grub javascript Kernel lilo Linux LPI LVM MVC MySQL Netbeans Netfilter PHP piping ps3 redirection regex Ruby on Rails Samba Sendmail Shell Skype SNMP Squid Symfony ubuntu upnp vim windows X Xorg X Window System