Hi there,
I'm having trouble instantiating a PageArray and was wondering if i've overlooked something very obvious (Won't be the first time!) I've included a snippet of the code
The Error I'm getting is "Class 'Site\PageArray' not found".
I'm using namespaces as I've had name collisions before.
Still stumbling my way through PHP and any guidance would be much appreciate.
----------------------------
G
namespace Site;
class Data {
/**
* Wrapper function to return items inside a PageArray.
* @param $items
* @return PageArray - A PageArray containing all the items passed in
*/
static function PageArrayWithChildren($items)
{
//$array = new wire(PageArray);
$array = new PageArray();
foreach($items as $item)
{
$array->import($item->children());
}
return $array;
}
}