├── Resources
├── snippets
│ └── frontend
│ │ └── routing_demonstration
│ │ └── index.ini
├── views
│ └── frontend
│ │ ├── index
│ │ └── search.tpl
│ │ └── routing_demonstration
│ │ ├── foo.tpl
│ │ └── index.tpl
├── services.xml
└── config.xml
├── DerweiliStartup.php
├── Subscribers
└── FrontendRoutingSubscriber.php
├── plugin.xml
└── Controllers
└── Frontend
└── RoutingDemonstration.php
/Resources/snippets/frontend/routing_demonstration/index.ini:
--------------------------------------------------------------------------------
1 | [de_DE]
2 | GoToNextPage = "Nächste Seite"
3 |
4 | [en_GB]
5 | GoToNextPage = "Next Page"
--------------------------------------------------------------------------------
/Resources/views/frontend/index/search.tpl:
--------------------------------------------------------------------------------
1 | {extends file="parent:frontend/index/search.tpl"}
2 | {block name='frontend_index_search_container'}
3 | Hier nix suche
4 | {/block}
--------------------------------------------------------------------------------
/DerweiliStartup.php:
--------------------------------------------------------------------------------
1 | Hier kommt noch ein bisschen Text
5 | {action module='widgets' controller='listing' action='topSeller'}
6 | {/block}
--------------------------------------------------------------------------------
/Resources/views/frontend/routing_demonstration/index.tpl:
--------------------------------------------------------------------------------
1 | {extends file="parent:frontend/index/index.tpl"}
2 |
3 | {block name='frontend_index_content'}
4 |
5 | Ich bin die {$currentAction}-action
6 |
7 |
8 | {s name="GoToNextPage"}{/s}
9 |
10 |
11 |
12 | {/block}
--------------------------------------------------------------------------------
/Resources/services.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Resources/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 | random_text
7 |
8 |
9 | Hello world!
10 | Hier kannst du einen zufälligen Text angeben
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Subscribers/FrontendRoutingSubscriber.php:
--------------------------------------------------------------------------------
1 | 'onPreDispatch'
12 | ];
13 | }
14 |
15 | public function onPreDispatch(\Enlight_Event_EventArgs $args)
16 | {
17 | /** @var \Shopware_Controllers_Frontend_RoutingDemonstration $subject */
18 | $subject = $args->getSubject();
19 | $subject->View()->addTemplateDir(__DIR__ . '/../Resources/views');
20 | }
21 |
22 | }
--------------------------------------------------------------------------------
/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 | 1.0.0
8 | http://derweili.org
9 | Derweili
10 |
11 |
12 |
13 | Farbe geändert; Schriftgröße geändert;
14 | changed color; changed font-size;
15 |
16 |
--------------------------------------------------------------------------------
/Controllers/Frontend/RoutingDemonstration.php:
--------------------------------------------------------------------------------
1 | Request()->getActionName() == 'index' && !$this->get('session')->get('sUserId')){
8 | $this->redirect([
9 | 'controller' => 'account',
10 | 'action' => 'login',
11 | 'sTarget' => 'RoutingDemonstration',
12 | 'sTargetAction' => $this->Request()->getActionName()
13 | ]);
14 | }
15 | }
16 |
17 | public function indexAction() {
18 | $this->view->assign('nextAction', 'foo');
19 | }
20 |
21 | public function fooAction(){
22 | $this->view->assign('nextAction', 'index');
23 | }
24 |
25 | public function postDispatch()
26 | {
27 | $currentAction = $this->Request()->getActionName();
28 | $this->view->assign('currentAction', $currentAction);
29 | }
30 |
31 | }
--------------------------------------------------------------------------------