Naming convention for Controller class?

edited January 2013 in Share
I am new to Fuel CMS and I am really enjoy using this great framework.
I have a question about the controller class please.

I have a view name "contact-us"

In this case, I want to create a controller to process the form data please.
But since PHP class cannot have "-" in the class name.

What is the work around this for me to be able to create a controller for "contact-us" page?

My solution is,
I am thinking about using the route.php to set up like.
$route['contact-us'] = 'contact_us';
Then I need to create a controller file name "contact_us.php".

in the index method, I will call the view like,
public function index() { // load the fuel_page library class and pass it the view file you want to load $this->load->module_library(FUEL_FOLDER, 'fuel_page', array('location' => 'contact-us')); $this->fuel_page->render(); }
What would be the best solution to resolve this problem?
I have all of my view that contain "-" and most of the view need to process the data.

"How do you put the code in the forum? Do you use any tag?"

Thank you very much.

Comments

  • edited 5:47AM
    You can use a "code" tag to put code in the Forum.

    I don't see any issue with your method to use a controller and route to get the contact-us page.

    As a side note, if you are just new to FUEL, I'd recommend checking out the 1.0 beta branch. Lots of new features and improvements.
    https://github.com/daylightstudio/FUEL-CMS/tree/1.0
  • edited 5:47AM
    Ok. I will check out this.
    Thank you very much for your answer.
Sign In or Register to comment.