Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 Yii 框架的新手,无法从表单中检索数据。在我的控制器中,我写道:
$request = Yii::app()->request; $form = $request->getPost('createProjectForm'); var_dump($form);
每当我提交时,表单都是空的。但是,如果我使用 var_dump($_POST),我仍然会得到这些值。谁能告诉我出了什么问题?非常感谢你,对不起我的英语不好。
这是 getPost 函数,它返回 $_POST 数组
public function getPost($name,$defaultValue=null) { return isset($_POST[$name]) ? $_POST[$name] : $defaultValue; }
你能告诉你这个代码在你的行动中的结果是什么吗
var_dump(isset($_POST['CreateProjectForm']));