Skip to content

Commit

Permalink
HTTP method based action prefix example.
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdejonge committed Aug 17, 2012
1 parent 03158a0 commit d09fda9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions general/controllers/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,26 @@ <h3 id="creating_a_controller">Creating a controller</h3>
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.
</p>

<h3 id="http_method_prefixed_actions">HTTP method prefixed action.</h3>

<p>
It's possible to route to HTTP method prefixed actions. Here is an example:
</p>

<pre class="php"><code>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.
}
}
</code></pre>

<h4 id="controller_in_subdir">Controllers in Sub-Directories</h4>

Expand Down

0 comments on commit d09fda9

Please sign in to comment.