Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding docs to explain buffering control.

  • Loading branch information...
commit 57ceba5c9c32ddedfeda27913fd97d16c40e68a8 1 parent 8eeb00b
@markstory markstory authored
Showing with 23 additions and 4 deletions.
  1. +23 −4 cake/libs/view/helpers/js.php
View
27 cake/libs/view/helpers/js.php
@@ -93,12 +93,24 @@ function __construct($settings = array()) {
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 array $params Parameters for the method being called.
* @access public
- * @return void
+ * @return mixed
**/
function call__($method, $params) {
if (isset($this->{$this->__engineName}) && method_exists($this->{$this->__engineName}, $method)) {
@@ -246,8 +258,8 @@ function __object($name, $var) {
}
/**
- * JsEngineBaseClass
- *
+ * JsEngineBaseClass
+ *
* Abstract Base Class for All JsEngines to extend. Provides generic methods.
*
* @package cake.view.helpers
@@ -274,6 +286,13 @@ class JsBaseEngineHelper extends AppHelper {
**/
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.
*
* @return void
Please sign in to comment.
Something went wrong with that request. Please try again.