0
Link1: http://docs.joomla.org/J2.5:Developing_a_MVC_Component/Adding_backend_actions#Adding_an_editing_view


Link2 :http://docs.joomla.org/J2.5:Developing_a_MVC_Component/Adding_a_view_to_the_site_part#Setting_the_view

In the above two links Link1 view is calling edit.php to display the view and in LinK2 is using default.php to display the view.

Now my question is that which thing is forcing these two views to use different files i.e. default.php and edit.php, though structure of these two views is almost same

arslan
  • 565
  • 1
  • 7
  • 25

1 Answers1

3

In Joomla component you can set different layouts for your component.

here two different layout is used default and edit so you can set layout by using

index.php?option=com_helloworld&layout=edit

Also you can set the layouts from your view.html.php

$this->setLayout("layout name");

hope its helps..

Jobin
  • 8,238
  • 1
  • 33
  • 52
  • 1
    As Jobin Jose mentioned it's layout variable which causes to use different file. If no layout variable is set - joomla looks for default.php. – di3sel Sep 26 '13 at 08:07
  • ok but i am still confused. if view.html.php wants to use specific layout(e.g edit.php) then it should be specified in view.html.php not in edit.php. In Link1 no layout is set so it should call default.php but article says it will use edit.php. – arslan Sep 26 '13 at 08:13
  • @arslan Its mentioning that view.html.php is using layout to display data, In any way you can set the layout by url or setlayout options . In the documentation also have default layout – Jobin Sep 26 '13 at 08:40