public function textarea($fieldName, $options, $before = false) { if ($before) { if ('textarea' === $options['type']) { $options += array('cols' => false, 'rows' => '3'); } return $options; } else { return parent::textarea($fieldName, $options); } }
public function render() { $sResult = FormHelper::textarea($this->getAlias(), $this->getValue(), array('class' => 'redactor_content', 'id' => 'field_' . $this->getAlias())); $sResult .= '<script>$(document).ready( function() { $( \'#field_' . $this->getAlias() . '\' ).ckeditor(); } );</script>'; echo $sResult; }
/** * FCK editor instance maken van textfield * * @param string $fieldName * @param array $options * @return string */ function textarea($fieldName, $options = array()) { $code = parent::textarea($fieldName, $options); $options = $this->_initInputField($fieldName, $options); $did = $options['id']; $js = $this->webroot . 'js/fck/'; $code .= '<script type="text/javascript">' . "\n"; $code .= "fckLoader_{$did} = function () {\n"; $code .= "var bFCKeditor_{$did} = new FCKeditor('{$did}');\n"; $code .= "bFCKeditor_{$did}.BasePath = '{$js}';\n"; $code .= "bFCKeditor_{$did}.ToolbarSet = 'Default';\n"; $code .= "bFCKeditor_{$did}.ReplaceTextarea();\n"; $code .= "}\n"; $code .= "fckLoader_{$did}();\n"; $code .= "</script>"; return $code; }
public function textarea($fieldName, $options = array()) { $optionsDefault = array('class' => 'form-control'); $options = array_merge_recursive($optionsDefault, $options); return parent::textarea($fieldName, $options); }
public function testTextarea() { $this->assertEqual(FormHelper::textarea('name', 'value', array('class' => 'myClass')), '<textarea name="name" class="myClass" id="name">value</textarea>'); $this->assertEqual(FormHelper::textarea('name', $this->Model, array('class' => 'myClass')), '<textarea name="name" class="myClass" id="name">obj</textarea>'); }
public function testTextarea() { $html = $this->object->textarea('element', 'inner text', array('arbitrary' => 'arbitrary', 'class' => 'test-class')); $this->assertAttributes($html, array('class' => array('test-class', 'ccm-input-textarea'), 'arbitrary' => 'arbitrary')); }
<div class="row"> <div class="col-md-6"> <?php FormHelper::input('valor', 'Valor', $r['valor'], array()); ?> </div> <div class="col-md-6"> <?php FormHelper::input('custo', 'Custo', $r['custo'], array()); ?> </div> </div> <input type='hidden' value='0' id="finalizar" name='finalizar'/> <?php if ($ident && $r['finalizado'] == "0" || !$ident) { FormHelper::textarea('observacao', 'Observação', '', array()); } $obs = array(); if ($ident) { $obs = "select \n observacao,\n datetime,\n (select name from user where o.user_id = id) as usuario\n from suporte_observacao o where suporte_id = " . $ident . " order by datetime desc"; $obs = $db->query($obs); } FormHelper::submitAjax('Salvar', 'salvar', array('class' => 'button', 'style' => 'margin:5px')); if ($ident && $r['finalizado'] == "0") { ?> <button type="button" class ='button' style='margin:5px 15px 5px 5px;float:right' onclick="finalizaSuporte_Sender(event,1)">Finalizar</button> <?php
<?php FormHelper::input('cidade', "Cidade", $cidade, array('placeholder' => 'Digite a cidade')); ?> </div> <div class="col-md-5"> <?php FormHelper::input('estado', "Estado", $cidade, array('placeholder' => 'UF')); ?> </div> </div> <div class="row"> <div class="col-md-12"> <?php FormHelper::textarea('complemento', "Complemento"); ?> </div> <?php FormHelper::textarea('referencia', "Referência / observação"); ?> </div><?php FormHelper::end(false); ?> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button> <button type="button" class="btn btn-primary" onclick="App.Endereco.Salvar()">Salvar</button> </div> <script type="text/javascript"> $("#formEndereco")[0].reset(); </script>
/** * Creates a textarea widget. * * ### Options: * * - `escape` - Whether or not the contents of the textarea should be escaped. Defaults to true. * * @param string $fieldName Name of a field, in the form "Modelname.fieldname" * @param array $options Array of HTML attributes, and special options above. * @return string A generated HTML text input element * @access public * @link http://book.cakephp.org/view/1433/textarea */ public function textarea($fieldName, $options = array()) { $options = $this->_addPlaceholder($fieldName, $options); return parent::textarea($fieldName, $options); }
public function textarea($fieldName, $options = array(), $tinyoptions = array()) { $this->_build($fieldName, $tinyoptions); return parent::textarea($fieldName, $options); }
public function render() { echo FormHelper::textarea($this->getAlias(), $this->getValue(), \ArrayHelper::merge(array('class' => 'TextboxField', 'id' => 'field_' . $this->getAlias()), $this->getHtmlOptions())); }
/** * Creates a textarea widget. * * ### Options: * * - `escape` - Whether or not the contents of the textarea should be escaped. Defaults to true. * * @param string $fieldName Name of a field, in the form "Modelname.fieldname" * @param array $options Array of HTML attributes, and special options above. * @return string A generated HTML text input element * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::textarea */ public function textarea($fieldName, $options = array()) { $options['normalize'] = false; return parent::textarea($fieldName, $options); }