I am writing a custom component to display the roster and schedule for a football team. There are multiple teams and obviously multiple schedules. Due to the relationship, I created a single component that allows for the creation/management of teams, players, and schedules on the administrator side. It works great.
My problem, I now do not know how to display two different views for the same component. One for schedules and one for the rosters. My vision is to use a controller that accepts an extra parameter in the get bar and then decides which view to load. I have implemented this on the backend piece, but I am not able to complete it on the front-end. I could honestly be missing something, I am new to Joomla, OOP, etc and sometimes simple things escape me.
Any assistance would be greatly appreciated. I have been using a book called, Learning Joomla! 1.5
Extension Development by Packet Publishing which has been a great help. If there is a resource to help me along with this then I am open for suggestions as well.
Thanks,
Matt
Multiple Frontends for component
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
Forum rules
-
- Joomla! Apprentice
- Posts: 41
- Joined: Sat Dec 15, 2007 3:02 pm
- Location: Washington DC Metro
Re: Multiple Frontends for component
I'm assuming you are writing this for J! 1.5.x.
You have the right idea as far as the controller is concerned. Your display() method in the controller could look something like:
Then create a view for schedules and a view for rosters. The above controller code would assume the template files for each view are named default.php.
You have the right idea as far as the controller is concerned. Your display() method in the controller could look something like:
Code: Select all
function display() {
$view = JRequest::getVar('view');
JRequest::setVar('view', $view);
parent::display();
}
Denise