Can't install Uniform plugin

I tried to install Uniform by the “Traditional” method, and when I try to load a page with a form I get a Whoops alert:

Call to undefined function uniform()

pointing to the first line of the Controller code:

$form = uniform('contact-form', array(

The example code was taken from this tutorial. I tried in both PHP 5.6 and 7.


The code from that tutorial is old, the syntax has changed. Please check out the Uniform documentation that is linked in the Uniform repo.


use Uniform\Form;

return function ($site, $pages, $page)
    $form = new Form([
        'email' => [
            'rules' => ['required', 'email'],
            'message' => 'Please enter a valid email address',
        'message' => [
            'rules' => ['required'],
            'message' => 'Please enter a message',

    if (r::is('POST')) {
            'to' => '',
            'from' => '',

    return compact('form');

Of course… That solved it.
Thanks, @texnixe!