Custom libraries

Appskull comes with a few custom libraries that can be used to do different things in the Appskull. These libraries can be found under [app_root]/app/libraries/common directory.

Custom libraries

Asset library

This is a autoloaded library. So you don't have to manually call this library before use it.

  1. injector($injectorName, $injections)

    param $injectorName String.
    param $injections Array.

    This method can be used to inject specific JS/CSS files or codes into specific view files in the Appskull. To get really good idea, view top and bottom parts of add_user.php view file under [app_root]/app/views/themes/nuda/modules/users/adminend/users/add_user directory.

CRUD library

You have to call this library before you use it.

  1. sortingIcon($sortingField, $currentSortingField, $currentSortingOrder)

    param $sortingField String.
    param $currentSortingField String.
    param $currentSortingOrder String.

    This method can be used to show neutral or ascending or descending sorting icons next to table fields in the CRUD table header.

    Sorting icons

    To get a really good idea about this method's usage, you can view any CRUD index view files. For example, user_tags.php view file under [app_root]/app/views/themes/nuda/modules/users/adminend/user_tags/user_tags directory.

  2. sortingLink($sortingField, $sortingOrder, $currentSortingField, $currentSortingOrder)

    param $sortingField String.
    param $sortingOrder String.
    param $currentSortingField String.
    param $currentSortingOrder String.

    This method can be used to show sorting links in the CRUD table header.

    Sorting links

    To get a really good idea about this method's usage, you can view any CRUD index view files. For example, user_tags.php view file under [app_root]/app/views/themes/nuda/modules/users/adminend/user_tags/user_tags directory.

Paginator library

You have to call this library before you use it.

  1. pagination($firstUrl, $baseUrl, $totalRows, $uriSegment)

    param $firstUrl String.
    param $baseUrl String.
    param $totalRows Integer.
    param $uriSegment Integer.

    This method can be used to show pagination on CRUD views.

    Pagination

    To get a really good idea about this method's usage, you can view any CRUD index view files. For example, user_tags.php view file under [app_root]/app/views/themes/nuda/modules/users/adminend/user_tags/user_tags directory.

  2. paginationInfo($totalRows)

    param $totalRows Integer.

    This method can be used to show pagination information on CRUD views.

    Pagination info

    To get a really good idea about this method's usage, you can view any CRUD index view files. For example, user_tags.php view file under [app_root]/app/views/themes/nuda/modules/users/adminend/user_tags/user_tags directory.

Preferences library

This is a autoloaded library. So you don't have to manually call this library before use it.

  1. type($preferencesType)

    param $preferencesType String.

    You can consider preferences as configurations in Appskull and there are two type of preferences. You can use this method to filter out these two type of preferences objects.

    1. System preferences/configurations.

      Example: $this->preferences->type('system')

    2. User preferences/configurations.

      Example: $this->preferences->type('user')

  2. item($preference)

    param $preference String.

    This method is a chained method. So you have to use this method with type() method.

    For example:

    1. $this->preferences->type('system')->item('app_myConfigItem')
    2. $this->preferences->type('user')->item('app_myConfigItem')

    What item() method does is first it check if parsed preference/configuration value exist in the database. If it's exist, then it returns it's value. If that preference not exist in the database, It check if that preference/configuration exist in any configuration file. If it's exist, then return it's value. If that preference/configuration not exists in both database and configuration files, then it returns boolean false. In simple words, this method is give more priority for preferences in database than preferences in configuration files.

User library

This is a autoloaded library. So you don't have to manually call this library before use it.

This library has methods that related to user authentication and user permissions. All those methods are documented in previous chapters.

Copyright © Nudasoft.