Just started using HMVC module extension
and Smarty
with Codeigniter
. In HMVC, we can call module functions from a view to generate a specific view (in my case a modal dialog for login in case user is not logged in):
<?php echo Modules::run('module/controller/method', $param, $...); ?>
All this seemed to work pretty well before I started using Smarty templates. My question is -
Is it a good practice to call php routines directly from templates to generate a view?
Are there other alternatives keeping HMVC intact ?
One way I can do this is to create specific templates such as login_dialog.tpl and include directly in my base templates based on user login status. But, I feel it defies the purpose of HMVC and we should use modules to generate any view and not directly include them. I may be wrong. Please suggest alternatives..