Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
how to access controller method from views
  • I am a new fuelphp driver.
    In order to practice it i code a simple example - "access controller method from views" , but it fails , when i click link then error shows The requested URL /fuelphp/1003/public/api/brand was not found on this server.
    please help me, tks .

    //controller
    class Controller_Api extends Controller
    {

        public function action_index()
        {
            return Response::forge(View::forge('wcar/show'));
        }

        public function action_brand()
        {
            Debug::dump('saab');
        }
    }

    //views  wcar/show.php
    <html>
    <head>
        <meta charset="utf-8">
        <title>show car</title>
    </head>
    <body>

    <a href=<?php echo Uri::create('api/brand'); ?>>show the brand</a>

    </body>
    </html>

    // routes.php
    return array(
        '_root_'  => 'api',
        '_404_'   => 'welcome/404',
    );
  • HarroHarro
    Accepted Answer
    How did you install it? What is your DocumentRoot? How did you setup your rewriting?
  • thanks Harro Verton , then i check .httaccess and httpd.conf , i found  the AllowOverride  of <VirtualHost> is None so fuelphp can not rewrite it.

    after setting AllowOverride All , fuelphp is working fine.
  • Ok, thanks for the feedback.

Howdy, Stranger!

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

In this Discussion