Getting helpers in concrete5 5.7+

This document requires that you have read about the Service Container.

We used to call Loader::helper('helperName') to get instances of many useful classes.

Now we switched to the much more flexible Service Providers approach.

Since the concrete5 core team takes care of you, moving to this new approach is nevertheless as straightforward as replacing the helper calls with:

$app->make('helper/helperName');

Short aliases

A few helpers are also accessible with a shorter name:

Long form syntax Short alias
$app->make('helper/concrete/ui/help') $app->make('help')
$app->make('helper/date') $app->make('date')
$app->make('helper/mail') $app->make('mail')
$app->make('helper/validation/captcha') $app->make('captcha')
$app->make('helper/validation/ip') $app->make('ip')
$app->make('helper/validation/token') $app->make('token')
$app->make('helper/validation/error') $app->make('error')

Ready-to-use helpers in page views

In block views and in dashboard page views, it's not necessary to call $app->make('helper/form'): you already have a variable named $form that contains it.

Loading Conversation