Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Routing Problem
  • I am not sure if this is the right forum to ask this

    My problem is one routing, on my local computer my application runs successfully but wen I upload it I get the following error.

    "Fuel\Core\FuelException [ Error ]:
    The requested view could not be found: calendar/index"

    when I go into my routing file and do I set it as default landing page, as below it works

    "'_root_'  => 'calendar/index',"

    Please help, what am I missing
  • HarroHarro
    Accepted Answer
    A route defines a uri to controller/action mapping. The error is not that your controller can't be found, or that a controller action is missing, so this is not route related.

    The error is "The requested view could not be found: calendar/index", so it can't find app/views/calendar/index.php, containing your action's view file.

    First port of call is to check if it's uploaded, if the rights on the files are ok (so the webserver can read them), and if you haven't used uppercase anywhere in a file or folder name (which you can get away with on a Windows platform, but not on a Linux platform).
  • I checked my files, they are all uploaded. I checked for upper case/lower case. and noted all my folders and files are named in lower case. I have given all my files and folders chmod rights 777.
    Still the error persists.

    my controller is as below

    public function action_index()
        {
       
        $this->template->title = "Individuals";
            $this->template->content = View::forge('calendar\index');
        }

    and my folder path is "app/views/calendar/index.php" all in lowercase.

    Surprisingly if I set it as the default landing page its working

    "'_root_'  => 'calendar/index',"

    i checked on my developing machine I am using php 5.4 and on the hosting  machine its PHP 5.3

    I am using fuelphp 1.7.

  • SyntaxlbSyntaxlb
    Accepted Answer
    What print this line in your controller ? => var_dump(\Finder::search('views', 'calendar/index', '.php', false, false)); die();
  • HarroHarro
    Accepted Answer
    $this->template->content = View::forge('calendar\index');

    should be

    $this->template->content = View::forge('calendar/index');

    Note the forward slash ! It is not a path, so don't use the stupid Windows backslash !

    That may work on a Windows machine due to the way PHP tries to unify things, but it absolutely doesn't work on a linux host.
  • It worked, just an issue on the slashes..

    Definately love the PHP community.

Howdy, Stranger!

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

In this Discussion