Move Template::layout() to LayoutHelper
This commit is contained in:
@@ -69,23 +69,6 @@ class Template
|
|||||||
return ob_get_clean();
|
return ob_get_clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Render a page layout
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $template_name Template name
|
|
||||||
* @param array $template_args Key/value map
|
|
||||||
* @param string $layout_name Layout name
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function layout($template_name, array $template_args = array(), $layout_name = 'layout')
|
|
||||||
{
|
|
||||||
return $this->render(
|
|
||||||
$layout_name,
|
|
||||||
$template_args + array('content_for_layout' => $this->render($template_name, $template_args))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define a new template override
|
* Define a new template override
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace Kanboard\Helper;
|
|||||||
use Kanboard\Core\Base;
|
use Kanboard\Core\Base;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Layout helpers
|
* Layout Helper
|
||||||
*
|
*
|
||||||
* @package helper
|
* @package helper
|
||||||
* @author Frederic Guillot
|
* @author Frederic Guillot
|
||||||
@@ -30,7 +30,7 @@ class LayoutHelper extends Base
|
|||||||
$params['board_selector'] = $this->projectUserRole->getActiveProjectsByUser($this->userSession->getId());
|
$params['board_selector'] = $this->projectUserRole->getActiveProjectsByUser($this->userSession->getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->template->layout($template, $params);
|
return $this->pageLayout($template, $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -146,7 +146,24 @@ class LayoutHelper extends Base
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common method to generate a sublayout
|
* Render page layout
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @param string $template Template name
|
||||||
|
* @param array $params Key/value dictionary
|
||||||
|
* @param string $layout Layout name
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function pageLayout($template, array $params = array(), $layout = 'layout')
|
||||||
|
{
|
||||||
|
return $this->template->render(
|
||||||
|
$layout,
|
||||||
|
$params + array('content_for_layout' => $this->template->render($template, $params))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Common method to generate a sub-layout
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $sublayout
|
* @param string $sublayout
|
||||||
|
|||||||
Reference in New Issue
Block a user