本文整理汇总了PHP中FormHelper::text方法的典型用法代码示例。如果您正苦于以下问题:PHP FormHelper::text方法的具体用法?PHP FormHelper::text怎么用?PHP FormHelper::text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormHelper
的用法示例。
在下文中一共展示了FormHelper::text方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testText
public function testText()
{
//test where valueOrArray is array
$html = $this->object->text('element', array('arbitrary' => 'arbitrary', 'class' => 'test-class'));
$this->assertAttributes($html, array('class' => array('test-class', 'ccm-input-text'), 'arbitrary' => 'arbitrary', 'type' => 'text'));
//test where valueOrArray is value
$html = $this->object->text('element', 'value', array('arbitrary' => 'arbitrary', 'class' => 'test-class'));
$this->assertAttributes($html, array('class' => array('test-class', 'ccm-input-text'), 'value' => 'value', 'arbitrary' => 'arbitrary', 'type' => 'text'));
}
示例2: t
<?php
$classRequired = $divClassOverride ? $divClassOverride : 'user-or-hash-wrapper';
$form = new FormHelper();
?>
<div class="<?php
echo $classRequired;
?>
">
<?php
echo $form->select('userOrHash[]', $userTimelineOrHashSelectArray, $type);
?>
<?php
echo $form->text('userOrHashValue[]', $value, array('style' => 'size:40;'));
?>
<a class="setting-remove"><img src="<?php
echo $this->getBlockUrl();
?>
/images/delete.png" alt='<?php
echo t("delete");
?>
' title='<?php
echo t("delete");
?>
' width='16' height='16' style='vertical-align: middle;' /></a>
<?php
if (false && $lastSetting) {
?>
<a href="#" class="add-timeline-component" id="add-timeline-component-button"><img src="<?php
echo $this->getBlockUrl();
?>
示例3: array
?>
">
<label for="alignment">Alignement</label>
<?php
echo FormHelper::radios('alignment', array('' => 'Aucun', 'right' => 'Droite', 'center' => 'Centrer', 'left' => 'Gauche'), '');
?>
</div>
<div class="<?php
echo ++$i % 2 ? 'odd' : 'even';
?>
">
<label for="link">Lien</label>
<?php
echo FormHelper::text('href', '', array('size' => '100'));
?>
<br />
<?php
echo FormHelper::checkbox('target', '_blank', '_blank');
?>
Ouvrir dans une nouvelle fenêtre
</div>
</fieldset>
<div>
<input class="button" type="submit" value="Insérer dans l'éditeur">
ou
<a class="cancel" href="<?php
echo UrlComponent::path(array('action' => 'insertionIndex'));
?>
示例4: testInputText
public function testInputText()
{
$this->assertEqual(FormHelper::text('name', 'value', array('class' => 'myClass')), '<input type="text" name="name" class="myClass" value="value" id="name">');
$this->assertEqual(FormHelper::text('name', $this->Model, array('class' => 'myClass')), '<input type="text" name="name" class="myClass" value="obj" id="name">');
}
示例5: datetime
static function datetime($name, $value = '', $years = array(), $attributes = array())
{
$prefix = '_' . $name . '_';
$value = is_object($value) ? $value[$name] : $value;
$date = $time = null;
$year = $month = $day = null;
$hour = $minutes = $seconds = null;
$with_seconds = null;
if (!$value || $value == 'NOW()' || $value == 'TODAY()') {
$value = date('Y-m-d H:i:s');
}
if (isset($attributes['seconds']) && $attributes['seconds'] == true) {
$with_seconds = true;
unset($attributes['seconds']);
}
if (@(list($date, $time) = explode(' ', $value))) {
@(list($year, $month, $day) = explode('-', $date));
@(list($hour, $minutes, $seconds) = explode(':', $time));
}
$html = self::date($name, $value, (array) $years, (array) $attributes);
$html .= ' ' . __('à') . ' ';
$html .= FormHelper::text($prefix . 'hour', $hour, array('size' => 2, 'maxlength' => 2));
$html .= ' : ';
$html .= FormHelper::text($prefix . 'minutes', $minutes, array('size' => 2, 'maxlength' => 2));
if ($with_seconds) {
$html .= ' : ';
$html .= FormHelper::text($prefix . 'seconds', $seconds, array('size' => 2, 'maxlength' => 2));
} else {
$html .= FormHelper::hidden($prefix . 'seconds', $seconds);
}
return $html;
}
示例6: text
function text($field, $options = array())
{
return parent::text($field, $options);
}
示例7: text
/**
* Creates a text input widget.
*
* @param string $fieldName Name of a field, in the form "Modelname.fieldname"
* @param array $options Array of HTML attributes.
* @return string A generated HTML text input element
* @access public
* @link http://book.cakephp.org/view/1432/text
*/
public function text($fieldName, $options = array())
{
$options = $this->_addPlaceholder($fieldName, $options);
return parent::text($fieldName, $options);
}