forked from Symfony-Plugins/swCrossLinkApplicationPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
82 lines (57 loc) · 2.35 KB
/
README
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Cross Application Routing
More info at : http://rabaix.net/en/articles/2009/07/13/cross-link-application-with-symfony-part-2
## Installation
The configuration format has been updated. You can now specify the routes to be loaded
for each environnement.
* Enable the feature, edit your app.yml
[yml]
all:
swToolbox:
cross_link_application:
frontend:
enabled: on # enable the feature
load:
backend:
routes: # routes to load, leave empty will load all the routes
- homepage
- edit_blog
env: # define the environment
dev: rabaix.net/backend.php # define the full path for the dev environnement
prod: rabaix.net/backend # define the full path for the prod environnement
backend:
enabled: on
load:
frontend:
routes:
- homepage
- edit_blog
env:
dev: rabaix.net/frontend_dev.php
prod: rabaix.net
* Note : The configuration format has been updated !
* Edit your factories.yml
[yml]
all:
routing:
class: swPatternRouting
* In your frontend's template, you can access to a backend route like this
[php]
<?php link_to('Edit Blog Post', '@backend.edit_post?id='.$blog->getId()) ?>
* that's all !!
## Performance
If you load too many routes, the application can be very slow in development. You can
save seconds by simply turn off the debug options.
[yml]
all:
routing:
class: swPatternRouting
param:
debug: false # default is true in dev mode.
Of course don't forget to reload the cache once the routing.yml file is updated
Please take a note that the default cache handler for routing is the sfFileCache.
This can also slow down the application because php has to serialize and unserialize
the cache.
Some input :
* 1150 routes generates a 3MBytes cache file
* 356 routes generates a 1MBytes cache file
So in production you might need to tweak the routing caching strategy