Joomla 3.2.x - Loading component creator form in another component

241 views Asked by At

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

There are 1 answers

2
Goku On

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