本文整理汇总了PHP中Forms::textarea方法的典型用法代码示例。如果您正苦于以下问题:PHP Forms::textarea方法的具体用法?PHP Forms::textarea怎么用?PHP Forms::textarea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Forms
的用法示例。
在下文中一共展示了Forms::textarea方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$sexe = ['M', 'F'];
$arrayTextareas = ['description', 'Je ne sais pas'];
$arrayCheckbox = ['1', '2', '3', '4', '5'];
$arrayRadio = ['Truc1', 'Truc2', 'Truc3', 'Truc4', 'Truc5'];
// initiation du Form
echo $form->initForm();
// Input
foreach ($arrayInputs as $arrayInput) {
echo $form->input($arrayInput);
}
// select
echo $form->select('loisirs', $freetime);
echo $form->select('taille', $size);
echo $form->select('Sexe', $sexe);
// checkbox
echo $form->checkbox('Les Trucs', $arrayCheckbox);
echo $form->bpRadio('Un Truc', $arrayRadio);
// Textarea
foreach ($arrayTextareas as $arrayTextarea) {
echo $form->textarea($arrayTextarea);
}
// button
echo $form->buttons('resset');
echo $form->buttons('submit');
// fin du formulaire
$form->endForm();
?>
</div>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>
</body>
</html>
示例2: _buildForm
//.........这里部分代码省略.........
$options = array_merge($options, _ControllerFront::parseConfig($q_col['validate']));
}
if ($module != "") {
switch ($module) {
case "module":
break;
case "plugin":
$options['table'] = $this->table;
$options['mode'] = $this->mode;
$options['row_data'] = $row_data;
$options['id'] = $this->id;
$options['col_name'] = $column['name'];
_ControllerFront::pluginColumnEdit($_name_space . $column['name'], $value, $options);
$col_ready = true;
break;
case "position":
//build a selectDefault but with special options ehh
$options['col_display'] = $column['name'];
$options['col_value'] = $column['name'];
//do it manual style, to accomodate constraint change or late entries
//do a relative selection of position, based upon existing list.. oh!
//factor in the contraint if set
//factor in null
if (isset($config['col_constraint'])) {
//check if we're nullable
if (AdaptorMysql::isNullable($this->table, $config['col_constraint']) && Utils::isNull($row_data[$config['col_constraint']]['value'])) {
$_v = "IS NULL";
} else {
$_v = ' = \'' . $row_data[$config['col_constraint']]['value'] . '\'';
}
$options['select_sql'] = "SELECT * FROM `{$this->table}` WHERE `{$config['col_constraint']}` " . $_v . " ORDER BY `{$column['name']}`";
} else {
$options['select_sql'] = "SELECT * FROM `{$this->table}` ORDER BY `{$column['name']}`";
}
$options['table'] = $this->table;
$options['col_name'] = $column['name'];
$options['id'] = $this->id;
$options['name_space'] = $_name_space;
$options['label'] = $display_name;
$options['allow_null'] = false;
Forms::selectDefault($_name_space . $column['name'], $value, $options);
$col_ready = true;
break;
case "slug":
$source = isset($config['col_source']) ? $_name_space . $config['col_source'] : null;
Forms::text($_name_space . $column['name'], $value, $options);
print '
<script type="text/javascript">
Event.observe(window,\'load\', function(){createSlug(\'' . $_name_space . $column['name'] . '\',\'' . $source . '\')}, true);
</script>
';
$col_ready = true;
break;
case "disabled":
$col_ready = true;
break;
default:
$options['table'] = $this->table;
$options['col_name'] = $column['name'];
$options['id'] = $this->id;
$options['name_space'] = $_name_space;
$options['label'] = $display_name;
//add database datasource for countries and states
if ($module == 'selectState') {
$options['datasource'] = BLACKBIRD_TABLE_PREFIX . 'states';
}
if ($module == 'selectCountry') {
$options['datasource'] = BLACKBIRD_TABLE_PREFIX . 'countries';
}
Forms::$module($_name_space . $column['name'], $value, $options);
$col_ready = true;
break;
}
}
}
//defaults
if (!$col_ready) {
switch (true) {
case $col_type == 'datetime' || $col_type == 'timestamp':
Forms::selectDateTime($_name_space . $column['name'], $value, $options);
break;
case $col_type == 'date':
Forms::selectDate($_name_space . $column['name'], $value, $options);
break;
case $col_type == 'time':
Forms::selectTime($_name_space . $column['name'], $value, $options);
break;
case $col_type == 'text' || $col_type == 'longtext' || $col_type == 'tinytext' || $col_type == 'mediumtext':
Forms::textarea($_name_space . $column['name'], $value, $options);
break;
default:
Forms::text($_name_space . $column['name'], $value, $options);
break;
}
}
}
$r = ob_get_contents();
ob_end_clean();
return $r;
}