From d09fda92422d391f63a2c500e502c79f2ce05422 Mon Sep 17 00:00:00 2001 From: Frank de Jonge Date: Fri, 17 Aug 2012 14:53:59 +0200 Subject: [PATCH] HTTP method based action prefix example. --- general/controllers/base.html | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/general/controllers/base.html b/general/controllers/base.html index 9d5c4eb91..24ae31f06 100644 --- a/general/controllers/base.html +++ b/general/controllers/base.html @@ -80,6 +80,26 @@

Creating a controller

isn't allowed, "action_list" is no problem). But this also means you can give your controller public methods that can be used from other classes but are not routable.

+ +

HTTP method prefixed action.

+ +

+ It's possible to route to HTTP method prefixed actions. Here is an example: +

+ +
class Controller_Example extends Controller
+{
+	public function get_index()
+	{
+		// This will be called when the HTTP method is GET.
+	}
+	
+	public function post_index()
+	{
+		// This will be called when the HTTP method is POST.
+	}
+}
+

Controllers in Sub-Directories