/** * @param \Zend\Validator\ValidatorInterface $validator * @return null|AbstractRule */ public function getRule(ValidatorInterface $validator = null) { $validatorName = strtolower(Filter::getClassName($validator)); if ($this->getPluginManager()->has($validatorName)) { $rule = $this->getPluginManager()->get($validatorName); $rule->setValidator($validator); return $rule; } return null; }
/** * Inject a helper instance with the registered translator * * @param JQueryInterface * @return void */ public function injectConfig(JQueryPluginManagerAwareInterface $JQuery) { if ($JQuery instanceof JQueryPluginManagerAwareInterface) { $JQuery->setOptions($this->config->getExtraOption(Filter::getClassName($JQuery))); $JQuery->setServiceLocator($this->getServiceLocator()); $this->initJQueryFiles(); $JQuery->__invoke(); $this->initScriptJS($JQuery->getScript()); $this->instanceFilesJS($JQuery->getFiles()); } }
/** * @param ElementInterface $element * @param RuleInterface $rule */ public function addFile(RuleInterface $rule) { $clasName = Filter::getClassName($rule); if ($rule->hasFile()) { $this->_file[$clasName] = $this->get('validate-path') . $rule->getFile(); } }