Ejemplo n.º 1
0
 /**
  * Add the action if left empty
  *
  * @param string $text       Template text
  * @param TemplateInterface $template A template object
  * @return TemplateFilterForm
  */
 protected function _addAction(&$text, TemplateInterface $template)
 {
     // All: Add the action if left empty
     if (preg_match_all('#<\\s*form.*?action=""#sim', $text, $matches, PREG_SET_ORDER)) {
         foreach ($matches as $match) {
             $str = str_replace('action=""', 'action="' . $template->route() . '"', $match[0]);
             $text = str_replace($match[0], $str, $text);
         }
     }
     return $this;
 }