phpBB

Development Wiki

Migrations/Data Changes/If

From phpBB Development Wiki

< Migrations‎ | Data Changes
Revision as of 23:14, 13 January 2013 by Exreaction (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The if statement helper allows you to create a basic if statement which will be checked and, if true, the attached statement will be parsed.

How it works

array('if', array(
    
true// Some statement that is either true or false
    
array(/* Call to make if the statement is true */),
)),

Examples

if ($this->config['captcha_gd']) { run array('config.update', array('captcha_plugin', 'phpbb_captcha_gd')), }

array('if', array(
    (
$this->config['captcha_gd']),
    array(
'config.update', array('captcha_plugin''phpbb_captcha_gd')),
)),


if ($this->config['allow_avatar_upload'] || $this->config['allow_avatar_local'] || $this->config['allow_avatar_remote']) { run array('config.update', array('allow_avatar', 1)), }

array('if', array(
    (
$this->config['allow_avatar_upload'] || $this->config['allow_avatar_local'] || $this->config['allow_avatar_remote']),
    array(
'config.update', array('allow_avatar'1)),
)),