AcyOrt has built-in helper functions for rendering templates, also you can customize helper functions

Built-in functions

There are built-in functions that cannot be overridden by custom function


Return the URL path with the root directory

{{ _url(path) }}

<!-- example -->
<p>{{ _url('path') }}</p> <!-- <p>/root/path</p> -->
<a href="{{ _url() }}">link</a> <!-- <a href="/">link</a> -->


Time formatting, time parameters can be unix time, ISO string, date object, depending on the time zone, language settings, check Moment.js

{{ _time(date, format) }}

<!-- example -->
<p>{{ _time(, 'YYYY') }}</p> <!-- <p>2018</p> -->


Use __ or _n in the template to translate multilingual text, check i18n

{{ __(page.title) }}
{{ _n(page.posts) }}

<!-- example -->

The yaml language file

# i18n config yml
  title: Home
  zero: No posts
  one: One post
  other: %d posts


<p>{{ __('index.title') }}</p> <!-- <p>Home</p> -->
<p>{{ _n('posts', 3) }}</p> <!-- 3 posts -->

Custom functions

Custom helper functions, check helper