Example #1
0
 /**
  * Search the mixin method map and call the method or trigger an error
  * 
  * This function check to see if the method exists in the mixing map if not
  * it will call the 'listbox' function. The method name will become the 'name'
  * in the config array.
  * 
  * This can be used to auto-magically create select filters based on the 
  * function name.
  *
  * @param  string   The function name
  * @param  array    The function arguments
  * @throws BadMethodCallException   If method could not be found
  * @return mixed The result of the function
  */
 public function __call($method, array $arguments)
 {
     if (!in_array($method, $this->getMethods())) {
         $config = $arguments[0];
         $config['name'] = KInflector::singularize(strtolower($method));
         return $this->_listbox($config);
     }
     return parent::__call($method, $arguments);
 }
Example #2
0
 /**
  * Search the mixin method map and call the method or trigger an error
  *
  * This function check to see if the method exists in the mixing map if not it will call the 'listbox' function.
  * The method name will become the 'name' in the config array.
  *
  * This can be used to auto-magically create select filters based on the function name.
  *
  * @param  string   $method The function name
  * @param  array    $arguments The function arguments
  * @throws BadMethodCallException   If method could not be found
  * @return mixed The result of the function
  */
 public function __call($method, $arguments)
 {
     if (!in_array($method, $this->getMethods())) {
         $config = $arguments[0];
         if (!isset($config['name'])) {
             $config['name'] = KStringInflector::singularize(strtolower($method));
         }
         return $this->_render($config);
     }
     return parent::__call($method, $arguments);
 }