i am update package 5.6 to 5.7 version i need to update this code

Permalink
I it using in 5.6 version how to used in 5.7 version this line of code

$ctArray = CollectionType::getList('');
     $pageTypes = array();
     foreach ($ctArray as $ct) {
         $pageTypes[$ct->getCollectionTypeID()] = $ct->getCollectionTypeName();
     }

 
mnakalay replied on at Permalink Reply
mnakalay
Try this
$ctArray = \Concrete\Core\Page\Type\Type::getList();
$pageTypes = array();
foreach ($ctArray as $ct) {
    $pageTypes[$ct->getPageTypeID()] = $ct->getPageTypeName();
}