summaryrefslogtreecommitdiff
path: root/app/Helper/Layout.php
blob: 685c7b8468d4092eb723ff86436a1b5328d03679 (plain)
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
32
<?php

namespace Kanboard\Helper;

use Kanboard\Core\Base;

/**
 * Layout helpers
 *
 * @package helper
 * @author  Frederic Guillot
 */
class Layout extends Base
{
    /**
     * Render a template without the layout if Ajax request
     *
     * @access public
     * @param  string $template Template name
     * @param  array  $params   Template parameters
     * @return string
     */
    public function app($template, array $params = array())
    {
        if ($this->request->isAjax()) {
            return $this->template->render($template, $params);
        }

        $params['board_selector'] = $this->projectUserRole->getActiveProjectsByUser($this->userSession->getId());
        return $this->template->layout($template, $params);
    }
}