Thanks very much for getting back to me, I have added in another closing bracket that seemed to be throwing a spanner in the works so the code now shows,
$result->push(new ArrayData(array('Folder' => $folder['Folder'], $files => $files)));
I am now getting the following error message,
[User Error] Bad class to singleton() - Files
GET /silverstripe/investor-login/investor-area/
Line 334 in C:\wamp\www\silverstripe\sapphire\core\Core.php
Source
325 *
326 * @param string $className
327 * @return Object
328 */
329 function singleton($className) {
330 global $_SINGLETONS;
331 if(!isset($className)) user_error("singleton() Called without a class", E_USER_ERROR);
332 if(!is_string($className)) user_error("singleton() passed bad class_name: " . var_export($className,true), E_USER_ERROR);
333 if(!isset($_SINGLETONS[$className])) {
334 if(!class_exists($className)) user_error("Bad class to singleton() - $className", E_USER_ERROR);
335 $_SINGLETONS[$className] = Object::strong_create($className,null, true);
336 if(!$_SINGLETONS[$className]) user_error("singleton() Unknown class '$className'", E_USER_ERROR);
337 }
338 return $_SINGLETONS[$className];
339 }
340
Trace
* Bad class to singleton() - Files
Line 334 of Core.php
* singleton(Files)
Line 2714 of DataObject.php
* DataObject::get(Files)
Line 22 of InvestorPage.php
* InvestorPage->getFilesUserCanAccess()
* call_user_func_array(Array,Array)
Line 693 of Object.php
* Object->__call(getFilesUserCanAccess,Array)
* InvestorPage_Controller->getFilesUserCanAccess()
Line 112 of ViewableData.php
* ViewableData->__get(FilesUserCanAccess)
Line 371 of ViewableData.php
* ViewableData->obj(FilesUserCanAccess)
Line 6 of .cacheC..wamp.www.silverstripe.themes.Vitruvian.templates.Layout.InvestorPage.ss
* include(C:\WINDOWS\Temp\silverstripe-cacheC--wamp-www-silverstripe\.cacheC..wamp.www.silverstripe.themes.Vitruvian.templates.Layout.InvestorPage.ss)
Line 420 of SSViewer.php
* SSViewer->process(InvestorPage_Controller,Zend_Cache_Frontend_Output)
Line 411 of SSViewer.php
* SSViewer->process(InvestorPage_Controller)
Line 202 of Controller.php
* Controller->handleAction(SS_HTTPRequest)
Line 137 of RequestHandler.php
* RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
* Controller->handleRequest(SS_HTTPRequest)
Line 199 of ContentController.php
* ContentController->handleRequest(SS_HTTPRequest)
Line 184 of ContentController.php
* ContentController->handleRequest(SS_HTTPRequest)
Line 67 of ModelAsController.php
* ModelAsController->handleRequest(SS_HTTPRequest)
Line 281 of Director.php
* Director::handleRequest(SS_HTTPRequest,Session)
Line 124 of Director.php
* Director::direct(/investor-login/investor-area/)
Line 127 of main.php
Any thoughts on the problem?
I really do appreciate your help with this, sorry to keep coming back with fresh problems! (I'm midway through a Lynda course on PHP and im diving in at the deepend here!) However, once i get this sorted, it will be somthing i can use again and again, and hopefully understand how/why im gettign these errors!
Cano.