Exemple #1
0
 protected function parseAction($template, $actionstring)
 {
     $actionArray = explode(':', str_replace('action:', '', $actionstring));
     $params = array();
     isset($actionArray[1]) ? parse_str($actionArray[1], $params) : NULL;
     $acmArray = explode('.', $actionArray[0]);
     try {
         $result = self::$view->action(isset($acmArray[0]) ? $acmArray[0] : NULL, isset($acmArray[1]) ? $acmArray[1] : NULL, isset($acmArray[2]) ? $acmArray[2] : NULL, $params);
     } catch (Exception $e) {
         if (APPLICATION_ENV == 'development') {
             $result = $e->getMessage();
         } else {
             $result = $actionstring;
         }
     }
     return str_ireplace('{{' . $actionstring . '}}', $result, $template);
 }