JRoute
From Joomla! Documentation
(Difference between revisions)
(fixing syntax errors, wrapping example code in <pre> tags) |
m (changing <pre> to <source> to include syntax hilighting) |
||
| Line 4: | Line 4: | ||
A simple example of using JRoute would be | A simple example of using JRoute would be | ||
| − | < | + | <source lang=php> |
<?php echo JRoute::_('index.php?option=example&task=view'); ?> | <?php echo JRoute::_('index.php?option=example&task=view'); ?> | ||
| − | </ | + | </source> |
If we use this method inside a class and we are trying to link it to current component we do not need to specify option | If we use this method inside a class and we are trying to link it to current component we do not need to specify option | ||
Revision as of 14:00, 20 November 2009
Jroute is used to output URI's. Static JRoute::_methodname() Does not need to keep track of menu items.
A simple example of using JRoute would be
<?php echo JRoute::_('index.php?option=example&task=view'); ?>
If we use this method inside a class and we are trying to link it to current component we do not need to specify option