layout - Yii is not rendering theme -
i'm having strange issue yii , theme. set in config/main.php like:
'theme'=>'themename',
as usual. when try render view, rendered is, without layout, if called:
$this->renderpartial
i double check don't call renderpartial, themes seem equal others theme i've done. can issue about?
thank's help, i'm going out of mind on this...
here structure , syntax should have check
-yiiroot -!-!protected -!-!-!controllers -!-!-!-!testcontroller.php -!-!themes -!-!-!themename (it 1 have set on config file) -!-!-!-!views -!-!-!-!-!layouts -!-!-!-!-!-!main.php // default if public $layout has not been overwriten or layout file has been set not found -!-!-!-!-!test -!-!-!-!-!-!viewname.php
on controller testcontroller
public
$layout
main default or overwritten therein
actionindex
set$this->render('viewname');
if rendered page method renderpartial()
directly in controller, not layout template sure
render() commonly used render view corresponds user sees "page" in application. first renders view have specified , renders layout current controller action (if applicable), placing result of first render layout. performs output processing (which @ time means automatically inserting necessary tags , updating dynamic content) , outputs result.
renderpartial() commonly used render "piece" of page. main difference render() method not place results of render in layout. default not perform output processing, can override behavior using $processoutput parameter.
renderfile() low-level method grunt work of rendering: extracts data variables in current scope , runs view code. other 2 methods internally call one, should practically never need call yourself. if do, keep in mind need pass in file path (not view path).
reference: yii difference between rendering functions
Comments
Post a Comment