{"action":"created","issue":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/12589","repository_url":"https://api.github.com/repos/phalcon/cphalcon","labels_url":"https://api.github.com/repos/phalcon/cphalcon/issues/12589/labels{/name}","comments_url":"https://api.github.com/repos/phalcon/cphalcon/issues/12589/comments","events_url":"https://api.github.com/repos/phalcon/cphalcon/issues/12589/events","html_url":"https://github.com/phalcon/cphalcon/issues/12589","id":204515580,"node_id":"MDU6SXNzdWUyMDQ1MTU1ODA=","number":12589,"title":"View - calling getRender() multiple times","user":{"login":"CrNix","id":15139474,"node_id":"MDQ6VXNlcjE1MTM5NDc0","avatar_url":"https://avatars2.githubusercontent.com/u/15139474?v=4","gravatar_id":"","url":"https://api.github.com/users/CrNix","html_url":"https://github.com/CrNix","followers_url":"https://api.github.com/users/CrNix/followers","following_url":"https://api.github.com/users/CrNix/following{/other_user}","gists_url":"https://api.github.com/users/CrNix/gists{/gist_id}","starred_url":"https://api.github.com/users/CrNix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CrNix/subscriptions","organizations_url":"https://api.github.com/users/CrNix/orgs","repos_url":"https://api.github.com/users/CrNix/repos","events_url":"https://api.github.com/users/CrNix/events{/privacy}","received_events_url":"https://api.github.com/users/CrNix/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-02-01T07:36:51Z","updated_at":"2018-11-15T01:29:42Z","closed_at":"2017-02-10T09:41:40Z","author_association":"CONTRIBUTOR","body":"Hi guys,\r\nI don't know whether this is a valid behaviour or an error. But having a view object (Phalcon\\Mvc\\View) and calling the getRender() method multiple times I only receive valid output on the first call only.\r\nSubsequent calls give me an empty string.\r\n\r\nHere is the snippet:\r\n````php\r\n$view = new \\Phalcon\\Mvc\\View();\r\n$view->setViewsDir(BACKEND_DIR . \"/template/\");\r\n\r\n$view->registerEngines([\r\n\t'.phtml' => 'Phalcon\\Mvc\\View\\Engine\\Php',\r\n]);\r\n\r\n$view->disableLevel([\r\n\t\\Phalcon\\Mvc\\View::LEVEL_LAYOUT      => true,\r\n]);\r\n\r\n$html = $view->getRender($section, $template, $data);\r\n$text = $view->getRender($section, $template, $data);\r\n\r\nvar_dump($html); // Valid string\r\nvar_dump($text); // Empty string\r\n````\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/comments/438882250","html_url":"https://github.com/phalcon/cphalcon/issues/12589#issuecomment-438882250","issue_url":"https://api.github.com/repos/phalcon/cphalcon/issues/12589","id":438882250,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODg4MjI1MA==","user":{"login":"GenaANTG","id":12715550,"node_id":"MDQ6VXNlcjEyNzE1NTUw","avatar_url":"https://avatars0.githubusercontent.com/u/12715550?v=4","gravatar_id":"","url":"https://api.github.com/users/GenaANTG","html_url":"https://github.com/GenaANTG","followers_url":"https://api.github.com/users/GenaANTG/followers","following_url":"https://api.github.com/users/GenaANTG/following{/other_user}","gists_url":"https://api.github.com/users/GenaANTG/gists{/gist_id}","starred_url":"https://api.github.com/users/GenaANTG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GenaANTG/subscriptions","organizations_url":"https://api.github.com/users/GenaANTG/orgs","repos_url":"https://api.github.com/users/GenaANTG/repos","events_url":"https://api.github.com/users/GenaANTG/events{/privacy}","received_events_url":"https://api.github.com/users/GenaANTG/received_events","type":"User","site_admin":false},"created_at":"2018-11-15T01:29:42Z","updated_at":"2018-11-15T01:29:42Z","author_association":"NONE","body":"`/**\r\n * DI: Standalone View \r\n * ===================\r\n*/\r\n$di->setShared('view', function() {\r\n    $view = new View();\r\n    $view->setViewsDir(APP_PATH . '/frontend/views/');\r\n    $view->registerEngines([\r\n        '.volt' => function($view, $di) {\r\n            $volt = new Volt($view, $di);\r\n            $volt->setOptions([\r\n                'compiledPath'      => APP_PATH . '/frontend/views/cache/',\r\n                'compiledExtension' => '.cmpd'\r\n            ]);\r\n            return $volt;\r\n        }\r\n    ]);\r\n    return $view;\r\n});`"}}
{"actor":{"display_login":"GenaANTG"}}