Hi guys,
I'm trying to develop an app with fuel, but I have some questione about namespace and classes.
This is my structure in the "app" folder:
- classes
--- controller
--- model
--- utility
tag
permission
I have some problem using "Tag" and "Permission" (in a static way, of course), because if I use "Utility_Tag::something()" it works, but I want to use it with only "Tag::something()" or, better, "Namespace\Tag::something()".
How can I do that?
Mmm I didn't thought about it... A simple explanation:
- Module are part of my application
- Package are generics pieces of code that I can reuse, right?
If what I written was right, thank you! I thought that I have to put them in classes folder because are a part of this application
Mmm I tried to do what you suggested, but there was an error... "Trying to add a non-existent module 'utility' ".
My folder structure is:
modules
--- utility
classe
permission
tag
Classes have namespace e definition like you write and I call them with \Utility\Permission::method()
What is the problem?
It seems that what you want to create is a package...
Modules are used as application extensions... like a blog, forum or faq that you can make portable and use on multiple sites.
Packages are core extensions. That is, they are used to extend the framework itself, not the application.
Besides, if you wanted to be able to call a module file, I believe you would first have to use
Thank you, now finally works... I created a package (thanks nerdsrescueme) and everything works well... And I've understand the differenze between modules and packages.
I hope to release the new application as soon as possible!