Adding a system-wide message
As a module can really be thought of as a mini-application itself, adding functionality to a module is really the same process as adding functionality to the main application. Let's add some new functionality just for administrators; the ability to manage system-wide messages displayed to users when they first log into the application.
Creating the database table
As is often the case with brand new functionality, we need a place to house our data. We need to create a new table to store our system-wide messages. For our purposes, we can keep this simple. Here is the definition for our table:
CREATE TABLE `tbl_sys_message` ( `id` INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, `message` TEXT NOT NULL, `create_time` DATETIME, `create_user_id` INTEGER, `update_time` DATETIME, `update_user_id` INTEGER )
Create this new table in both the main trackstar_dev and our trackstar_test databases.
Creating our model and CRUD scaffolding
With the table in place,...