Difference Between Render And Render Partial

hi all,

  i am new in yii. I need to know the meaning of render and render partial with example and syntax and in which situation we can use that.give proper solution to me please

thanks

with regards

jalpa

render(‘myview’) will render the file ‘myview’, complete with the $layout that’s specified in your controller.

renderPartial(‘myview’) will render ONLY the contents for ‘myview’. And you can use it with special keys to retun result in varuiable and to echo this html where you want.

using render partial we can add some portion of code in another file?

and in render we can add whole file in amother file?

>> using render partial we can add some portion of code in another file?

you are right here you use render partial to include a portion into a file

>> and in render we can add whole file in amother file?

in case of render you basically taking the whole file and sending it to the browser much like your normal php files.


<?php echo $this->renderPartial('//category/create'); ?>

I have added this line to access another controller create view but its showing error as

" Undefined variable: model " Help need here.

Thanks Sally