From e454b6974020e589e770ed983492188f85ddc755 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Mon, 12 May 2014 14:16:05 +0400 Subject: [PATCH] Add routing examples --- .../Controller/HelloWorldController.php | 24 +++++++++++++++++++ Mibew/Mibew/Plugin/Boilerplate/routing.yml | 11 +++++++++ 2 files changed, 35 insertions(+) create mode 100644 Mibew/Mibew/Plugin/Boilerplate/Controller/HelloWorldController.php create mode 100644 Mibew/Mibew/Plugin/Boilerplate/routing.yml diff --git a/Mibew/Mibew/Plugin/Boilerplate/Controller/HelloWorldController.php b/Mibew/Mibew/Plugin/Boilerplate/Controller/HelloWorldController.php new file mode 100644 index 0000000..ffc9789 --- /dev/null +++ b/Mibew/Mibew/Plugin/Boilerplate/Controller/HelloWorldController.php @@ -0,0 +1,24 @@ +attributes->get('name') . '!'); + } +} diff --git a/Mibew/Mibew/Plugin/Boilerplate/routing.yml b/Mibew/Mibew/Plugin/Boilerplate/routing.yml new file mode 100644 index 0000000..e85de3b --- /dev/null +++ b/Mibew/Mibew/Plugin/Boilerplate/routing.yml @@ -0,0 +1,11 @@ +# Here we can easily define custom routes. Let's create a "Hello world!" page. +mibew_boilerplate_hello: + # Relative path from the Mibew web root is used here. + path: /mibew-boilerplate-hello/{name} + # Set some defaults for the request + defaults: + # This value is special. It tells the system what action should be + # invoked for the response + _controller: Mibew\Mibew\Plugin\Boilerplate\Controller\HelloWorldController::indexAction + # Set a default value for the "{name}" placeholder + name: world