اجرا نشدن توابع سفارش یا macro در فریمورک phalcon

ساخت وبلاگ
سلام دوستان این کد volt من هست

کد:
{%- macro error_messages(message, field, type) %}
   <div>
       <span class="error-type">{{ type }}</span>
       <span class="error-field">{{ field }}</span>
       <span class="error-message">{{ message }}</span>
   </div>
{%- endmacro %}

{# Call the macro #}
{{ error_messages('type': 'Invalid', 'message': 'The name is invalid', 'field': 'name') }}


اینم کامپایل شدش

<?php
$this->_macros['error_messages'] = function($__p = null)
{
   if (isset($__p[0])) {
       $message = $__p[0];
   } else {
       if (isset($__p["message"])) {
           $message = $__p["message"];
       } else {
           throw new PhalconMvcViewException("Macro 'error_messages' was called without parameter: message");
       }
   }
   if (isset($__p[1])) {
       $field = $__p[1];
   } else {
       if (isset($__p["field"])) {
           $field = $__p["field"];
       } else {
           throw new PhalconMvcViewException("Macro 'error_messages' was called without parameter: field");
       }
   }
   if (isset($__p[2])) {
       $type = $__p[2];
   } else {
       if (isset($__p["type"])) {
           $type = $__p["type"];
       } else {
           throw new PhalconMvcViewException("Macro 'error_messages' was called without parameter: type");
       }
   }
?>
  <div>
       <span class="error-type"><?php
   echo $type;
?></span>
       <span class="error-field"><?php
   echo $field;
?></span>
       <span class="error-message"><?php
   echo $message;
?></span>
   </div><?php
};
$this->_macros['error_messages'] = Closure::bind($this->_macros['error_messages'], $this);
?>


<?php
echo $this->callMacro('error_messages', array(
   'type' => 'Invalid',
   'message' => 'The name is invalid',
   'field' => 'name'
));
?>


خب الان نمیدونم چرا وقتی این کدهارو میذارم از اجرای کل اسکریپت جلوگیری میکنه
(مشکل وقتی پیش میاد که بخوام تابع رو توی قالب صدا بزنم و نه وقتی که تابع رو تعریف کنم)
هیچ کد خطایی هم نشون نمیده

ورژن phalcon 2.0.9     -    ورژن php   5.5.12  


ممنون میشم کسی متوجه شد به منم بگه برنامه نویس...
ما را در سایت برنامه نویس دنبال می کنید

برچسب : نویسنده : خنجی prog بازدید : 160 تاريخ : يکشنبه 6 دی 1394 ساعت: 3:21