コード例 #1
0
ファイル: RulePlugin.php プロジェクト: pedro151/zfcomplement
 /**
  * @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;
 }
コード例 #2
0
 /**
  * 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());
     }
 }
コード例 #3
0
ファイル: Validate.php プロジェクト: pedro151/zfcomplement
 /**
  * @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();
     }
 }