I'm using Codeigniter, and all I'm trying to do is to get a list of all the views in a particular folder within the "views" folder.
Here's my code, inside of my controller:
$this->data['sections'] = array_diff( scandir('/application/views/portfolio/embeds/work/'), array('.', '..') );
Message: scandir(/application/views/portfolio/embeds/work/): failed to open dir: No such file or directory
Line Number: 54
You need to add in the base path of your installation. Currently you are asking scandir to read the directory /application on your web server, when you most likely want /var/www/example.com/application
scandir(FCPATH . 'application/views/portfolio/embeds/work')