/
services.yml
50 lines (44 loc) · 1.8 KB
/
services.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
services:
# First we define some basic services to make these utilities available in
# the entire application
slugger:
class: AppBundle\Utils\Slugger
markdown:
class: AppBundle\Utils\Markdown
# These are the Twig extensions that create new filters and functions for
# using them in the templates
app.twig.app_extension:
public: false
class: AppBundle\Twig\AppExtension
arguments: [@markdown, %app_locales%]
tags:
- { name: twig.extension }
app.twig.intl_extension:
public: false
class: Twig_Extensions_Extension_Intl
tags:
- { name: twig.extension }
app.redirect_to_preferred_locale_listener:
class: AppBundle\EventListener\RedirectToPreferredLocaleListener
arguments: [@router, %app_locales%, %locale%]
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }
app.form.type.datetimepicker:
class: AppBundle\Form\Type\DateTimePickerType
tags:
- { name: form.type, alias: app_datetimepicker }
# Uncomment the following lines to define a service for the Post Doctrine repository.
# It's not mandatory to create these services, but if you use repositories a lot,
# these services simplify your code:
#
# app.post_repository:
# class: Doctrine\ORM\EntityRepository
# factory: [@doctrine.orm.entity_manager, getRepository]
# arguments: [AppBundle\Entity\Post]
#
# // traditional code inside a controller
# $entityManager = $this->getDoctrine()->getManager();
# $posts = $entityManager->getRepository('AppBundle:Post')->findAll();
#
# // same code using repository services
# $posts = $this->get('app.post_repository')->findAll();