Sunday, April 30, 2006

Parameters I

What I need to understand next about modules is how they get input parameters like $task, $option, or $id. For example, from mod_relcontent:

$option = trim( mosGetParam( $_REQUEST, 'option', null ) );

Or from mod_latestnews :

$type = intval( $params->get( 'type', 1 ) );

mosGetParam must be the preferred to the raw PHP $params->get() since it is in the Joomla! API.

mod_login also has to get user supplied parameters like username and password. What are all the parameters defined in mod_login.xml used for?

Where do parameters like $task come from? Where do they go? What are the calling conventions in modules? Which parameters are required and which are optional?

Time to hit the code again.

0 Comments:

Post a Comment

<< Home