wesanox Posted June 2 Posted June 2 Hey everyone, I'm excited to share my first module WesanoxFrameworkPackage — built to simplify my workflow and experiment with some ideas. Description: Included Frontend Libraries - These libraries are bundled and loaded automatically (if the files exist): AOS 2.3.1, Swiper 11.2.6, Bootstrap 5.3.3, jQuery 3.7.1 All files are stored in the module’s internal /styles/ and /scripts/ folders. How to Use Add the following lines to your template files: // Outputs <link> tags for CSS assets echo $modules->WesanoxFrameworkPackage->renderStyles(); // Outputs <script> tags for JS assets echo $modules->WesanoxFrameworkPackage->renderScripts(); I'm always happy to improve things, so feel free to share your thoughts or ideas — and thanks in advance for any support. 🙂 Edit: I missed the links – I'm sorry: https://processwire.com/modules/wesanox-framework-package/ Github: https://github.com/wesanox/WesanoxFrameworkPackage.git 3 1
cwsoft Posted June 2 Posted June 2 Hi nice post. Just missing the content somehow. Would be nice to post a link to the PW modules directory with your module or at least to your Github (or similar VCS) repository. But the code examples look great by the way 🙂 1
bernhard Posted June 2 Posted June 2 Hey @wesanox congrats on your first module 🙂 I just had a very quick look and saw that your module is "autoload": https://github.com/wesanox/WesanoxFrameworkPackage/blob/b50d538b48f295133cf654838b6002cd0c006c4a/WesanoxFrameworkPackage.module#L19 Autoload means that it loads on each and every request even if you don't use it. I think you don't need this in your case. On the frontend you request it with $modules->WesanoxFrameworkPackage anyhow and on the backend I guess you don't need your module to be loaded? Oh, and I think this line is also not needed 🙂 It only tells PHP that "implements Module" refers to "Module" in the ProcessWire namespace. But since you have "namespace ProcessWire" at the top of your file "implements Module" will be enough, because no use statement means it will use the namespace of the file, which is ProcessWire. 1
wesanox Posted June 3 Author Posted June 3 Hey @bernhard, thank you for your input and for taking a deeper look into my module. I’ve adopted your suggestions right away. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now