PHP Class Nestable\Services\NestableService

Inheritance: use trait Nestable\MacrosTrait
Afficher le fichier Open project: atayahmet/laravel-nestable Class Usage Examples

Méthodes publiques

Свойство Type Description
$data Collection data.

Protected Properties

Свойство Type Description
$active mixed Selectable values for html output.
$config array configuration vars.
$dropdownAttr array Dropdown attributes.
$multiple boolean Multiple dropdown status.
$optionAttr array Dropdown or Listbox item attributes.
$optionUlAttr
$parent string Parent key name.
$parents array Parent idset of current process.
$route array Route parameters.
$selected mixed Selectable values.

Méthodes publiques

Méthode Description
__call ( $method, $args )
active ( ) : object Attribute insert helper for html render.
addAttr ( mixed $attr, mixed $value = '' ) : object Add attribute to
  • element.
  • attr ( array $attributes ) : object Set the attributes of generated dropdown.
    closeLi ( string $li ) : string Generate close li tag.
    closeUl ( string $ul ) : string Generate close ul tag.
    hasChild ( string $key = null, mixed $value = null, Collection $data = null ) : boolean Child menu checker.
    isValid ( string $type, $render = false ) : mixed Array validator.
    make ( mixed $data ) : object Set the data to wrap class.
    multiple ( ) : object Multiple dropdown menu.
    openLi ( array $li, $extra = '' ) : string Generate open li tag.
    parent ( integer $parent = false ) : object Set the parent id for child elements.
    renderAsArray ( object $data = false, integer $parent ) : Recursion | array Pass to array of all data as nesting.
    renderAsDropdown ( object $data = false, integer $parent, boolean $first = true, integer $level ) : string Convert to dropdown.
    renderAsHtml ( object $data = false, integer $parent, boolean $first = true ) : string Pass to html (ul:li) as nesting.
    renderAsJson ( object $data = false, integer $parent ) : Recursion | array Pass to json string of all data as nesting.
    renderAsMultiple ( )
    route ( array $route ) Route generator.
    save ( array $params ) Save the parameters.
    selected ( integer | array $values ) : object Save the will select values.
    ul ( string $items = false, $parent_id ) : string Generate open ul tag.
    ulAttr ( mixed $attr, mixed $value = '' ) : object Add attribute to
      element.

    Méthodes protégées

    Méthode Description
    addAttributes ( ) : string Contact th attributes to dropdown.
    doActive ( array $href, string $label ) : string Insert all saved attributes to
  • element.
  • doSelect ( mixed $value, $label ) : string Set the as selected of items.
    renderAttr ( mixed $attributes = false, mixed $params = false ) : string Render the attritues of html elements.
    setParameters ( array $args ) initialize parameters (toArray, toHtml, toDropdown).
    url ( string $path, $label ) : string URL Generator.

    Method Details

    __call() public méthode

    public __call ( $method, $args )

    active() public méthode

    Attribute insert helper for html render.
    public active ( ) : object
    Résultat object (instance)

    addAttr() public méthode

    Add attribute to
  • element.
  • public addAttr ( mixed $attr, mixed $value = '' ) : object
    $attr mixed
    $value mixed
    Résultat object (instance)

    addAttributes() protected méthode

    Contact th attributes to dropdown.
    protected addAttributes ( ) : string
    Résultat string

    attr() public méthode

    Set the attributes of generated dropdown.
    public attr ( array $attributes ) : object
    $attributes array
    Résultat object (instance)

    closeLi() public méthode

    Generate close li tag.
    public closeLi ( string $li ) : string
    $li string
    Résultat string

    closeUl() public méthode

    Generate close ul tag.
    public closeUl ( string $ul ) : string
    $ul string
    Résultat string

    doActive() protected méthode

    Insert all saved attributes to
  • element.
  • protected doActive ( array $href, string $label ) : string
    $href array
    $label string
    Résultat string

    doSelect() protected méthode

    Set the as selected of items.
    protected doSelect ( mixed $value, $label ) : string
    $value mixed
    Résultat string

    hasChild() public méthode

    Child menu checker.
    public hasChild ( string $key = null, mixed $value = null, Collection $data = null ) : boolean
    $key string
    $value mixed
    $data Illuminate\Support\Collection Illuminate\Support\Collection as Collect
    Résultat boolean

    isValid() public méthode

    Array validator.
    public isValid ( string $type, $render = false ) : mixed
    $type string
    Résultat mixed

    make() public méthode

    Set the data to wrap class.
    public make ( mixed $data ) : object
    $data mixed
    Résultat object (instance)

    multiple() public méthode

    Multiple dropdown menu.
    public multiple ( ) : object
    Résultat object (instance)

    openLi() public méthode

    Generate open li tag.
    public openLi ( array $li, $extra = '' ) : string
    $li array
    Résultat string

    parent() public méthode

    Set the parent id for child elements.
    public parent ( integer $parent = false ) : object
    $parent integer
    Résultat object (instance)

    renderAsArray() public méthode

    Pass to array of all data as nesting.
    public renderAsArray ( object $data = false, integer $parent ) : Recursion | array
    $data object Illuminate\Support\Collection
    $parent integer
    Résultat Recursion | array

    renderAsDropdown() public méthode

    Convert to dropdown.
    public renderAsDropdown ( object $data = false, integer $parent, boolean $first = true, integer $level ) : string
    $data object Illuminate\Support\Collection
    $parent integer Current parent id
    $first boolean first run
    $level integer nest counter
    Résultat string

    renderAsHtml() public méthode

    Pass to html (ul:li) as nesting.
    public renderAsHtml ( object $data = false, integer $parent, boolean $first = true ) : string
    $data object Illuminate\Support\Collection
    $parent integer Current parent id
    $first boolean First run
    Résultat string

    renderAsJson() public méthode

    Pass to json string of all data as nesting.
    public renderAsJson ( object $data = false, integer $parent ) : Recursion | array
    $data object Illuminate\Support\Collection
    $parent integer
    Résultat Recursion | array

    renderAsMultiple() public méthode

    public renderAsMultiple ( )

    renderAttr() protected méthode

    Render the attritues of html elements.
    protected renderAttr ( mixed $attributes = false, mixed $params = false ) : string
    $attributes mixed
    $params mixed
    Résultat string

    route() public méthode

    Route generator.
    public route ( array $route )
    $route array

    save() public méthode

    Save the parameters.
    public save ( array $params )
    $params array

    selected() public méthode

    Save the will select values.
    public selected ( integer | array $values ) : object
    $values integer | array
    Résultat object (instance)

    setParameters() protected méthode

    initialize parameters (toArray, toHtml, toDropdown).
    protected setParameters ( array $args )
    $args array

    ul() public méthode

    Generate open ul tag.
    public ul ( string $items = false, $parent_id ) : string
    $items string
    Résultat string

    ulAttr() public méthode

    Add attribute to
      element.
    public ulAttr ( mixed $attr, mixed $value = '' ) : object
    $attr mixed
    $value mixed
    Résultat object (instance)

    url() protected méthode

    URL Generator.
    protected url ( string $path, $label ) : string
    $path string
    Résultat string

    Property Details

    $active protected_oe property

    Selectable values for html output.
    protected mixed $active
    Résultat mixed

    $config protected_oe property

    configuration vars.
    protected array $config
    Résultat array

    $data public_oe property

    Collection data.
    public $data

    $dropdownAttr protected_oe property

    Dropdown attributes.
    protected array $dropdownAttr
    Résultat array

    $multiple protected_oe property

    Multiple dropdown status.
    protected bool $multiple
    Résultat boolean

    $optionAttr protected_oe property

    Dropdown or Listbox item attributes.
    protected array $optionAttr
    Résultat array

    $optionUlAttr protected_oe property

    protected $optionUlAttr

    $parent protected_oe property

    Parent key name.
    protected string $parent
    Résultat string

    $parents protected_oe property

    Parent idset of current process.
    protected array $parents
    Résultat array

    $route protected_oe property

    Route parameters.
    protected array $route
    Résultat array

    $selected protected_oe property

    Selectable values.
    protected mixed $selected
    Résultat mixed