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.
我有一个简单的表格:UserInfoForm()。当我第一次向用户显示表单时,我希望它填充来自User模型的特定对象的数据。谁能给我一个方向或一个例子?谢谢!
UserInfoForm()
User
通常,您会这样做,但这取决于您的 UserInfoForm 与 User 对象的关系:
$user = Doctrine::getTable('User')->findOneById($user_id); $this->form = new UserInfoForm($user);
编辑:我假设你正在使用 Doctrine。