mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Adds folder support for making partials
This commit is contained in:
parent
cf1988eeca
commit
8e69039c0d
@ -3,7 +3,7 @@
|
||||
use File;
|
||||
use Twig_Error;
|
||||
use Cms\Classes\SectionParser;
|
||||
use ApplicationException;
|
||||
use October\Rain\Exception\ApplicationException;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
|
@ -50,7 +50,8 @@ trait ViewMaker
|
||||
public function makePartial($partial, $params = [], $throwException = true)
|
||||
{
|
||||
if (!File::isPathSymbol($partial) && realpath($partial) === false) {
|
||||
$partial = '_' . strtolower($partial) . '.htm';
|
||||
$folder = strpos($partial, '/') !== false ? dirname($partial) . '/' : '';
|
||||
$partial = $folder . '_' . strtolower(basename($partial)).'.htm';
|
||||
}
|
||||
|
||||
$partialPath = $this->getViewPath($partial);
|
||||
@ -136,7 +137,8 @@ trait ViewMaker
|
||||
public function makeLayoutPartial($partial, $params = [])
|
||||
{
|
||||
if (!File::isLocalPath($partial) && !File::isPathSymbol($partial)) {
|
||||
$partial = '_' . strtolower($partial);
|
||||
$folder = strpos($partial, '/') !== false ? dirname($partial) . '/' : '';
|
||||
$partial = $folder . '_' . strtolower(basename($partial));
|
||||
}
|
||||
|
||||
return $this->makeLayout($partial, $params);
|
||||
|
Loading…
x
Reference in New Issue
Block a user