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 中没有模型类的情况下在表单中添加文本字段?


- PHP - if 语句中的倒序 2021-01-01
- 覆盖 Magento 社区模块控制器的问题 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01
- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01
- PHP foreach() 与数组中的数组? 2022-01-01
- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01