You need to change some field labels in your project but don't want to rebuild and upload the whole project. In this tutorial we'll show how to do that storing field labels in the database and displaying them dynamically. As a bonus we'll also show how hide fields based on visibility rules stored in the database, make fields readonly or required.
First we need to create a table in the database to store all those settings. We would need fields like table name, field name, field label and visibility. Here is the sample table script for MySQL.
CREATE TABLE `settings`(
`id` int NOT NULL AUTO_INCREMENT,
`tablename` varchar(50) NULL,
`field` varchar(50) NULL, `label` varchar(100) NULL,
`visible` tinyint NULL DEFAULT 0,
`readonly` tinyint NULL DEFAULT 0,
`required` tinyint NULL DEFAULT 0,
PRIMARY KEY (`id`))
CHARACTER SET utf8;
Continue Reading "Storing field labels and visibility rules in the database"