I have a component and have a form in it. And I want to render the same form in a module.
An example can be core Joomla article edit form components/com_content/views/form/tmpl/edit.php which is rendered based on components/com_content/models/forms/article.xml
As far as I can see it's not possible to load a component view in the module in this case. Am I right?
I see is to use an AJAX to get my form from my component loaded like ?option=com_mycomponent&view=myform&tmpl=component and to inject the from HTML into my main page DOM. An ugly way. So I'd not like to use this way. Am I right?
So I want to be DRY in the module.
I don't want to repeat view part (for example load XML form and bind data to it). How to stay DRY in the module with the view part?
Don't repeat the template part rendering HTML (/views/form/tmpl/edit.php) Here the things are simpler. I can use JLayouts instead of the tmpl/default.php approach in my component. So I can reuse the layouts anywhere (in a module, a plugin).
What I beg for
Please, tell me how to behave in the most proper way in this case. Or give me a component->module or a component->template example which implements such an approach. So I can investigate the code.
P.S. I wonder why mod_login uses own form template instead of reusing the same component view. That would be a nice example for guys like me.