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 中没有模型类的情况下在表单中添加文本字段?
基础教程推荐
- phpmyadmin 错误“#1062 - 密钥 1 的重复条目‘1’" 2022-01-01
- 找不到类“AppHttpControllersDB",我也无法使用新模型 2022-01-01
- 在 yii2 中迁移时出现异常“找不到驱动程序" 2022-01-01
- Doctrine 2 - 在多对多关系中记录更改 2022-01-01
- PHP 守护进程/worker 环境 2022-01-01
- 如何在 Symfony 和 Doctrine 中实现多对多和一对多? 2022-01-01
- HTTP 与 FTP 上传 2021-01-01
- 使用 PDO 转义列名 2021-01-01
- 在 CakePHP 2.0 中使用 Html Helper 时未定义的变量 2021-01-01
- 如何在 XAMPP 上启用 mysqli? 2021-01-01