yii extensions - How to call controllers action & view directly from module in Yii? -


i'm building first module in yii (yet cms module) learn more yii , capabilities. next step i'd add "dev bar" top of of pages. in layout added following:

<?php echo yii::app()->getmodule('cms')->toolbar(); ?> 

in cmsmodule file, added function named toolbar() , i'm not sure go here. basically, want send page model cms toolbar, render cms toolbar view. toolbar should have links edit current page meta , page content. in order following best practices in yii & mvc, how best achieved? in cmsmodule, pagemodel , if so, how render cms view? i've tried using $this->render(), errors:

 using $this when not in object context 

i'm not sure mean "page model" not yii term. can not on that.

but think misunderstood module in yii is: it's sub-application own controllers, views , models. module active, when call action module.

it makes not sense fetch new instance of module getmodule('cms') if module not active @ all. rather want instead widget can include in main layout. widget render top bar menu links cms module. can put widget module's component directory if want keep cms related code together.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -