Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Switch all templates references to Twig namespaced syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
covex-nn authored and greg0ire committed Jan 26, 2018
1 parent 2c06425 commit d25b76f
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/reference/advanced_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Advanced Configuration
notification:
emails: [email@example.org, email2@example.org]
from: no-reply@sonata-project.org
template: 'SonataNewsBundle:Mail:comment_notification.txt.twig'
template: '@SonataNews/Mail/comment_notification.txt.twig'
class:
post: Application\Sonata\NewsBundle\Entity\Post
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ If you want to use the API, you also need ``friendsofsymfony/rest-bundle`` and `
notification:
emails: [email@example.org, email2@example.org]
from: no-reply@sonata-project.org
template: 'SonataNewsBundle:Mail:comment_notification.txt.twig'
template: '@SonataNews/Mail/comment_notification.txt.twig'
doctrine:
orm:
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/PostAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ protected function configureListFields(ListMapper $listMapper)
{
$listMapper
->add('custom', 'string', [
'template' => 'SonataNewsBundle:Admin:list_post_custom.html.twig',
'template' => '@SonataNews/Admin/list_post_custom.html.twig',
'label' => 'Post',
'sortable' => 'title',
])
Expand Down
2 changes: 1 addition & 1 deletion src/Block/RecentCommentsBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function configureSettings(OptionsResolver $resolver)
'number' => 5,
'mode' => 'public',
'title' => 'Recent Comments',
'template' => 'SonataNewsBundle:Block:recent_comments.html.twig',
'template' => '@SonataNews/Block/recent_comments.html.twig',
]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Block/RecentPostsBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function configureSettings(OptionsResolver $resolver)
'number' => 5,
'mode' => 'public',
'title' => 'Recent Posts',
'template' => 'SonataNewsBundle:Block:recent_posts.html.twig',
'template' => '@SonataNews/Block/recent_posts.html.twig',
]);
}

Expand Down
10 changes: 5 additions & 5 deletions src/Controller/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function renderArchive(array $criteria = [], array $parameters = [], Requ
'route_parameters' => $request->get('_route_params'),
], $parameters);

$response = $this->render(sprintf('SonataNewsBundle:Post:archive.%s.twig', $request->getRequestFormat()), $parameters);
$response = $this->render(sprintf('@SonataNews/Post/archive.%s.twig', $request->getRequestFormat()), $parameters);

if ('rss' === $request->getRequestFormat()) {
$response->headers->set('Content-Type', 'application/rss+xml');
Expand Down Expand Up @@ -188,7 +188,7 @@ public function viewAction($permalink)
;
}

return $this->render('SonataNewsBundle:Post:view.html.twig', [
return $this->render('@SonataNews/Post/view.html.twig', [
'post' => $post,
'form' => false,
'blog' => $this->getBlog(),
Expand Down Expand Up @@ -220,7 +220,7 @@ public function commentsAction($postId)
'status' => CommentInterface::STATUS_VALID,
], 1, 500); //no limit

return $this->render('SonataNewsBundle:Post:comments.html.twig', [
return $this->render('@SonataNews/Post/comments.html.twig', [
'pager' => $pager,
]);
}
Expand All @@ -241,7 +241,7 @@ public function addCommentFormAction($postId, $form = false)
$form = $this->getCommentForm($post);
}

return $this->render('SonataNewsBundle:Post:comment_form.html.twig', [
return $this->render('@SonataNews/Post/comment_form.html.twig', [
'form' => $form->createView(),
'post_id' => $postId,
]);
Expand Down Expand Up @@ -308,7 +308,7 @@ public function addCommentAction($id, Request $request = null)
]));
}

return $this->render('SonataNewsBundle:Post:view.html.twig', [
return $this->render('@SonataNews/Post/view.html.twig', [
'post' => $post,
'form' => $form,
]);
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/config/admin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
</call>
<call method="setTemplates">
<argument type="collection">
<argument key="inner_list_row">SonataNewsBundle:Admin:inner_row_comment.html.twig</argument>
<argument key="base_list_field">SonataAdminBundle:CRUD:base_list_flat_field.html.twig</argument>
<argument key="inner_list_row">@SonataNews/Admin/inner_row_comment.html.twig</argument>
<argument key="base_list_field">@SonataAdmin/CRUD/base_list_flat_field.html.twig</argument>
</argument>
</call>
</service>
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/views/Admin/inner_row_comment.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ file that was distributed with this source code.
#}

{% extends 'SonataAdminBundle:CRUD:base_list_flat_inner_row.html.twig' %}
{% extends '@SonataAdmin/CRUD/base_list_flat_inner_row.html.twig' %}

{% block row %}

Expand All @@ -31,4 +31,4 @@ file that was distributed with this source code.
{{ object|render_list_element(admin.list['message']) }}
</small>

{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion src/Resources/views/Admin/list_post_custom.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ file that was distributed with this source code.
#}

{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
{% extends '@SonataAdmin/CRUD/base_list_field.html.twig' %}

{% block field %}
<div class="col-sm-2 centered">
Expand Down

0 comments on commit d25b76f

Please sign in to comment.