pandamasta

Untitled

Jan 18th, 2014
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. In my controller:
  2. ------------------
  3. while($file = readdir($dir)) {
  4. if($file != '.' && $file != '..' && !is_dir($dirname.$file) && $file != 'admin') {
  5.  
  6. $page_file_arr[]=$file;
  7. }
  8. $this->template->content->set('page_file_arr',$page_file_arr);
  9.  
  10. In my view
  11. --------------------
  12.  
  13. foreach ($page_file_arr as $page_file){
  14. $selection[] = array ($page_file => $page_file);
  15. }
  16. $page_file_arr[]=$file;
  17.  
  18. <?php echo Form::select('selected_page',$selection,'standard',array('onclick' => 'load_file();'));?>
  19.  
  20. The output in HTML
  21. ---------------------
  22.  
  23. <select name="selected_page" onclick="load_file();">
  24. <optgroup label="0">
  25. <option value="biographie.php">biographie.php</option>
  26. </optgroup>
  27. <optgroup label="1">
  28. <option value="galerie.php">galerie.php</option>
  29.  
  30. >>>I would like the output without <optgroup> ^^ I never requested this :)
Advertisement
Add Comment
Please, Sign In to add comment