/** * Overload method access * * @param string $method * Method to call * @param array $args * Arguments of method * @throws Exception\BadMethodCallException if too few arguments or invalid method * @return mixed */ public function __call($method, $args) { $basePath = ''; if (method_exists($this->view, 'plugin')) { $basePath = $this->view->plugin('basepath')->__invoke(); } $ret = false; if (preg_match('/^(?P<action>(ap|pre)pend)(?P<mode>Bootstrap|Jquery)$/', $method, $matches)) { $ret = $this->callWithCdn($matches, $basePath, $args); } elseif (preg_match('/^(?P<action>(ap|pre)pend)(?P<mode>Chosen|Moment)$/', $method, $matches)) { $ret = $this->callWithoutCdn($matches, $basePath, $args); } return $ret !== false ? $ret : parent::__call($method, $args); }