Hi all,
I'm writing a component with several views, but there are several UI elements that are common to all the views. Instead of copying the code into the template of every view, is there a way to make a global template which then will inherit the templates of the view?
Cheers
Component-wide template with MVC
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
Component-wide template with MVC
Last edited by Skippdog on Fri Feb 08, 2008 8:43 pm, edited 1 time in total.
Re: Component-wide template with MVC
If I understand what you are saying correctly try this: look in the front end of the com_content component and you will see com_content/views.php defining this class: class ContentView extends JView
Then in the /views directory you will see /article/view.html.php && /category/view.html.php etc.
They all extend ContentView ie. class ContentViewCategory extends ContentView
The admin side exhibits the same concept with even more shared code in the ContentView class.
Hope this helps.
Then in the /views directory you will see /article/view.html.php && /category/view.html.php etc.
They all extend ContentView ie. class ContentViewCategory extends ContentView
The admin side exhibits the same concept with even more shared code in the ContentView class.
Hope this helps.