Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In my controller:
- ------------------
- while($file = readdir($dir)) {
- if($file != '.' && $file != '..' && !is_dir($dirname.$file) && $file != 'admin') {
- $page_file_arr[]=$file;
- }
- $this->template->content->set('page_file_arr',$page_file_arr);
- In my view
- --------------------
- foreach ($page_file_arr as $page_file){
- $selection[] = array ($page_file => $page_file);
- }
- $page_file_arr[]=$file;
- <?php echo Form::select('selected_page',$selection,'standard',array('onclick' => 'load_file();'));?>
- The output in HTML
- ---------------------
- <select name="selected_page" onclick="load_file();">
- <optgroup label="0">
- <option value="biographie.php">biographie.php</option>
- </optgroup>
- <optgroup label="1">
- <option value="galerie.php">galerie.php</option>
- >>>I would like the output without <optgroup> ^^ I never requested this :)
Advertisement
Add Comment
Please, Sign In to add comment