Ejemplo n.º 1
0
 /**
  * Build dropdown dom element
  * @param Dom $dom
  * @param array $item
  * @return string
  */
 private static function buildDropdown($dom, $item)
 {
     if (!Obj::isArray($item['items'])) {
         return null;
     }
     return $dom->li(function () use($dom, $item) {
         $dropdownLink = $dom->a(function () use($dom, $item) {
             return self::applyEscape($item['text'], $item['html'], $item['!secure']) . ' ' . $dom->span(function () {
             }, ['class' => 'caret']);
         }, $item['dropdown']);
         $dropdownElements = $dom->ul(function () use($dom, $item) {
             $resp = null;
             foreach ($item['items'] as $obj) {
                 $resp .= self::buildLink($dom, $obj, false);
             }
             return $resp;
         }, ['class' => 'dropdown-menu']);
         return $dropdownLink . $dropdownElements;
     }, $item['property']);
 }