Using Data From Controllers In Layout


for description i want to use data from controller (and view) in my layout.

for example i want to use the news title of this controller : "" in my main layout as site main title (like "My Web Application" in testdrive)

how i can implement this?

thanks in advance.

If you want to show the page title, you can use $this->pageTitle. Or if you want to define your own variable and use it in the layout, you can add a property in the controller class and use $this->yourpropertyname

1 Like