Guest User

Untitled

a guest
May 20th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <?php
  2.  
  3. //PER STAMPARE IN RICORSIVO
  4. //$_SESSION['init_temp_path']="../archistore/_/tmp_file/1/extra_final/"
  5.  
  6.  
  7. //In Questa funzione dovrebbe stampare il link progressivo delle url quello che faccio รจ
  8. //fare explode stampare al volo le singole directory ma non so come mantenere il valore progressivo delle url annidate
  9. public function viewscrumb(){
  10. $c=0;
  11.  
  12. $array=explode('/',$_SESSION['init_temp_path']);
  13. $c++;
  14. foreach($array as $indice=> $val){
  15. $_SESSION['prova'][]=$val.'/';
  16. $out.="<a href='#".$this->opendirscrumb($_SESSION['prova'][$c++])."' class='btn btn-link' style='margin-left:0.5%'>$val</a>";} return $out;
  17.  
  18. }
  19. // opendirscrumb fa che : "../archistore/_/tmp_file/1/extra_final/" leva extra_final/ se gli passo extra_final/
  20. //tutto qui
  21. public function opendirscrumb($dir){
  22. $ndir=(strlen($_SESSION['init_temp_path']))-(strlen($dir));
  23. return substr($_SESSION['init_temp_path'],-$ndir);
  24. }
  25.  
  26. ?>
Add Comment
Please, Sign In to add comment