Content Management System

Template Functions

Twig template functions

Component

Render html component

{{ component(name, params, type) }}
Property Type Description Default
name string required Html component name
params array optional Component parameters
type string optional Component type (arikaim, html, static) arikaim
Url

Site url

{{ url(path, full, language) }}
Property Type Description Default
path string optional Url path
bool full optional Full or relative url. false
language string optional Lnguage code
currentUrl

Current page url

{{ currentUrl(full) }}
Property Type Description Default
bool full optional Full or relative url. true
loadLibraryFile

Load UI library file

{{ loadLibraryFile(name, fileName) }}
Property Type Description Default
string name required UI Library name.
string fileName required UI Library file name.
getLanguage

Get current page language.

{{ getLanguage() }}
paginate

Create paginator.

{{ paginate(source, namespace, ) }}
Property Type Description Default
object|array|json source required Data source
string|null namespace optional Paginator namespace
int|null pageSize optional Page size 25
int|null currentPage optional Current page. 1
clearPaginator

Clear saved paginator.

{{ clearPaginator(namespace) }}
Property Type Description Default
string|null namespace required Paginator namespace
getPaginator

Get saved paginator.

{{ getPaginator(namespace) }}
Property Type Description Default
string|null namespace required Paginator namespace
getRowsPerPage

Get rows per page.

{{ getRowsPerPage(namespace) }}
Property Type Description Default
string|null namespace required Paginator namespace
getViewType

Get view type.

{{ getViewType(namespace, default) }}
Property Type Description Default
string|null namespace required Paginator namespace
string|null default optinal Default view type table
applySearch

Apply search fields to db query builder.

{{ applySearch(queryBuilder, namespace) }}
Property Type Description Default
Builder|Model queryBuilder required Laravel ORM Query Builder or Db Model table
string|null namespace required Search fields namespace
createSearch

Create search filed and save to session.

{{ createSearch(queryBuilder, namespace) }}
Property Type Description Default
string field required Db table column name
string|null namespace optinal Search fields namespace
string|null operator optinal Search operator
string|null queryOperator optinal Search query operator
mixed searchFieldName optinal Search field name search_text
searchValue

Get search value.

{{ searchValue(field, namespace, default) }}
Property Type Description Default
string field required Search field name.
string|null namespace optinal Search fields namespace
mixed default optinal Search operator
getSearch

Get saved search.

{{ getSearch(namespace) }}
Property Type Description Default
string|null namespace optinal Search fields namespace
getOrderBy

Get saved order by fields list.

{{ getOrderBy(namespace) }}
Property Type Description Default
string|null namespace optinal OrderBy fields namespace
applyOrderBy

Apply OrderBy to db query builder or model.

{{ applyOrderBy(queryBuilder, namespace) }}
Property Type Description Default
Builder|model queryBuilder required Laravel ORM query builder
string|null namespace optinal OrderBy fields namespace
createModel

Create Laravel ORM db model instance.

{{ createModel(class, extensionName, showError) }}
Property Type Description Default
string class required Model class name
string|null extensionName optinal Extension name
bool showError optinal Show error. false
showSql

Show query builder sql.

{{ showSql(builder) }}
Property Type Description Default
Builder builder required Laravel ORm query builder
getFileType

Get file type.

{{ getFileType(fileName) }}
Property Type Description Default
string fileName required File name.
service

Get service instance from service container.

{{ service(name) }}
Property Type Description Default
string name required Service instance name.

Filters

dateFormat

Date format filter.

        {{ timestamp|dateFormat(formatName) }}
    
Property Type Description
formatName string optional Format name or empty for default format.
Return string
timeFormat

Time format filter.

{{ timestamp|timeFormat(formatName) }}
Property Type Description
formatName string optional Format name or empty for default format.
Return string
dateTimeFormat

Date time format filter.

{{ timestamp|dateTimeFormat(formatName) }}
Property Type Description
formatName string optional Format name or empty for default format.
Return string