aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/front/controllers/ShaarliController.php
blob: 2a166c3c4db56907207ae9adaf7f643df6d9cda9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

declare(strict_types=1);

namespace Shaarli\Front\Controller;

use Shaarli\Container\ShaarliContainer;

abstract class ShaarliController
{
    /** @var ShaarliContainer */
    protected $ci;

    /** @param ShaarliContainer $ci Slim container (extended for attribute completion). */
    public function __construct(ShaarliContainer $ci)
    {
        $this->ci = $ci;
    }

    /**
     * Assign variables to RainTPL template through the PageBuilder.
     *
     * @param mixed $value Value to assign to the template
     */
    protected function assignView(string $name, $value): self
    {
        $this->ci->pageBuilder->assign($name, $value);

        return $this;
    }
}