Can someone explain JRequest:getWord() ?
Posted: Sun Jan 27, 2008 3:28 am
I'm trying to learn the new rules for Joomla 1.5! components. I don't understand this piece of code:
What value does this statement confer $controller?
$controller = JRequest::getWord('controller')
if controller is categories, the $path will be component/xxx_component/controllers/categories.php?
I've read the API documentation, but not so useful for understanding getWord()
Thanks!
Code: Select all
<?php>// Require specific controller if requested
if($controller = JRequest::getWord('controller')) {
$path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
if (file_exists($path)) {
require_once $path;
} else {
$controller = '';
}
}<?>
$controller = JRequest::getWord('controller')
if controller is categories, the $path will be component/xxx_component/controllers/categories.php?
I've read the API documentation, but not so useful for understanding getWord()
Thanks!