dps69208 2014-11-19 03:00
浏览 85

Joomla 3.2.x - 在另一个组件中加载组件创建者表单

So I use the component creator a fair amount. I'm wondering, how can I load the form from one component in another component?

For example, I'm in the view for satscoreform where I have a form that has inputs created with

$this->form->getInput('score');

Now, I'm in another component and I want to grab this entire form:

<form action blah blah blah>
  <input type="hidden" name="jform[id] value="<?php echo $this->item->id?> ?> " />
  $this->form->getLabel('score');
  $this->form->getInput('score');

  // Token, Submit btn, etc here
</form>

...and put it on another page.

How can I grab the form, language, etc, and load it on another page? Thank you friends.

  • 写回答

1条回答 默认 最新

  • duanlong4890 2015-06-03 04:32
    关注

    Since the form gets instantiated first by the Model then pass to the view you can try instantiating the Model from the component that has the form and pass that to your view something similar to this answer by Dmitry Rekun

    评论

报告相同问题?