This page forms a summary of new techniques available in the version 1.5 API and their version 1.0 counterparts where applicable.
| Old Way / Usage | New Way |
|---|---|
$id = mosGetParam( $_REQUEST, 'id', 0 ); | $id = JRequest::getVar( 'id', 0 ); |
| Old Way / Usage | New Way |
|---|---|
global $acl; | $acl =& JFactory::getACL(); |
global $mosConfig_live_site; | $mainframe->getCfg( 'live_site' ); |
global $database; | $database = $mainframe->getDBO(); // or: $database = &JFactory::getDBO(); |
| Old Way / Usage | New Way |
|---|---|
mosNotAuth(); | JError::raiseError( 403, JText::_("ALERTNOTAUTH") );
|
| A fatal error | if (!$row->check())
{
JError::raiseError( 500, $row->getError());
}
|
| Old Way / Usage | New Way |
|---|---|
$mainframe->getPath( 'admin_html' ) | JApplicationHelper::getPath('admin_html')
|
| Old Way / Usage | New Way |
|---|---|
echo _HELLO; | echo JText::_( 'Hello' ); |
| UTF8 Safe Lower Casing |
| Old Way / Usage | New Way |
|---|---|
| List pagination | jimport('joomla.presentation.pagination');
$pagination = new JPagination($total, $limitstart, $limit);
|
| Old Way / Usage | New Way |
|---|---|
Listing files or folders mosReadDirectory(...) | JFolder::files(...) // or JFolder::files(...) |
| Old Way / Usage | New Way |
|---|---|
| Get the menu parameters in a component (frontend) | jimport('joomla.application.extension.component');
$mParams = &JComponentHelper::getMenuParams();
// example:
$pageclass_sfx = $mParams->get( 'pageclass_sfx' );
|
| Get the control (model, view, controller, renderer, template) parameters in a component (frontend) | jimport('joomla.application.extension.component');
$cParams = &JComponentHelper::getControlParams();
// example:
$viewName = $cParams->get('view_name');
|
The use of the BUTTON tag is prefered to INPUT.
| Old Way / Usage | New Way |
|---|---|
| Submit Button | <button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button> |