Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
namespaces use required?
  • Does one have to use namespaces to use fuelphp? I see the Cascading File system is promoted in phil sturgeon's blog, but I'm not a fan of namespaces: I (believe i) understand where they may make sense - but I don't want to use them (some reasones: http://pornel.net/phpns - no bikeshedding intended). Does my dislike of namespaces hinder my ability to use fuel?
  • Namespaces are a means to avoid collisions in class naming, and are a core component of FuelPHP's architecture. All classes in app/classes by default live in the global namespace, all FuelPHP core classes are aliased to the global namespace. So if you stick to that you won't encounter any namespaces. You will not be able to use:
    - migrations
    - tasks
    - modules
    - packages They are all namespaced. Face it, namespaces are needed, and they are here to stay. There is no way you can build a larger or more complex application without them, it was this shortcoming in many other frameworks that lead us to design FuelPHP in the first place. Yes, it might be that PHP's support for namespaces isn't as good (yet) as other languages, but not using them is absolutely worse than living with the limitations. Version 2 of FuelPHP will be PSR compliant, which means namespaces will be everywhere. All classes per default live in a <vendor>/<package> namespace.

Howdy, Stranger!

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

In this Discussion