2016-08-08 69 views

Antwort

1

phpseclib Dokumentation ist in git:

https://github.com/phpseclib/docs

es sucht ... die Dokumentation Website benutzt http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ den Effekt zu erzielen, von der Sie zu fragen. Um einen PHP-Array zu konvertieren in HTML das wird mit diesem Plugin arbeitet ...

function array2html($array) 
{ 
    $result = ''; 
    foreach ($array as $key => $value) { 
     $result.= '<li><span class="name">' . $key . '</span>' . (is_array($value) ? array2html($value) : '<ul><li>' . $value . '</li></ul>') . '</li>'; 
    } 
    return '<ul>' . $result . '</ul>'; 
} 

So in PHP werden Sie dies tun wollen (sobald die obige Funktion definiert ist):

echo str_replace('<ul>', '<ul class="printr">', array2html($arr), 1); 

in HTML werden Sie dann dies tun müssen:

$(document).ready(function() { 
    $('.printr').treeview({  persist: "location",  collapsed: true,  unique: true }); 
} 

Denken Sie daran, es sieht wie die phpseclib docs zumindest eine Änderung der Baumansicht Bibliothek gemacht hat (einige CSS geändert und hat ein neues Bild):

https://github.com/phpseclib/docs/commit/3406a94489c153ddf8f4a1a33f2ecbbcdd5ec61e

Hoffe, dass hilft!