<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="http://kerkness.ca/wiki/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://kerkness.ca/wiki/feed.php">
        <title>Unofficial Kohana 3.0 Wiki routing</title>
        <description></description>
        <link>http://kerkness.ca/wiki/</link>
        <image rdf:resource="http://kerkness.ca/wiki/lib/images/favicon.ico" />
       <dc:date>2010-09-08T13:41:53+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://kerkness.ca/wiki/doku.php?id=routing:404_pages_by_catching_reflection_exception&amp;rev=1277985171&amp;do=diff"/>
                <rdf:li rdf:resource="http://kerkness.ca/wiki/doku.php?id=routing:building_routes_with_subdirectories&amp;rev=1255463007&amp;do=diff"/>
                <rdf:li rdf:resource="http://kerkness.ca/wiki/doku.php?id=routing:creating_a_custom_404_page&amp;rev=1270121638&amp;do=diff"/>
                <rdf:li rdf:resource="http://kerkness.ca/wiki/doku.php?id=routing:differ_request_for_internal_and_external&amp;rev=1264116904&amp;do=diff"/>
                <rdf:li rdf:resource="http://kerkness.ca/wiki/doku.php?id=routing:how_to_redirect_the_user_request&amp;rev=1255666872&amp;do=diff"/>
                <rdf:li rdf:resource="http://kerkness.ca/wiki/doku.php?id=routing:how_to_test_the_routes&amp;rev=1255968898&amp;do=diff"/>
                <rdf:li rdf:resource="http://kerkness.ca/wiki/doku.php?id=routing:ignoring_overflow_in_a_route&amp;rev=1255455031&amp;do=diff"/>
                <rdf:li rdf:resource="http://kerkness.ca/wiki/doku.php?id=routing:multi-language_with_a_route&amp;rev=1276529140&amp;do=diff"/>
                <rdf:li rdf:resource="http://kerkness.ca/wiki/doku.php?id=routing:reverse_routing_and_pagination&amp;rev=1277984504&amp;do=diff"/>
                <rdf:li rdf:resource="http://kerkness.ca/wiki/doku.php?id=routing:routing_basics&amp;rev=1277067088&amp;do=diff"/>
                <rdf:li rdf:resource="http://kerkness.ca/wiki/doku.php?id=routing:static_pages&amp;rev=1256139096&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://kerkness.ca/wiki/lib/images/favicon.ico">
        <title>Unofficial Kohana 3.0 Wiki</title>
        <link>http://kerkness.ca/wiki/</link>
        <url>http://kerkness.ca/wiki/lib/images/favicon.ico</url>
    </image>
    <item rdf:about="http://kerkness.ca/wiki/doku.php?id=routing:404_pages_by_catching_reflection_exception&amp;rev=1277985171&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-07-01T11:52:51+00:00</dc:date>
        <title>routing:404_pages_by_catching_reflection_exception</title>
        <link>http://kerkness.ca/wiki/doku.php?id=routing:404_pages_by_catching_reflection_exception&amp;rev=1277985171&amp;do=diff</link>
        <description>404 Error Pages by catching ReflectionException


This is just a quick guide to accurately displaying a 404 error.
Using a catch-all route won't work 100% of the time, because you can have the correct Controller, but the wrong action, and it will throw a ReflectionException.</description>
    </item>
    <item rdf:about="http://kerkness.ca/wiki/doku.php?id=routing:building_routes_with_subdirectories&amp;rev=1255463007&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-10-13T19:43:27+00:00</dc:date>
        <title>routing:building_routes_with_subdirectories</title>
        <link>http://kerkness.ca/wiki/doku.php?id=routing:building_routes_with_subdirectories&amp;rev=1255463007&amp;do=diff</link>
        <description>What if you wanted to use sub-directories in your controller and dynamically support these in your routing you can use the following examples as a starting point.

Supporting a Single Sub-directory


Let's consider the following controller ( Controller_Foo_Bar )</description>
    </item>
    <item rdf:about="http://kerkness.ca/wiki/doku.php?id=routing:creating_a_custom_404_page&amp;rev=1270121638&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-04-01T11:33:58+00:00</dc:date>
        <title>routing:creating_a_custom_404_page</title>
        <link>http://kerkness.ca/wiki/doku.php?id=routing:creating_a_custom_404_page&amp;rev=1270121638&amp;do=diff</link>
        <description>In order to have a custom 404 page in your Kohana application you'll want to try and catch all invalid routes and direct them to a controller/action specifically setup to display a 404 message. The following example route does this.

While most custom routes should be defined before your default route, in this case the catch all should be defined after your default route. (*note: your default route will need to be more specific than the standard default route defined in the unedited application …</description>
    </item>
    <item rdf:about="http://kerkness.ca/wiki/doku.php?id=routing:differ_request_for_internal_and_external&amp;rev=1264116904&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-01-21T23:35:04+00:00</dc:date>
        <title>routing:differ_request_for_internal_and_external</title>
        <link>http://kerkness.ca/wiki/doku.php?id=routing:differ_request_for_internal_and_external&amp;rev=1264116904&amp;do=diff</link>
        <description>When using Kohana HMVC it is nice to differ the requests into external (the ones that come from the client) and the internal (sub-requests that are made within your application). To do so just check to see if the request is internal or external in the before() method of your template controller.</description>
    </item>
    <item rdf:about="http://kerkness.ca/wiki/doku.php?id=routing:how_to_redirect_the_user_request&amp;rev=1255666872&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-10-16T04:21:12+00:00</dc:date>
        <title>routing:how_to_redirect_the_user_request</title>
        <link>http://kerkness.ca/wiki/doku.php?id=routing:how_to_redirect_the_user_request&amp;rev=1255666872&amp;do=diff</link>
        <description>If you want to redirect the user request to a new page or a new route you can use the redirect() method from the Request Class

Usage
  Request::instance()-&gt;redirect('http://kohanaphp.com');  Request::instance()-&gt;redirect('controller/action');  Request::instance()-&gt;redirect( Route::get('demo-sample')-&gt;uri(array('category'=&gt;'books', 'id'=&gt;5)) );</description>
    </item>
    <item rdf:about="http://kerkness.ca/wiki/doku.php?id=routing:how_to_test_the_routes&amp;rev=1255968898&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-10-19T16:14:58+00:00</dc:date>
        <title>routing:how_to_test_the_routes</title>
        <link>http://kerkness.ca/wiki/doku.php?id=routing:how_to_test_the_routes&amp;rev=1255968898&amp;do=diff</link>
        <description>Often you want to test the routes you've just created. You can go to the URI, but you can also do it with a little snippet as mentioned here. The snippet looks like:

  // Here you define the routes
  // ...
  Route::set('post', 'post/&lt;id&gt;', array('id' =&gt; '[\d]+'))
      -&gt;defaults(array(
          'controller' =&gt; 'post',
          'action'     =&gt; 'index',
  ));
  // ...
  
  // The URI to test
  $uri = 'post/1';
  // This will loop trough all the defined routes and
  // tries to match them with…</description>
    </item>
    <item rdf:about="http://kerkness.ca/wiki/doku.php?id=routing:ignoring_overflow_in_a_route&amp;rev=1255455031&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-10-13T17:30:31+00:00</dc:date>
        <title>routing:ignoring_overflow_in_a_route</title>
        <link>http://kerkness.ca/wiki/doku.php?id=routing:ignoring_overflow_in_a_route&amp;rev=1255455031&amp;do=diff</link>
        <description>By default a Kohana route looks like this.

  controller/action/id

But what if you want your route to also support the following

  controller/action/id/and/anything/else/you/want/to/add/at/random

You need to modify your default route and add a little regex in your application/bootstrap.php file.</description>
    </item>
    <item rdf:about="http://kerkness.ca/wiki/doku.php?id=routing:multi-language_with_a_route&amp;rev=1276529140&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-06-14T15:25:40+00:00</dc:date>
        <title>routing:multi-language_with_a_route</title>
        <link>http://kerkness.ca/wiki/doku.php?id=routing:multi-language_with_a_route&amp;rev=1276529140&amp;do=diff</link>
        <description>There are many ways to accomplish i18n functionality with Kohana. One way is to incorporate language into a Route.

For example

  http://example.com/en-us/products // For English
  http://example.com/fr-fr/products // For French

You can define your Route to catch the language portion of the request. The example below only allows English, French and Dutch to be requested and defaults to English.</description>
    </item>
    <item rdf:about="http://kerkness.ca/wiki/doku.php?id=routing:reverse_routing_and_pagination&amp;rev=1277984504&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-07-01T11:41:44+00:00</dc:date>
        <title>routing:reverse_routing_and_pagination</title>
        <link>http://kerkness.ca/wiki/doku.php?id=routing:reverse_routing_and_pagination&amp;rev=1277984504&amp;do=diff</link>
        <description>One of the great things about Routing in Kohana 3 is that you can generate link URLs which are attributed to a named route.

This allows you to change the schema at the Route, and have it apply on both ends at the Controller and everywhere the Route is used to generate the controller.</description>
    </item>
    <item rdf:about="http://kerkness.ca/wiki/doku.php?id=routing:routing_basics&amp;rev=1277067088&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-06-20T20:51:28+00:00</dc:date>
        <title>routing:routing_basics</title>
        <link>http://kerkness.ca/wiki/doku.php?id=routing:routing_basics&amp;rev=1277067088&amp;do=diff</link>
        <description>Kohana 3.0s Route Class provides you with unlimited options on how to map specifically formatted requests to specific controllers and actions.

Routes should be defined in your application/bootstrap.php file or in the modules/mymodule/init.php file by calling the Route::set() method.</description>
    </item>
    <item rdf:about="http://kerkness.ca/wiki/doku.php?id=routing:static_pages&amp;rev=1256139096&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-10-21T15:31:36+00:00</dc:date>
        <title>routing:static_pages</title>
        <link>http://kerkness.ca/wiki/doku.php?id=routing:static_pages&amp;rev=1256139096&amp;do=diff</link>
        <description>Kohana works extremely well for building dynamic web sites and applications. However not everything needs to be dynamic and creating a controller/action combination for every static page is a little over kill. Here is how you can create a controller and route to handle static pages and support i18n so that your site can be multilingual.</description>
    </item>
</rdf:RDF>
