wiki:CakeHelper

Cake Helper

This is a Cake helper class. To use it in your project it must be included in the controllers helper array, either in the header part ( var $helpers = array('Html', 'Form','Javascript','Ajax', 'Ext','Cache' ); ) or in the controller action ( $this->helpers = am('Ext', $this->helpers) ).

The helper has only one method:

  • Create an CakePanel config object. There are two ways to use it.
  1. Load the Helper in the controller and use $ext->createExtConfigObject() to generate a JSON configuration object that is digested by the CakePanel Javascript class
  2. If you want to use it from a static page, you have to tell it which Model and Controller it should use, so ie $ext->createExtConfigObject(array(),"Article","articles")

It returns a Javascript JSON object to be used with CakePanel.

  • @return String JSON config object
  • @param Array $descriptions [optional] Override the column header and form fields. If the passed value is an array, the first element is used as column header, the second one is the name of the database field displayed. You can also set pageTitle to set the panel's title
  • @param String $model[optional] Model to work on
  • @param String $controller [optional] Controller to work on