I'm developing an php mvc framework and faced a problem to render view in layout, that is serviced by controller. For example, login box is common for all pages of site. Here is my layout:
<?= $this->partial('layouts/header') ?>
<aside class="login-box">
<?= $this->partial('indexController', 'loginboxAction');
</aside>
<section class="main">
<?= $this->content() ?>
</section>
<?= $this->partial('layouts/footer') ?>
There is no problem with static or near-static header/footer templates, but user block can chage it's state, and it's behavior can be managed by controller (as indexController did).
How to make such partial method, that can do such magic? It looks like i need force FrontController to render the whole MVC for this controller, don't i? But it will be very inefficient. Or maybe I think wrong, and such block, as user-box, can be just a view, without linking with controller?
I understand, that my question is much abstract and i provided no code, but it is more architecture question, than technical.