Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Scaffolding doesn't create correctly named Controller
  • I'm using
    php oil g scaffold entry title:string
    
    to create views, controller and model. When I go to mysite.local/entries i get a 404 error. This is solved by renaming
    Controller_Entry
    
    to
    Controller_Entries
    
    in classes/controllers/entries.php
    I guess somewhere along the line the Controller class name doesn't get pluralized. Am I doing something wrong or is it just that way?
  • This was fixed in develop a few days after v1.0.0 was released and was pointed out by a huge number of users, but we had to wait for v1.0.1 to be tagged... it works now.
  • It's not you. This is a known issue.
  • This has been fixed in the dev branch of fuel.
  • hello, I experienced the same issue when I generate controller, using Fuel1.1: $> php oil g controller religions --crud
    The generated Controller: <?php class Controller_Religion extends Controller_Template
    { public function action_index()
    {
    $this->template->title = 'Religions » Index';
    $this->template->content = View::forge('religions/index');
    } }
    so that I should change the class name to Controller_Religions manually
  • Has been fixed in develop. Line 417 in classes/generate.php should read:
    $class_name = \Inflector::classify($name, false);
    

Howdy, Stranger!

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

In this Discussion