How can i run just a simple function or something like a class member to add text or html code into the layout content.
For example, Currently to display something i can only use
render functions to load a file or rendertext to insert text.
The problem is that both inserts the entire layout with them. Is there any way to just add a text into the content?
If i want to display the content of the page.php file from my views directory i would do:
If i need to add something above the contents of the page.php file i will either need to add it into the page.php file or using the renderpartial function to return the output and pass it in to the page.php file as a variable.
What i would like to do is:
$this->output .= "some text above the page.php file";
this will output first the "some text above the page.php file" and the the contents of the page.php file from the render function.
Unfortunately something like this is not possible with Yii.
How about using a portlet. A portlet can be used elsewhere other than a left or right column. Then you can store text, notifications, messages, etc. in a database table and conditionally display the strings.
Jonah’s Skelton applications stores all text in a database table. This might give you some ideas.
Bad approaches, I don’t know when and where i will be using this class member so clips or portlets are no good. I am still struggling to achieve this so if there are any other ideas i will appreciate you letting me know about them.