class KalimahApps / Daleel / BladeUtil

BladeUtil

Blade template engine utilities.

Methods

public static

isActiveRoute ( string $active_path , string $current_route , $identical ) : bool

Check if the current route is the displayed route.

Parameters

  • $active_path string
    Current displayed route
  • $current_route string
    Current rendered route
  • $identical bool
    If true, then compare the routes as is, otherwise remove extension from both routes
public static

getTemplateContent ( string $template_name , array $data ) : string

Return data from template.

Parameters

  • $template_name string
    Template name
  • $data array
    Extra data to pass to template
public static

getConfig ( string $key ) : mixed

Helper method to get config value.

Parameters

  • $key string
    Config key
public static

isSearchEnabled ( ) : void

Check if search is enabled.

private static

findSibling ( array $search_array , string $active_route , string $direction ) : array|false

Loop through array and return the next or previous sibling.

Parameters

  • $search_array array
    Array to search
  • $active_route string
    Current rendered route to search for
  • $direction string
    Direction of sibling 'prev | next'
public static

Get sibling link (previous or next).

Parameters

  • $direction string
    Direction of sibling 'prev | next'
public static

Get edit link for the viewed page.

public static

Get root link and optionally append extra path.

Parameters

  • $extra_path string
    Extra path to append to root link
public static

hasActiveChild ( array $items , string $active_item ) : bool

Recursively check if the current route is part of the given items.

Parameters

  • $items array
    List of items to check
  • $active_item string
    Current rendered route
public static

resolveTypes ( array $types , $namespaces_list ) : array

Resolve links to either php.net or internal links or no links.

Parameters

  • $types array
    Array of types
  • $namespaces_list array
    List of namespaces
public static

getVersionUrl ( string $version_key ) : string

Build and return the version url.

Parameters

  • $version_key string
    Version key