src/Accordion.php
public function addSection($title, $callback = null, $icon = 'dropdown')
    {
        $section = $this->add(['AccordionSection', 'title' => $title, 'icon' => $icon]);

        // if there is callback action, then use VirtualPage
        if ($callback) {
            $section->virtualPage = $section->add(['VirtualPage', 'ui' => '']);
            $section->virtualPage->stickyGet('__atk-dyn-section', '1');
            $section->virtualPage->set($callback);
        }

        $this->sections[] = $section;

        return $section;
    }
public function addSection($title, $callback = null, $icon = 'dropdown')
    {
        $section = $this->add(['AccordionSection', 'title' => $title, 'icon' => $icon]);

        // if there is callback action, then use VirtualPage
        if ($callback) {
            $section->virtualPage = $section->add(['VirtualPage', 'ui' => '']);
            $section->virtualPage->stickyGet('__atk-dyn-section', '1');
            $section->virtualPage->set($callback);
        }

        $this->sections[] = $section;

        return $section;
    }
public function addSection ( $ title , $ callback = null , $ icon = 'dropdown' ) { $ section = $ this -> add ( [ 'AccordionSection' , 'title' => $ title , 'icon' => $ icon ] ) ; // if there is callback action, then use VirtualPage if ( $ callback ) { $ section -> virtualPage = $ section -> add ( [ 'VirtualPage' , 'ui' => '' ] ) ; $ section -> virtualPage -> stickyGet ( '__atk-dyn-section' , '1' ) ; $ section -> virtualPage -> set ( $ callback ) ; } $ this -> sections [ ] = $ section ; return $ section ; }
Add an accordion section.
You can add static View within your section or pass
a callback for dynamic content.

@param string        $title
@param null|callable $callback
@param string        $icon

@throws Exception

@return AccordionSection
Add an accordion section . You can add static View within your section or pass a callback for dynamic content .