TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Kohana_HTTP_Exception [ 404 ]: Unable to find a route to match the URI: template.php
  • Hi,

    I am trying to learn kohana from scratch, and am using the Kohana 3.0 beginners Guide 2011 pdf from packpub. But I´ve downloaded kohana 3.3 from github.

    I am still on the first chapter and have noticed many differences between 3.0 and 3.3 although up until now I´ve been able to modify the code by symultaneously reading the online documentation.

    I am trying to create my first template and cannot find a solution

    Welcome.php class Controller_Welcome extends Controller_Template {

    public function action_index()
    {
    
     $content = View::factory('welcome')
     ->bind('random',$random);
     $random = rand(1, 10);
     $content->site_name = 'Egotist Beta';
     $this->template->content = $content;
    
    }
    

    ...and am using this to create a simple template but I am getting "Unable to find a route to match the URI: template.php" Kohnan is expecting a file called template.php to be in classes/Controller I assume..but the tutorial says I don´t need it!?!?!

    Can anyone tell me where i´m going wrong?

    thanks,

    Rob

  • the template.php, containing the basic HTML outline, goes into application/views/template.php. The template.php needs at least the <?php echo $content ?> to show the View.

    You don't need a template file, you can repeat your site structure many times in many files, but you are seriously about coding, you should.

  • Actually it sounds like you have the files in the right place but are requesting http://whatever.server/template.php - if you are using the default route then your url should just be http://whatever.server/

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion