Introduction
Basic Concepts
Understanding Routing
Controllers
Views
Assets
Modules Calling Modules
Parent & Child Modules
Database Operations
Modules within Modules
Templates & Themes
Helpers Explained
Form Handling
Working with Files
The Module Import Wizard
Authorization & Authentication
The API Explorer
If you’ve found an error, spotted something missing, or feel a section could be clearer or better explained, we’d love to hear from you. Your feedback helps keep the documentation accurate and useful for everyone.
Please report issues or suggest improvements on GitHub. Community input is invaluable in making the docs stronger.
Not comfortable with GitHub? No problem — you can also get in touch with us directly via our contact form. We welcome all feedback.
Basic Example - Part 2
Create an Assets Directory
Within the 'welcome' module, alongside the existing 'controllers' and 'views' directories, create a new directory named 'assets'.
Inside the 'assets' directory, create a subdirectory named 'js'. This 'js' directory will serve as the repository for JavaScript files within the module.
Create a JavaScript File
Next, create a JavaScript file named 'ahoy.js' that contains a single line of code: an alert command.
Save the 'ahoy.js' file inside the 'js' directory located within 'assets'.

Calling the JavaScript File
To include the JavaScript file in the 'hello' view file, use standard 'script' tags with the 'src' attribute set to <?= htmlspecialchars("'welcome_module/js/ahoy.js'") ?>. For example:
View File with JavaScript Integration
Below is the complete code for the 'hello' view file, incorporating the 'script' tags just before the closing body tag:
Testing the JavaScript File
Save the file and refresh the page in the browser. If a JavaScript alert box appears, it confirms that the JavaScript file has loaded successfully.

The integration of a JavaScript file into a module containing PHP files marks a significant milestone. This capability enhances productivity by enabling the development of sophisticated, self-contained modules without reliance on third-party libraries.
In this example, a JavaScript file was included within the module. However, the same approach can be applied to incorporate images, PDFs, CSS files, or other non-PHP resources.