SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 302 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"


We set the state variables in the model constructor, as this example demonstrates:
/**
* Constructor
*
*/
function __construct()
{
global $mainframe;
parent::__construct();
// Get the pagination request variables
$limit = $mainframe->getUserStateFromRequest('global.list.limit',
'limit', $mainframe->getCfg('list_limit'));
$limitstart = $mainframe->getUserStateFromRequest
($option.'limitstart',
'limitstart', 0);
// set the state pagination variables
$this->setState('limit', $limit);
$this->setState('limitstart', $limitstart);
}
Chapter 8
[ 227 ]
We use the getUserStateFromRequest() method to get the limit and limitstart
variables.
We use the user state variable, global.list.limit, to determine the limit. This
variable is used throughout Joomla! to determine the length of lists. For example, if
we were to view the Article Manager and select a limit if 5 items per page, when we
move to a different list it will also be limited to 5 items.
If a value is set in the request value limit (part of the listFooter) we use that value.


Pages:
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
druga wojna światowa Free English grammar and study guid hotel jelenia góra Russian bride counter strike 1.6