The images are stored inside separate folders.
Both the folders and the images are saved in the database. In my gallery page, they are shown from the database in two steps.
- The folders are retrieved from the
dband listed in the gallery page - while on-click of a folder, the images are listed.
So far, I have passed the data from the database to the view. The following is my controller code.
function image_show() {
$this->load->model('gallery_model');
$data['folder_info'] = $this->gallery_model->get_folder_names();
}
and my view code is as follows:
<?php foreach($folder_info as $show){ ?>
<a class="glyphicon glyphicon-folder-close" style="font-size: 100px;" aria-hidden="true" onclick="imageslide(' .$show['folder_name'] .');" ></a>
<?php } ?>
From the above code, the folders are listed in the gallery page.
I am struck while trying to pass the $show['folder_name'] from the php foreach loop so that I can generate a image slider.
My script is
function imageslide(name) {
alert(name);
}
The error shown to me is
gallery:194 Uncaught SyntaxError: missing ) after argument list
Kindly help me out!