All Aimeos templates are written in PHP using a template engine and view helpers that are easy to understand. It works in all integrations in the same way, is extremely fast and doesn't require you as developer to learn a new syntax.
Since version 2017.04, you can alternatively use Laravels Blade template engine for Aimeos templates overwritten for your project. Thus, all your templates will be in the same template language.
To replace an Aimeos PHP template by our own Blade template, the Blade template needs to be stored at the same location as you would store the PHP template, i.e. the ./client/html/templates/ folder of your project-specific Aimeos extension. You should also keep the directory structure underneath and must save the file as <template-name>.blade.php, e.g.
The file extension .blade.php is important to be recognized as template that should be processed by Laravels Blade engine. Additionally, you must configure your new template in your ./config/shop.php file, e.g.
'client' => array(
'html' => array(
'catalog' => array(
'detail' => array(
'standard' => array(
'template-body' => 'catalog/detail/body-default.blade.php',
You can find the available settings for the used templates in the configuration articles.
The Laravel functions available in the Blade templates can't give you access to all data you need. Therefore, the Aimeos package contains some functions to retrieve data from Aimeos specific sources like configuration settings or translations.
mixed aiconfig( string $key [, mixed $default = null] )
The aiconfig() function retrieves the Aimeos setting for the given key, e.g. "client/html/catalog/lists/basket-add". If no value is found for the key, the given default value is returned instead.
string aitrans( string $singular [, array $params = array() [, $domain = 'client' [, $locale = null ]]] )
string aitransplural( string $singular, string $plural, integer $number [, array $params = array() [, $domain = 'client' [, $locale = null ]]] )
The aitrans() function retrieves the translated value from the Aimeos Gettext files. It's similar to Laravels trans() function and useful for translating singular phrases only. The aitransplural() function must be used to translate strings where numbers are involved, e.g.
aitransplural( '%1$d apple', '%1$d apples', 10, array( 10 ) );
When the third parameter is "1", the function would return "1 apple" and for values greater than 1 it returns e.g. "10 apples". The method takes care about the different plural rules for all languages.
If the fourth argument (params) contains values, they will be used to replace the placeholders in the translated string. Internally, the vsprintf() method takes care about that.
The domain argument is the same as used in the Aimeos $this->translate() view helper. In the frontend it's either "client" or "client/code" while for templates in the administration interface it's "admin".
To retrieve translations for a different language than the current one, you can pass over the ISO language code for that language in the fifth parameter (locale). Depending on the languages available, you can also use country specific language codes, e.g. "en_US".
The Aimeos template engine has a "block" view helper to save a rendered template so it can be inserted in another template. This is very similar to the @section() and @endsection tags of Laravels Blade engine and you should replace the block view helper statements with the appropriate Blade section directives, e.g.
<?php $this->block()->start( 'cataog/detail/actions' ); ?>
<?php $this->block()->stop(); ?>
<?php echo $this->block()->get( 'catalog/detail/actions' ); ?>
by this Blade template:
@section( 'cataog/detail/actions' )
@yield( 'cataog/detail/actions' )