Reputation: 7338
I want to use File
and Folder
Utilities to list files in a folder (which is located in webroot
directory)
It's so easy to do it in a controller action, but how can I use them a static page? (which there's no action in PagesController
for it)
Upvotes: 0
Views: 138
Reputation: 594
You can do that just like in a controller. Load the Classes with App::uses()
and create an instance. It works everywhere inside of CakePHP (model, controller, helper, component, view, ...).
See http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html for details.
Upvotes: 1