Pages::slice($start[,$amount])
Version 3.7
Return a range of pages in collection in array.
Version 3.7
Return a range of pages in collection in array.
Returns a new collection -object with the pages in given range.
Object Pages
Print first three tasks from the Task -collection:
foreach ( $Tasks->slice(1,3)->sivut() as Task ){
$txt .= "<p>{$Task->date} {$Task->name}</p>";
}
Print last three tasks from the Task -collection:
foreach ( $Tasks->slice(-3)->sivut() as $Task ){
$txt .= "<p>{$Task->date} {$Task->name}</p>";
}
Print all but first three tasks from the Task -collection:
foreach ( $Tasks->slice(4)->sivut() as $Task ){
$txt .= "<p>{$Task->date} {$Task->name}</p>";
}
Print all but last three tasks from the Task -collection:
foreach ( $Tasks->slice(1,-4)->sivut() as $Task ){
$txt .= "<p>{$Task->date} {$Task->name}</p>";
}