public function renderAsCollapse($plugin)
    {
        return implode(PHP_EOL, array_map(function ($menu) {
            //Sets the collapse name
            $collapseName = 'collapse-' . strtolower(Text::slug($menu['title']));
            $titleOptions = optionsParser($menu['titleOptions'], [
                'aria-controls' => $collapseName,
                'aria-expanded' => 'false',
                'class' => 'collapsed',
                'data-toggle' => 'collapse',
            ]);
            $mainLink = $this->Html->link($menu['title'], '#' . $collapseName, $titleOptions->toArray());
            $links = $this->Html->div('collapse', $this->buildLinks($menu['links']), ['id' => $collapseName]);

            return $this->Html->div('card', $mainLink . PHP_EOL . $links);
        }, $this->generate($plugin)));
    }
public function renderAsCollapse($plugin)
    {
        return implode(PHP_EOL, array_map(function ($menu) {
            //Sets the collapse name
            $collapseName = 'collapse-' . strtolower(Text::slug($menu['title']));
            $titleOptions = optionsParser($menu['titleOptions'], [
                'aria-controls' => $collapseName,
                'aria-expanded' => 'false',
                'class' => 'collapsed',
                'data-toggle' => 'collapse',
            ]);
            $mainLink = $this->Html->link($menu['title'], '#' . $collapseName, $titleOptions->toArray());
            $links = $this->Html->div('collapse', $this->buildLinks($menu['links']), ['id' => $collapseName]);

            return $this->Html->div('card', $mainLink . PHP_EOL . $links);
        }, $this->generate($plugin)));
    }
public function renderAsCollapse ( $ plugin ) { return implode ( PHP_EOL , array_map ( function ( $ menu ) { //Sets the collapse name $ collapseName = 'collapse-' . strtolower ( Text :: slug ( $ menu [ 'title' ] ) ) ; $ titleOptions = optionsParser ( $ menu [ 'titleOptions' ] , [ 'aria-controls' => $ collapseName , 'aria-expanded' => 'false' , 'class' => 'collapsed' , 'data-toggle' => 'collapse' , ] ) ; $ mainLink = $ this -> Html -> link ( $ menu [ 'title' ] , '#' . $ collapseName , $ titleOptions -> toArray ( ) ) ; $ links = $ this -> Html -> div ( 'collapse' , $ this -> buildLinks ( $ menu [ 'links' ] ) , [ 'id' => $ collapseName ] ) ; return $ this -> Html -> div ( 'card' , $ mainLink . PHP_EOL . $ links ) ; } , $ this -> generate ( $ plugin ) ) ) ; }
Renders a menu as "collapse"
@param string $plugin Plugin name
@return string
@uses buildLinks()
@uses generate()
Renders a menu as collapse