Skip to content

Commit

Permalink
Adding docs to explain buffering control.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Mar 29, 2009
1 parent 8eeb00b commit 57ceba5
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions cake/libs/view/helpers/js.php
Expand Up @@ -93,12 +93,24 @@ function __construct($settings = array()) {
parent::__construct(); parent::__construct();
} }
/** /**
* call__ * call__ Allows for dispatching of methods to the Engine Helper.
* methods in the Engines bufferedMethods list will be automatically buffered.
* You can control buffering with the buffer param as well. By setting the last parameter to
* any engine method to a boolean you can force or disable buffering.
*
* e.g. ```$js->get('#foo')->effect('fadeIn', array('speed' => 'slow'), true);```
*
* Will force buffering for the effect method. If the method takes an options array you may also add
* a 'buffer' param to the options array and control buffering there as well.
*
* e.g. ```$js->get('#foo')->event('click', $functionContents, array('buffer' => true));
*
* The buffer parameter will not be passed onto the EngineHelper.
* *
* @param string $method Method to be called * @param string $method Method to be called
* @param array $params Parameters for the method being called. * @param array $params Parameters for the method being called.
* @access public * @access public
* @return void * @return mixed
**/ **/
function call__($method, $params) { function call__($method, $params) {
if (isset($this->{$this->__engineName}) && method_exists($this->{$this->__engineName}, $method)) { if (isset($this->{$this->__engineName}) && method_exists($this->{$this->__engineName}, $method)) {
Expand Down Expand Up @@ -246,8 +258,8 @@ function __object($name, $var) {
} }


/** /**
* JsEngineBaseClass * JsEngineBaseClass
* *
* Abstract Base Class for All JsEngines to extend. Provides generic methods. * Abstract Base Class for All JsEngines to extend. Provides generic methods.
* *
* @package cake.view.helpers * @package cake.view.helpers
Expand All @@ -273,6 +285,13 @@ class JsBaseEngineHelper extends AppHelper {
* @var array * @var array
**/ **/
var $_optionMap = array(); var $_optionMap = array();
/**
* An array of Methods in the Engine that are buffered unless otherwise disabled. This allows specific 'end point'
* methods to be automatically buffered by the JsHelper.
*
* @var string
**/
var $bufferedMethods = array();
/** /**
* Constructor. * Constructor.
* *
Expand Down

0 comments on commit 57ceba5

Please sign in to comment.