Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View active render path not return to prev path after partial render #13554

Closed
Xerphis opened this issue Oct 28, 2018 · 1 comment
Closed

View active render path not return to prev path after partial render #13554

Xerphis opened this issue Oct 28, 2018 · 1 comment
Labels
new feature request Planned Feature or New Feature Request

Comments

@Xerphis
Copy link

Xerphis commented Oct 28, 2018

Hi.

I would like to collect currently rendered paths used events manager - from event "beforeRenderView" and "afterRenderView".

$eventsManager->attach('view:beforeRenderView', function(Event $event, $view) {
$msg = "before: {$view->getActiveRenderPath()}, {$view->getCurrentRenderLevel()}":
debug_message($msg);
});
$eventsManager->attach('view:afterRenderView', function(Event $event, $view) {
$msg = "after: {$view->getActiveRenderPath()}, {$view->getCurrentRenderLevel()}":
debug_message($msg);
})

Ok and i have view files like this:

  • home/index.volt (action_view)
  • layouts/home.volt (layout)
  • layouts/logged.volt (after_template_layout) - in this file I include partial "partials/test.volt"
  • index.bolt (main_layout)

In this case, my events output (i replace render level number to render level name):

before: "../home/index.volt", action_view
after: "../home/index.volt", action_view
before: "../layouts/home.volt", layout
after: "../layouts/home.volt", layout
before: "../layouts/logged.volt", after_template
before: "../partials/test.volt", after_template
after: "../partials/test.volt", after_template
after: "../partials/test.volt", after_template
before: "../index.volt", main_layout
after: "../index.volt", main_layout

Expected and Actual Behavior

We can see 2x "after test.volt".
The problem is that the name of the currently rendered path not returned to previusly path, after render partial.
On while render "layouts/logged.volt", engine render partial "partials/test.volt", and save path to "_currentRenderPath" property (of view object). After this, while the engine continues redner "layout/logged.volt", current render path property contains the previous (partial), not the current rendered path. Should it work like this?

Details

Phalcon version: 3.4.1
PHP Version: PHP 7.2.4 (cli)
Operating System: Windows 10 Home 64 bit
Server: Apache 2.4.33

@niden
Copy link
Member

niden commented Feb 23, 2019

Closing in favor of #13855. Will revisit if the community votes for it, or in later versions.

@niden niden closed this as completed Feb 23, 2019
@niden niden added the new feature request Planned Feature or New Feature Request label Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature request Planned Feature or New Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants