Skip to content

Commit

Permalink
Fix routes, README and some little changes in the controller
Browse files Browse the repository at this point in the history
  • Loading branch information
jolelievre committed Mar 28, 2019
1 parent 5a1d47c commit 81d9fdb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion mails/themes/modern/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Modern theme

This theme was generated based on the MJML templates as they offer great responsiveness and guaranty that
This theme was generated based on MJML templates as they offer great responsiveness and ensure that
your templates will be readable in most mail viewers and mail web applications.

The source MJML templates and the tool allowing to compile/convert them as twig templates can be found at:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* This controller is used to preview mail templates from new theme. It uses the
* same service used by the generator so it is a handy way to debug them.
*/
class MailLayoutController extends FrameworkBundleAdminController
final class MailLayoutController extends FrameworkBundleAdminController
{
/**
* @param string $theme
Expand Down Expand Up @@ -93,19 +93,16 @@ private function renderLayout($themeName, $layoutName, $type, $locale = '', $mod
{
/** @var ThemeCatalogInterface $themeCatalog */
$themeCatalog = $this->get(ThemeCatalogInterface::class);
try {
/** @var ThemeInterface $theme */
$theme = $themeCatalog->getByName($themeName);
} catch (InvalidArgumentException $e) {
throw new InvalidArgumentException($e->getMessage());
}
/** @var ThemeInterface $theme */
$theme = $themeCatalog->getByName($themeName);

/** @var LayoutInterface $layout */
$layout = null;
/* @var LayoutInterface $layoutInterface */
foreach ($theme->getLayouts() as $layoutInterface) {
if ($layoutInterface->getName() == $layoutName &&
(empty($module) || $layoutInterface->getModuleName() == $module)) {
if ($layoutInterface->getName() == $layoutName
&& (empty($module) || $layoutInterface->getModuleName() == $module)
) {
$layout = $layoutInterface;
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ _tax:

_mail_layout:
resource: "mail_layout.yml"
prefix: /mail_layout/
prefix: /mail-layout/

0 comments on commit 81d9fdb

Please sign in to comment.