HOW TO define triggers for module settings?

Discuss everything related to ApPHP Durecty CMF. All versions. Any questions related to the Directy CMF developing or using should be posted to this forum.

Moderators: alexandrleonenko, alexmst

Site Admin
Site Admin
Posts: 6169
Joined: Jan 7th, '09, 23:18

HOW TO define triggers for module settings?

Postby administrator » Dec 16th, '17, 17:01

Sometimes, when you create new property for modules, you have to define it to be related to some conditions.
Directy CMF has special option to do this.

There is a special field in "module_settings" table, that called "trigger_condition".
This field includes serialized array of trigger condition and data.

Below and example of such trigger:

Code: Select all

$serialize_data =  serialize(array(
   'trigger'=>array('key'=>'send_admin_email_notification', 'operation'=>'!=', 'value'=>'0'),
   'action'=>array('field'=>'is_required', 'value'=>'1')

After serialization such data will be looking as:

Code: Select all


Store this data into "trigger_condition" and it will be used automatically by the system.

Return to “ApPHP Directy CMF {developers/users}”