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.
我有一个表单,我想显示一个选择列表,用户可以在其中选择一个项目并保存。
我需要做的是将一个值传递给表单:
$form = new TestForm($id)
那么我如何$id在我的Testform班级中获得价值?
$id
Testform
以下似乎有效:
$id = $this->getOption('id');
和
TestForm(array(),array('id'=>$id))