@@ -1321,21 +1321,27 @@ PHP_METHOD(Phalcon_Mvc_View, exists) {
13211321 */
13221322PHP_METHOD (Phalcon_Mvc_View , render ){
13231323
1324- zval * controller_name , * action_name , * params = NULL , * namespace_name = NULL , * view_model = NULL , ds = {}, namespace_separator = {}, disabled = {};
1324+ zval * controller , * action , * params = NULL , * namespace = NULL , * view_model = NULL , ds = {}, namespace_separator = {}, disabled = {};
1325+ zval controller_name = {}, action_name = {}, namespace_name = {};
13251326 zval contents = {}, converter_key = {}, converter = {}, parameters = {}, lower_case = {}, lower_controller_name = {}, lower_action_name = {};
13261327 zval layouts_dir = {}, enable_namespace_view = {}, ds_lower_namespace_name = {}, layout_namespace = {}, debug_message = {};
13271328 zval layout = {}, layout_name = {}, engines = {}, pick_view = {}, render_view = {}, pick_view_action = {}, event_name = {}, status = {}, silence = {}, disabled_levels = {};
13281329 zval render_level = {}, enable_layouts_absolute_path = {}, templates_before = {}, * tpl , view_tpl_path = {}, templates_after = {}, main_view = {};
13291330 char slash [2 ] = {DEFAULT_SLASH , 0 };
13301331
1331- phalcon_fetch_params (1 , 2 , 3 , & controller_name , & action_name , & params , & namespace_name , & view_model );
1332+ phalcon_fetch_params (1 , 2 , 3 , & controller , & action , & params , & namespace , & view_model );
13321333
13331334 if (!params ) {
13341335 params = & PHALCON_GLOBAL (z_null );
13351336 }
13361337
1337- if (!namespace_name ) {
1338- namespace_name = & PHALCON_GLOBAL (z_null );
1338+ PHALCON_MM_ZVAL_COPY (& controller_name , controller );
1339+ if (action ) {
1340+ PHALCON_MM_ZVAL_COPY (& action_name , action );
1341+ }
1342+
1343+ if (namespace ) {
1344+ PHALCON_MM_ZVAL_COPY (& namespace_name , namespace );
13391345 }
13401346
13411347 PHALCON_MM_ZVAL_STRING (& ds , slash );
@@ -1358,10 +1364,10 @@ PHP_METHOD(Phalcon_Mvc_View, render){
13581364 RETURN_MM_FALSE ;
13591365 }
13601366
1361- phalcon_update_property (getThis (), SL ("_controllerName" ), controller_name );
1362- phalcon_update_property (getThis (), SL ("_actionName" ), action_name );
1367+ phalcon_update_property (getThis (), SL ("_controllerName" ), & controller_name );
1368+ phalcon_update_property (getThis (), SL ("_actionName" ), & action_name );
13631369 phalcon_update_property (getThis (), SL ("_params" ), params );
1364- phalcon_update_property (getThis (), SL ("_namespaceName" ), namespace_name );
1370+ phalcon_update_property (getThis (), SL ("_namespaceName" ), & namespace_name );
13651371
13661372 PHALCON_MM_ZVAL_STRING (& converter_key , "controller" );
13671373 PHALCON_MM_CALL_SELF (& converter , "getconverter" , & converter_key );
@@ -1371,10 +1377,11 @@ PHP_METHOD(Phalcon_Mvc_View, render){
13711377 zval tmp = {};
13721378 array_init_size (& parameters , 1 );
13731379 PHALCON_MM_ADD_ENTRY (& parameters );
1374- phalcon_array_append (& parameters , controller_name , PH_COPY );
1380+ phalcon_array_append (& parameters , & controller_name , PH_COPY );
1381+
13751382 PHALCON_MM_CALL_USER_FUNC_ARRAY (& tmp , & converter , & parameters );
13761383 PHALCON_MM_ADD_ENTRY (& tmp );
1377- ZVAL_COPY_VALUE (controller_name , & tmp );
1384+ ZVAL_COPY_VALUE (& controller_name , & tmp );
13781385 }
13791386
13801387 PHALCON_MM_ZVAL_STRING (& converter_key , "action" );
@@ -1386,10 +1393,10 @@ PHP_METHOD(Phalcon_Mvc_View, render){
13861393
13871394 array_init_size (& parameters , 1 );
13881395 PHALCON_MM_ADD_ENTRY (& parameters );
1389- phalcon_array_append (& parameters , action_name , PH_COPY );
1396+ phalcon_array_append (& parameters , & action_name , PH_COPY );
13901397 PHALCON_MM_CALL_USER_FUNC_ARRAY (& tmp , & converter , & parameters );
13911398 PHALCON_MM_ADD_ENTRY (& tmp );
1392- ZVAL_COPY_VALUE (action_name , & tmp );
1399+ ZVAL_COPY_VALUE (& action_name , & tmp );
13931400 }
13941401
13951402 PHALCON_MM_ZVAL_STRING (& converter_key , "namespace" );
@@ -1400,22 +1407,22 @@ PHP_METHOD(Phalcon_Mvc_View, render){
14001407
14011408 array_init_size (& parameters , 1 );
14021409 PHALCON_MM_ADD_ENTRY (& parameters );
1403- phalcon_array_append (& parameters , namespace_name , PH_COPY );
1410+ phalcon_array_append (& parameters , & namespace_name , PH_COPY );
14041411 PHALCON_MM_CALL_USER_FUNC_ARRAY (& tmp , & converter , & parameters );
14051412 PHALCON_MM_ADD_ENTRY (& tmp );
1406- ZVAL_COPY_VALUE (namespace_name , & tmp );
1413+ ZVAL_COPY_VALUE (& namespace_name , & tmp );
14071414 }
14081415
14091416 phalcon_read_property (& lower_case , getThis (), SL ("_lowerCase" ), PH_NOISY |PH_READONLY );
14101417
14111418 if (zend_is_true (& lower_case )) {
1412- phalcon_fast_strtolower (& lower_controller_name , controller_name );
1413- phalcon_fast_strtolower (& lower_action_name , action_name );
1419+ phalcon_fast_strtolower (& lower_controller_name , & controller_name );
1420+ phalcon_fast_strtolower (& lower_action_name , & action_name );
14141421 PHALCON_MM_ADD_ENTRY (& lower_controller_name );
14151422 PHALCON_MM_ADD_ENTRY (& lower_action_name );
14161423 } else {
1417- ZVAL_COPY_VALUE (& lower_controller_name , controller_name );
1418- ZVAL_COPY_VALUE (& lower_action_name , action_name );
1424+ ZVAL_COPY_VALUE (& lower_controller_name , & controller_name );
1425+ ZVAL_COPY_VALUE (& lower_action_name , & action_name );
14191426 }
14201427
14211428 /**
@@ -1431,10 +1438,10 @@ PHP_METHOD(Phalcon_Mvc_View, render){
14311438 if (zend_is_true (& enable_namespace_view )) {
14321439 zval lower_namespace_name = {};
14331440 if (zend_is_true (& lower_case )) {
1434- phalcon_fast_strtolower (& lower_namespace_name , namespace_name );
1441+ phalcon_fast_strtolower (& lower_namespace_name , & namespace_name );
14351442 PHALCON_MM_ADD_ENTRY (& lower_namespace_name );
14361443 } else {
1437- ZVAL_COPY_VALUE (& lower_namespace_name , namespace_name );
1444+ ZVAL_COPY_VALUE (& lower_namespace_name , & namespace_name );
14381445 }
14391446
14401447 PHALCON_STR_REPLACE (& ds_lower_namespace_name , & namespace_separator , & ds , & lower_namespace_name );
@@ -1490,7 +1497,7 @@ PHP_METHOD(Phalcon_Mvc_View, render){
14901497 PHALCON_MM_ZVAL_STRING (& event_name , "view:beforeRender" );
14911498 PHALCON_MM_CALL_METHOD (& status , getThis (), "fireeventcancel" , & event_name );
14921499 if (PHALCON_IS_FALSE (& status )) {
1493- RETURN_FALSE ;
1500+ RETURN_MM_FALSE ;
14941501 }
14951502 zval_ptr_dtor (& status );
14961503
0 commit comments