Преглед изворни кода

Intégration app product

develop
Fab пре 3 година
родитељ
комит
7c5a60e04c
2 измењених фајлова са 30 додато и 6 уклоњено
  1. +2
    -2
      Controller/Dashboard/DashboardAdminController.php
  2. +28
    -4
      Twig/TwigExtension.php

+ 2
- 2
Controller/Dashboard/DashboardAdminController.php Прегледај датотеку

@@ -83,8 +83,8 @@ class DashboardAdminController extends AbstractDashboardController
'main_menu' => '@LcSov/adminlte/block/menu.html.twig',
'crud/index' => '@LcSov/adminlte/crud/index.html.twig',
'crud/paginator' => '@LcSov/adminlte/crud/paginator.html.twig',
'crud/edit' => '@LcSov/adminlte/crud/edit.html.twig',
'crud/new' => '@LcSov/adminlte/crud/new.html.twig',
'crud/edit' => '@LcSov/adminlte/crud/form.html.twig',
'crud/new' => '@LcSov/adminlte/crud/form.html.twig',
'flash_messages' => '@LcSov/adminlte/block/flash_messages.html.twig',
]
)

+ 28
- 4
Twig/TwigExtension.php Прегледај датотеку

@@ -61,13 +61,37 @@ class TwigExtension extends AbstractExtension
new TwigFunction('sov_get_by_devalias', [$this, 'getByDevAlias']),
new TwigFunction('sov_parameter', [$this, 'getParameter']),
new TwigFunction('sov_homepage_route', [$this, 'getHomepageRoute']),
new TwigFunction('lc_format_price', [$this, 'formatPrice']),
new TwigFunction('die', [$this, 'die']),
];
}

public function die()
{
die();
}

public function getFilters()
{
return [];
return [
new TwigFilter('uc_first', [$this, 'ucFirst']),
new TwigFilter('format_price', [$this, 'formatPrice']),

];
}

public function formatPrice($price, $unbreakableSpace = true)
{
$price = number_format($price, 2, ',', ' ');
$price .= $unbreakableSpace ? ' ' : ' ';
$price .= '€';

return $price;
}

public function ucFirst($string)
{
return ucfirst($string);
}

public function liip($path, $thumb = 'tile', $default = 'default.jpg')
@@ -80,7 +104,7 @@ class TwigExtension extends AbstractExtension
$fileManagerFolder = substr($this->getFileManagerFolder(), 1);

if (strpos($path, $fileManagerFolder) === false) {
$path = $fileManagerFolder . '/' . $path;
$path = $fileManagerFolder.'/'.$path;
}

if (file_exists($path)) {
@@ -88,7 +112,7 @@ class TwigExtension extends AbstractExtension
}
}

return $this->cacheManager->getBrowserPath($this->getFileManagerFolder() . '/' . $default, $thumb);
return $this->cacheManager->getBrowserPath($this->getFileManagerFolder().'/'.$default, $thumb);
}

public function getFileManagerFolder()
@@ -103,7 +127,7 @@ class TwigExtension extends AbstractExtension

public function getParameter($name)
{
return $this->parameterBag->get($name) ;
return $this->parameterBag->get($name);
}

}

Loading…
Откажи
Сачувај