Skip to content

Commit f007e94

Browse files
committed
added symfony 4 compatibility
1 parent 21139d7 commit f007e94

25 files changed

+66
-66
lines changed

Controller/BreadcrumbController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function breadcrumbAction(Request $request, $title = '') {
4949
}
5050
}
5151

52-
return $this->render('AvanzuAdminThemeBundle:Breadcrumb:breadcrumb.html.twig', [
52+
return $this->render('@AvanzuAdminTheme/Breadcrumb/breadcrumb.html.twig', [
5353
'active' => $list,
5454
'title' => $title,
5555
]);

Controller/DefaultController.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,36 @@ class DefaultController extends Controller
1818
*/
1919
public function indexAction()
2020
{
21-
return $this->render('AvanzuAdminThemeBundle:Default:index.html.twig');
21+
return $this->render('@AvanzuAdminTheme/Default/index.html.twig');
2222
}
2323

2424
/**
2525
* @return \Symfony\Component\HttpFoundation\Response
2626
*/
2727
public function dashboardAction() {
28-
return $this->render('AvanzuAdminThemeBundle:Default:index.html.twig');
28+
return $this->render('@AvanzuAdminTheme/Default/index.html.twig');
2929
}
3030

3131
/**
3232
* @return \Symfony\Component\HttpFoundation\Response
3333
*/
3434
public function uiGeneralAction() {
35-
return $this->render('AvanzuAdminThemeBundle:Default:index.html.twig');
35+
return $this->render('@AvanzuAdminTheme/Default/index.html.twig');
3636
}
3737

3838
public function uiIconsAction() {
39-
return $this->render('AvanzuAdminThemeBundle:Default:index.html.twig');
39+
return $this->render('@AvanzuAdminTheme/Default/index.html.twig');
4040
}
4141

4242
public function formAction() {
4343
$form = $this->createForm(FormDemoModelType::class);
4444

45-
return $this->render('AvanzuAdminThemeBundle:Default:form.html.twig', [
45+
return $this->render('@AvanzuAdminTheme/Default/form.html.twig', [
4646
'form' => $form->createView(),
4747
]);
4848
}
4949

5050
public function loginAction() {
51-
return $this->render('AvanzuAdminThemeBundle:Default:login.html.twig');
51+
return $this->render('@AvanzuAdminTheme/Default/login.html.twig');
5252
}
5353
}

Controller/NavbarController.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function notificationsAction($max = self::MAX_NOTIFICATIONS)
3939
$listEvent = $this->getDispatcher()->dispatch(ThemeEvents::THEME_NOTIFICATIONS, new NotificationListEvent());
4040

4141
return $this->render(
42-
'AvanzuAdminThemeBundle:Navbar:notifications.html.twig',
42+
'@AvanzuAdminTheme/Navbar/notifications.html.twig',
4343
[
4444
'notifications' => $listEvent->getNotifications(),
4545
'total' => $listEvent->getTotal(),
@@ -61,7 +61,7 @@ public function messagesAction($max = self::MAX_MESSAGES)
6161
$listEvent = $this->getDispatcher()->dispatch(ThemeEvents::THEME_MESSAGES, new MessageListEvent());
6262

6363
return $this->render(
64-
'AvanzuAdminThemeBundle:Navbar:messages.html.twig',
64+
'@AvanzuAdminTheme/Navbar/messages.html.twig',
6565
[
6666
'messages' => $listEvent->getMessages(),
6767
'total' => $listEvent->getTotal(),
@@ -83,7 +83,7 @@ public function tasksAction($max = self::MAX_TASKS)
8383
$listEvent = $this->triggerMethod(ThemeEvents::THEME_TASKS, new TaskListEvent($max));
8484

8585
return $this->render(
86-
'AvanzuAdminThemeBundle:Navbar:tasks.html.twig',
86+
'@AvanzuAdminTheme/Navbar/tasks.html.twig',
8787
[
8888
'tasks' => $listEvent->getTasks(),
8989
'total' => $listEvent->getTotal(),
@@ -105,7 +105,7 @@ public function userAction()
105105

106106
if ($userEvent instanceof ShowUserEvent) {
107107
return $this->render(
108-
'AvanzuAdminThemeBundle:Navbar:user.html.twig',
108+
'@AvanzuAdminTheme/Navbar/user.html.twig',
109109
[
110110
'user' => $userEvent->getUser(),
111111
'links' => $userEvent->getLinks(),

Controller/SecurityController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function loginAction(Request $request)
3131
}
3232

3333
return $this->render(
34-
'AvanzuAdminThemeBundle:Security:login.html.twig',
34+
'@AvanzuAdminTheme/Security/login.html.twig',
3535
[
3636
'last_username' => $session->get(SecurityContext::LAST_USERNAME),
3737
'error' => $error,

Controller/SidebarController.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function userPanelAction()
2929
$userEvent = $this->getDispatcher()->dispatch(ThemeEvents::THEME_SIDEBAR_USER, new ShowUserEvent());
3030

3131
return $this->render(
32-
'AvanzuAdminThemeBundle:Sidebar:user-panel.html.twig',
32+
'@AvanzuAdminTheme/Sidebar/user-panel.html.twig',
3333
[
3434
'user' => $userEvent->getUser(),
3535
]
@@ -51,7 +51,7 @@ protected function getDispatcher()
5151
*/
5252
public function searchFormAction()
5353
{
54-
return $this->render('AvanzuAdminThemeBundle:Sidebar:search-form.html.twig', []);
54+
return $this->render('@AvanzuAdminTheme/Sidebar/search-form.html.twig', []);
5555
}
5656

5757
public function menuAction(Request $request)
@@ -63,7 +63,7 @@ public function menuAction(Request $request)
6363
$event = $this->getDispatcher()->dispatch(ThemeEvents::THEME_SIDEBAR_SETUP_MENU, new SidebarMenuEvent($request));
6464

6565
return $this->render(
66-
'AvanzuAdminThemeBundle:Sidebar:menu.html.twig',
66+
'@AvanzuAdminTheme/Sidebar/menu.html.twig',
6767
[
6868
'menu' => $event->getItems(),
6969
]

DependencyInjection/AvanzuAdminThemeExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function prepend(ContainerBuilder $container)
117117
'twig',
118118
[
119119
'form_theme' => [
120-
'AvanzuAdminThemeBundle:layout:form-theme.html.twig',
120+
'@AvanzuAdminTheme/layout/form-theme.html.twig',
121121
],
122122
'globals' => [
123123
'admin_theme' => '@avanzu_admin_theme.theme_manager',

DependencyInjection/Compiler/TwigPass.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function process(ContainerBuilder $container)
4848
$param = [];
4949
}
5050

51-
array_push($param, 'AvanzuAdminThemeBundle:layout:form-theme.html.twig');
51+
array_push($param, '@AvanzuAdminTheme/layout/form-theme.html.twig');
5252

5353
$container->setParameter('twig.form.resources', $param);
5454

Event/ThemeEvents.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ThemeEvents
3535
* used to receive the current user for the sidebar
3636
*
3737
* macro: avanzu_sidebar_user
38-
* template: AvanzuAdminThemeBundle:Sidebar:user-panel.html.twig
38+
* template: @AvanzuAdminTheme/Sidebar/user-panel.html.twig
3939
*/
4040
const THEME_SIDEBAR_USER = 'theme.sidebar_user';
4141

Resources/docs/form_theme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ allow customize the form elements in AdminTLE.
66
This is used as:
77

88
```twig
9-
{% form_theme form 'AvanzuAdminThemeBundle:layout:form-theme.html.twig' %}
9+
{% form_theme form '@AvanzuAdminTheme/layout/form-theme.html.twig' %}
1010
```
1111

1212
For override the default theme in twig template you need put in the template which you want the new form theme
@@ -25,7 +25,7 @@ You also could apply this, only checking if a form is defined:
2525

2626
```twig
2727
{% if form is defined %}
28-
{% form_theme form 'AvanzuAdminThemeBundle:layout:form-theme.html.twig' %}
28+
{% form_theme form '@AvanzuAdminTheme/layout/form-theme.html.twig' %}
2929
{% endif %}
3030
```
3131

@@ -34,5 +34,5 @@ Also is possible override the form theme by referencing
3434
only customize/override some childs elements in the form like:
3535

3636
```twig
37-
{% form_theme form.submit 'AvanzuAdminThemeBundle:layout:form-theme.html.twig' %}
37+
{% form_theme form.submit '@AvanzuAdminTheme/layout/form-theme.html.twig' %}
3838
```

Resources/docs/layout.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Note: this instrucions are for [dev-master branch][4], if you are using stable v
44

55
In order to use the layout, your views should extend from the provided `default-layout`
66
```twig
7-
{% extends 'AvanzuAdminThemeBundle:layout:default-layout.html.twig' %}
7+
{% extends '@AvanzuAdminTheme/layout/default-layout.html.twig' %}
88
```
99
### twig global
1010
Instead of fully relying on blocks and includes, you are provided with a twig global named `avanzu_admin_context` to store and retrieve particular values throughout the page rendering.
@@ -16,19 +16,19 @@ In order to make overriding some of the template regions easier, there are sever
1616
Listed in the order of appearance, these are:
1717

1818
<dl>
19-
<dt>AvanzuAdminThemeBundle:Partials:_head.html.twig
19+
<dt>@AvanzuAdminTheme/Partials/_head.html.twig
2020
<dd>Defines the `head` tag contents.
21-
<dt>AvanzuAdminThemeBundle:Sidebar:knp-menu.html.twig
21+
<dt>@AvanzuAdminTheme/Sidebar/knp-menu.html.twig
2222
<dd>Renders the knp menu using the builder defined as `main_menu`.
2323
<br/>___Notice___ *this partial will only be included when the knp_menu is enabled.*
24-
<dt>AvanzuAdminThemeBundle:Breadcrumb:knp-breadcrumb.html.twig
24+
<dt>@AvanzuAdminTheme/Breadcrumb/knp-breadcrumb.html.twig
2525
<dd>Rendes the knp menu using the builder defined as `breadcrumb_menu`
2626
<br/>___Notice___ *this partial will only be included when the knp_menu is enabled.*
27-
<dt>AvanzuAdminThemeBundle:Partials:_footer.html.twig
27+
<dt>@AvanzuAdminTheme/Partials/_footer.html.twig
2828
<dd>Renders the main footer
29-
<dt>AvanzuAdminThemeBundle:Partials:_control-sidebar.html.twig
29+
<dt>@AvanzuAdminTheme/Partials/_control-sidebar.html.twig
3030
<dd>Renders the control sidebar (righthand panel) unless it is disabled in the config (default)
31-
<dt>AvanzuAdminThemeBundle:Partials:_scripts.html.twig
31+
<dt>@AvanzuAdminTheme/Partials/_scripts.html.twig
3232
<dd>Renders script tags. Located right before the closing `body`.
3333
</dl>
3434

@@ -85,7 +85,7 @@ The blocks defined in the layout in order of appearance. Some of them do contain
8585
<dd>Renders the `searchPanel` component
8686

8787
<dt>avanzu_sidebar_nav
88-
<dd>Renders the `menu` component _or_ includes `AvanzuAdminThemeBundle:Sidebar:knp-menu.html.twig` depending on wether the `knp_menu` is enabled or not.
88+
<dd>Renders the `menu` component _or_ includes `@AvanzuAdminTheme/Sidebar/knp-menu.html.twig` depending on wether the `knp_menu` is enabled or not.
8989

9090
<dt>avanzu_page_title
9191
<dd>Defines the page header inside `.content-header` *(and implicitly the `title` if you haven't changed the content of `avanzu_document_title`)*
@@ -94,16 +94,16 @@ The blocks defined in the layout in order of appearance. Some of them do contain
9494
<dd>Defines the `small` portion of `.content-header`
9595

9696
<dt>avanzu_breadcrumb
97-
<dd>Renders either the `breadcrumb` component or includes `AvanzuAdminThemeBundle:Breadcrumb:knp-breadcrumb.html.twig` based on your configuration.
97+
<dd>Renders either the `breadcrumb` component or includes `@AvanzuAdminTheme/Breadcrumb/knp-breadcrumb.html.twig` based on your configuration.
9898

9999
<dt>avanzu_page_content
100100
<dd>The main content area.
101101

102102
<dt>avanzu_footer
103-
<dd>The main footer. Includes `AvanzuAdminThemeBundle:Partials:_footer.html.twig` by default.
103+
<dd>The main footer. Includes `@AvanzuAdminTheme/Partials/_footer.html.twig` by default.
104104

105105
<dt>avanzu_control_sidebar
106-
<dd>Includes `AvanzuAdminThemeBundle:Partials:_control-sidebar.html.twig` if it is enabled.
106+
<dd>Includes `@AvanzuAdminTheme/Partials/_control-sidebar.html.twig` if it is enabled.
107107

108108
<dt>avanzu_javascripts
109109
<dd>comes right after the `_scripts.html.twig` partial.

Resources/docs/twig_widgets.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ avanzu_admin_theme:
3535
## box-widget.html.twig
3636
3737
```twig
38-
{% embed 'AvanzuAdminThemeBundle:Widgets:box-widget.html.twig' %}
38+
{% embed '@AvanzuAdminTheme/Widgets/box-widget.html.twig' %}
3939
{% block box_title %}
4040
{# Title goes here #}
4141
{% endblock %}
@@ -99,7 +99,7 @@ _**Notice:** since FALSE will not be considered a value by twig and therefor act
9999
## infobox-widget
100100
The infobox widget has no default configuration. The very nature of this widget type is to be distinguishable from each other hence, the configuration would be overridden anyways.
101101
```twig
102-
{% embed 'AvanzuAdminThemeBundle:Widgets:infobox-widget.html.twig' with {
102+
{% embed '@AvanzuAdminTheme/Widgets/infobox-widget.html.twig' with {
103103
'color' : 'aqua',
104104
'icon' : 'comments-o',
105105
}%}

Resources/views/Default/form.html.twig

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{% extends 'AvanzuAdminThemeBundle:layout:default-layout.html.twig' %}
2-
{% block avanzu_head %} {% include 'AvanzuAdminThemeBundle:Partials:_header-form-extra.html.twig' %}{% endblock %}
1+
{% extends '@AvanzuAdminTheme/layout/default-layout.html.twig' %}
2+
{% block avanzu_head %} {% include '@AvanzuAdminTheme/Partials/_header-form-extra.html.twig' %}{% endblock %}
33

44
{% block avanzu_page_title %} {{ 'avanzu_admin_theme.default.form.forms'|trans({}, 'AvanzuAdminTheme') }} {% endblock %}
55
{% block avanzu_page_subtitle %} {{ 'avanzu_admin_theme.default.form.demonstration'|trans({}, 'AvanzuAdminTheme') }} {% endblock %}
@@ -23,7 +23,7 @@
2323
<div class="col-md-6">
2424

2525

26-
{% embed 'AvanzuAdminThemeBundle:Widgets:box-widget.html.twig' %}
26+
{% embed '@AvanzuAdminTheme/Widgets/box-widget.html.twig' %}
2727
{% block box_before %}{{ form_start(form) }}{% endblock %}
2828
{% block box_title %}{{ 'Form theme'|trans({}, 'AvanzuAdminTheme') }}{% endblock %}
2929
{% block box_body %}{{ form_widget(form) }}{% endblock %}
@@ -48,7 +48,7 @@
4848

4949
{% endblock %}
5050

51-
{% block avanzu_javascripts %}{% include 'AvanzuAdminThemeBundle:Partials:_scripts-form-extra.html.twig' %}{% endblock %}
51+
{% block avanzu_javascripts %}{% include '@AvanzuAdminTheme/Partials/_scripts-form-extra.html.twig' %}{% endblock %}
5252
{% block avanzu_javascripts_inline %}
5353
<script>
5454
$(function () {

Resources/views/Default/index.html.twig

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
{% extends 'AvanzuAdminThemeBundle:layout:default-layout.html.twig' %}
1+
{% extends '@AvanzuAdminTheme/layout/default-layout.html.twig' %}
22

33
{% block avanzu_page_content %}
44
<div class="row">
55
<div class="col-md-6">
66
{# ... infobox widget, solid background ... #}
7-
{% embed 'AvanzuAdminThemeBundle:Widgets:infobox-widget.html.twig' with {
7+
{% embed '@AvanzuAdminTheme/Widgets/infobox-widget.html.twig' with {
88
'solid' : 'red',
99
'icon' : 'star-o',
1010
'progress' : 40
@@ -18,7 +18,7 @@
1818
<div class="col-md-6">
1919

2020
{# ... infobox widget, colored icon ... #}
21-
{% embed 'AvanzuAdminThemeBundle:Widgets:infobox-widget.html.twig' with {
21+
{% embed '@AvanzuAdminTheme/Widgets/infobox-widget.html.twig' with {
2222
'color' : 'aqua',
2323
'icon' : 'comments-o',
2424
} %}
@@ -32,9 +32,9 @@
3232
<div class="row">
3333
<div class="col-md-6">
3434
{# ... box widget with defaults ... #}
35-
{% embed 'AvanzuAdminThemeBundle:Widgets:box-widget.html.twig' %}
35+
{% embed '@AvanzuAdminTheme/Widgets/box-widget.html.twig' %}
3636

37-
{% import 'AvanzuAdminThemeBundle:Macros:buttons.html.twig' as btn %}
37+
{% import '@AvanzuAdminTheme/Macros/buttons.html.twig' as btn %}
3838
{% block box_title %}{{ 'Widget box title'|trans({}, 'AvanzuAdminTheme') }}{% endblock %}
3939
{% block box_body %}
4040
<div class="callout callout-info">
@@ -54,14 +54,14 @@
5454
</div>
5555
<div class="col-md-6">
5656
{# ... box widget with some options ... #}
57-
{% embed 'AvanzuAdminThemeBundle:Widgets:box-widget.html.twig' with {
57+
{% embed '@AvanzuAdminTheme/Widgets/box-widget.html.twig' with {
5858
'boxtype' : 'success',
5959
'solid' : 0,
6060
'collapsible' : 'Collapse this'|trans({}, 'AvanzuAdminTheme') ~ '... ',
6161
'removable' : 'Remove this'|trans({}, 'AvanzuAdminTheme') ~ '...',
6262
} %}
6363

64-
{% import 'AvanzuAdminThemeBundle:Macros:buttons.html.twig' as btn %}
64+
{% import '@AvanzuAdminTheme/Macros/buttons.html.twig' as btn %}
6565
{% block box_title %}{{ 'Widget box title' }}{% endblock %}
6666
{% block box_body %}
6767
<div class="callout callout-info">

Resources/views/Default/login.html.twig

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends 'AvanzuAdminThemeBundle:layout:login-layout.html.twig' %}
1+
{% extends '@AvanzuAdminTheme/layout/login-layout.html.twig' %}
22

33
{% block page_content %}
44
<div class="login-box">
@@ -20,7 +20,7 @@
2020
<div class="col-xs-8">
2121
<div class="checkbox">
2222
<label>
23-
<input type="checkbox"> {{ 'Remember Me'|trans({}, 'AvanzuAdminTheme') }}
23+
<input type="checkbox"> {{ 'Remember Me'|trans({}, 'AvanzuAdminTheme') }}
2424
</label>
2525
</div>
2626
</div><!-- /.col -->
@@ -41,4 +41,4 @@
4141

4242
</div><!-- /.login-box-body -->
4343
</div>
44-
{% endblock %}
44+
{% endblock %}

Resources/views/Exception/exception_full.html.twig

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends 'AvanzuAdminThemeBundle:layout:base-layout.html.twig' %}
1+
{% extends '@AvanzuAdminTheme/layout/base-layout.html.twig' %}
22
{% block page_title %} Error {% endblock %}
33
{% block page_subtitle %} {{ status_code }} {% endblock %}
44

@@ -91,4 +91,4 @@
9191
</div>
9292
{% endfor %}
9393

94-
{% endblock %}
94+
{% endblock %}

Resources/views/Navbar/messages.html.twig

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- Messages: style can be found in dropdown.less-->
2-
{% import "AvanzuAdminThemeBundle:layout:macros.html.twig" as macro %}
2+
{% import "@AvanzuAdminTheme/layout/macros.html.twig" as macro %}
33
<li class="dropdown messages-menu">
44
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
55
<i class="fa fa-envelope-o"></i>
@@ -28,4 +28,4 @@
2828
</li>
2929
<li class="footer"><a href="{{ path('all_messages'|route_alias) }}">{{'See All Messages'|trans({}, 'AvanzuAdminTheme')}}</a></li>
3030
</ul>
31-
</li>
31+
</li>

Resources/views/Navbar/user.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{# @var links \Avanzu\AdminThemeBundle\Model\NavBarUserLink[] #}
33
{# @var showProfileLink bool #}
44
{# @var showLogoutLink bool #}
5-
{% import "AvanzuAdminThemeBundle:layout:macros.html.twig" as macro %}
5+
{% import "@AvanzuAdminTheme/layout/macros.html.twig" as macro %}
66
<li class="dropdown user user-menu">
77
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
88
{{ macro.avatar(user.avatar, user.username, 'user-image') }}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends 'AvanzuAdminThemeBundle:layout:login-layout.html.twig' %}
1+
{% extends '@AvanzuAdminTheme/layout/login-layout.html.twig' %}

0 commit comments

Comments
 (0)