Home Documentation GitHub Support


Skeltch is a PHP preprocessor for Glowie views. When working with Skeltch you can simplify the amount of PHP code in your views and make them a lot prettier and easier to understand.

Processing Skeltch views

To start using Skeltch, from your controller pass a true option as the last parameter of $this->renderView() or $this->renderTemplate() methods. This parameter will tell Glowie to process your Skeltch view into plain PHP code before loading it.

Skeltch caching

If the cache option is enabled in your App configuration, Skeltch will only compile a view if it hasn't been compiled yet or if there are any modifications to the view file. This cached view will be stored at app/cache. We highly recommend leaving caching on in a production environment, since it will boost your application performance significantly.


In order to display PHP variables in the view using Skeltch, put the variable between two pairs of curly braces.


$this->renderView('index', ['name' => 'Glowie'], true);

index view

<h2>Hello, {{$this->name}}</h2>
<!-- This will print "Hello, Glowie" (w/o quotes) -->

This snippet is a shortcut to PHP echo() function. This means you can use here any function that returns a printable string.

All content passed within this shortcut will be treated inside htmlspecialchars() function to prevent XSS attacks. If for some reason you want to bypass this treatment, use two exclamation marks right after the first two braces.


<h2>Hello, {{!!$this->name}}</h2>

Bypassing Skeltch compiling

While working with some frontend frameworks that also uses the curly braces syntax you may run into conflicts with Skeltch compiler. For dealing with this kind of conflict, simply put an @ before the expression and it will be ignored by Skeltch.


Hello, @{{$var}}

In this case, Skeltch will remove the @ symbol, but the rest of the expression will remain untouched for your frontend framework parser.


Conditionals in Skeltch views are written in the following way:

    <!-- Your code here -->
    <!-- Your code here -->
    <!-- Your code here -->

You can use any valid PHP logic between the parentheses.


In order to work with loops in the view using Skeltch, use any of the following snippets:

{@for($i=0; $i < $count; $i++)}
    <!-- Your code here -->
{@foreach($variable as $key => $value)}
    <!-- Your code here -->

You can use any valid PHP iteration logic between the parentheses.

You can also use break and continue statements as:



You can check for variables using the shortcuts for the functions empty() and isset():

    <!-- Your code here -->
    <!-- Your code here -->
    <!-- Your code here -->
    <!-- Your code here -->

You can also combine checkers with conditionals.


    <b>Your name is empty!</b>
    <b>Hello, {{$name}}</b>

Glowie shortcuts

Skeltch also provides shortcuts to common Glowie functions used in views:

$this->renderView() (see Views)

{@view('index', ['name' => 'Glowie'], true)}

$this->renderTemplate() (see Templates)

{@template('default', 'index', ['name' => 'Glowie'], true)}

echo Babel:get() (see Internationalization)

{@babel('message', 'en')}

echo Util::baseUrl() (see Util)



You can create comments by adding text between one pair of curly braces, starting with a hashtag. These comments will not be rendered into HTML.


{# Your comment goes here}

Raw PHP code

If you want to write raw PHP code in your Skeltch view, put your code between one pair of curly braces, starting with a percent sign.

Note: you must use semicolons when working with this kind of code.


{% $variable = 'test';}