Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Using modules withoud namespacing?
  • I just can't get over the horrible syntax of the "\" infront of modules and controllers... :) Well ok I'm using them in my projects of course but I'm just wondering if it is possible to use "modules" withour namespacing everything... So I don't have to use \View::forge(), \Config::get(), etc... and like wise when asking for modules inside another module... "\Products\Model_Product::..." just "Model_Product::..." I'm really new to namespaces so I am not understanding them 100%
  • No it's not possible, modules are always namespaced. If the prefixed backslash bothers you that much you can add "use" statements at the top of your files:
    use View;
    use Config;
    use Products\Model_Product;
    

    Take a look at the docs on PHP.net
  • Thanks man... And yes it bothers like crazy! :) just doesn't "look" right. I was reading the docs yesterday but I i'm not grasping this namespace thingy good enough... I'll have to work on that. I'll try your way and see if it works for me :) Again, thanks!

Howdy, Stranger!

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

In this Discussion