Members

Note: You can use your Sitellite.org account here and vice versa.

Username

Password

Remember Login

Forgot your password?

Not a member? Click here to register

Predefined Data And Rules

Home Page | All Pages | Recently Revised | Authors | Feeds |

Define form data or rules

for them to be available for all apps, put them in
inc/conf/properties.php, otherwise, put them in
inc/your_app/conf/properties.php

Warning: there is no $intl available when the global inc/conf/properties.php is loaded !


<?php

// Note:  use intl_get only in app-level properties

formdata_set (
    'sex',
    array (
        'male'   => intl_get ('Male'),
        'female' => intl_get ('Female'),
        'unknow' => intl_get ('Unknow'),
    )
);

// from inc/conf/properties.php:

formrules_set (
    'username',
    array (
        array ('not empty', 'You must enter a username to continue.'),
        array ('unique "sitellite_user/username"',
             'The username you have chosen is already in use.'),
    )
);

?>

Use them in a settings file


<?php
[sex]
type = select
setValues = "eval: formdata_get('sex')"
?>

Or use them in the form class


<?php
$w =& $this->widgets['sex'];
$w->setValues (formdata_get('sex') );
?>

Lux: any example of a formrules_get() usage ?

Revision from August 1, 2007 1:15 PM by electrolinux

Forward in time (1 more) | Back in time (1 more) | See current | See changes | Linked from: Forms