Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

NameDescriptionUsageReturns
is_user()Checks to see if a user is logged in or not.
Code Block
{% if is_user() %}
Hello User!
{% endif %}
true on success, false on failure.
is_admin()Checks to see if a user is an admin.
Code Block
{% if is_admin() %}
Hello User!
{% endif %}
true on success, false on failure.

permalink(string $route, int $id, string $title)

 


$route

URL path for your link.


$id

Unique ID number.


 

$title

Title of the item

 

 

Creates a permalink. This is an identical function provided
by our PHP permalink() function. This is handy when you want to create an
App that requires viewing an item, like a blog or video. This function follows
our default permalink rules and structure.
Code Block
<a href="{{ permalink('/foo', 1, 'Hello World') }}">Hello World</a>
Parsed permalink.

url(string $route)

 


$route

Route for your link.

Creates a link based on the route provided.
Code Block
<a href="{{ url('/foo') }}">Foo</a>
Parsed URL.

_p(string $phrase)

 


$phrase

Phrase to parse.

If your theme has any phrases or words you can wrap them in this function.
It will automatically create a phrase for Admins in case they wish to
translate your theme. 
Code Block
{{ _p('Hello World') }}
Returns the phrase passed to the function
if the translation does not exist. Otherwise
it returns the translated version. 
asset(string $image)

 


$image

Relative path to image in your themes assets/ folder.

Include images in your themes.
Code Block
// Will return full URL to image in your themes assets/ folder
{{ asset('foo.png') }}
 
// Will return full URL to image in your themes assets/image/ folder
{{ asset('image/foo.png') }}
 
URL of image.