How to add a textfield in form with out model class in YII?(如何在 YII 中没有模型类的情况下在表单中添加文本字段?)
问题描述
我需要在 YII 形式中添加一个文本字段,其中我没有指定任何模型类名称.但我需要在控制器类中的 action 方法中处理该值.
即
我需要添加一个文本字段
<input type="text" name="test" id="test" >我将文本字段添加为
<?php echo $form->textField($model['groupModel'],'group_name',array('size'=>60,'maxlength'=>128));?>但我不想在新文本字段中指定任何型号名称..提前致谢...
你可以添加一个 Chtml 文本字段 带有 id
它将显示在:$_POST['mytextField']
I need to add a text field in YII form in which i am not specify any model class name. But I need to process that value in the action method inside the controller class.
ie
I need to add a text field as
<div class="row">
<input type="text" name="test" id="test" >
</div>
I add text field as
<?php echo $form->textField($model['groupModel'],'group_name',array('size'=>60,'maxlength'=>128)); ?>
But i do't want to specify any model name with the new text field.. Thanks in advance...
You can add a Chtml textfield with an id
It will the show in the: $_POST['mytextField']
这篇关于如何在 YII 中没有模型类的情况下在表单中添加文本字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 YII 中没有模型类的情况下在表单中添加文本字段?
基础教程推荐
- 使用 scandir() 在目录中查找文件夹 (PHP) 2022-01-01
- 如何在数学上评估像“2-1"这样的字符串?产生“1"? 2022-01-01
- Web 服务器如何处理请求? 2021-01-01
- PHPUnit 的 Selenium 2 文档到底在哪里? 2022-01-01
- Yii2 - 在运行时设置邮件传输参数 2022-01-01
- 主题化 Drupal 7 的 Ubercart “/cart"页 2021-01-01
- php中的foreach复选框POST 2021-01-01
- php 7.4 在写入变量中的 Twig 问题 2022-01-01
- php中的PDF导出 2022-01-01
- 将变量从树枝传递给 js 2022-01-01
