echo $page->getCollectionTitle() gives error

Permalink
Hello
i downloaded concrete5 Cookbook [eBook] and the code below gives error

echo $page->getCollectionTitle()

I can understand that the method getCollectionTitle() is not found on object $page
This is in the source code that came with the ebook. Any idea how is this solved?
Whole code is shown below.


<?php
function my_debug($var) {
echo '<pre>';
print_r($var);
echo '</pre>';
exit;
}


Loader::model('page_list');
$list = new PageList();

$list->filterByPath('/blog');
$list->setItemsPerPage(20);

$pages = $list->getPage();

foreach ($pages as $page) {
echo $page->getCollectionTitle().'<br />';

}

exit;

panicos
 
pvernaglia replied on at Permalink Best Answer Reply
pvernaglia
Try getCollectionName() not Title