From 6cf4bef9caabdd49cfb25da50a1df698b510e8c6 Mon Sep 17 00:00:00 2001 From: Matt Thomas Date: Thu, 19 Dec 2013 12:00:58 -0500 Subject: [PATCH 1/2] Completion of second step from http://docs.joomla.org/J2.5:Developing_a_MVC_Component/Adding_a_view_to_the_site_part - Implements use of JControllerLegacy and JViewLegacy --- helloworld.xml | 2 ++ site/controller.php | 13 +++++++++++++ site/helloworld.php | 17 ++++++++++++++++- site/views/helloworld/index.html | 1 + site/views/helloworld/tmpl/default.php | 5 +++++ site/views/helloworld/tmpl/index.html | 1 + site/views/helloworld/view.html.php | 22 ++++++++++++++++++++++ site/views/index.html | 1 + 8 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 site/controller.php create mode 100644 site/views/helloworld/index.html create mode 100644 site/views/helloworld/tmpl/default.php create mode 100644 site/views/helloworld/tmpl/index.html create mode 100644 site/views/helloworld/view.html.php create mode 100644 site/views/index.html diff --git a/helloworld.xml b/helloworld.xml index 2aeeba0..c9a2e5e 100644 --- a/helloworld.xml +++ b/helloworld.xml @@ -29,6 +29,8 @@ index.html helloworld.php + controller.php + views diff --git a/site/controller.php b/site/controller.php new file mode 100644 index 0000000..64bef6d --- /dev/null +++ b/site/controller.php @@ -0,0 +1,13 @@ +input; +$controller->execute($input->getCmd('task')); + +// Redirect if set by the controller +$controller->redirect(); \ No newline at end of file diff --git a/site/views/helloworld/index.html b/site/views/helloworld/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/site/views/helloworld/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/views/helloworld/tmpl/default.php b/site/views/helloworld/tmpl/default.php new file mode 100644 index 0000000..3e79da9 --- /dev/null +++ b/site/views/helloworld/tmpl/default.php @@ -0,0 +1,5 @@ + +

msg; ?>

\ No newline at end of file diff --git a/site/views/helloworld/tmpl/index.html b/site/views/helloworld/tmpl/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/site/views/helloworld/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/views/helloworld/view.html.php b/site/views/helloworld/view.html.php new file mode 100644 index 0000000..fe7753a --- /dev/null +++ b/site/views/helloworld/view.html.php @@ -0,0 +1,22 @@ +msg = 'Hello World'; + + // Display the view + parent::display($tpl); + } +} \ No newline at end of file diff --git a/site/views/index.html b/site/views/index.html new file mode 100644 index 0000000..fa6d84e --- /dev/null +++ b/site/views/index.html @@ -0,0 +1 @@ + \ No newline at end of file From 0aa208bb65cf6606c2baf882b2517fe6661b9fac Mon Sep 17 00:00:00 2001 From: Matt Thomas Date: Thu, 19 Dec 2013 12:13:31 -0500 Subject: [PATCH 2/2] Completion of third step from http://docs.joomla.org/J2.5:Developing_a_MVC_Component/Adding_a_menu_type_to_the_site_part --- helloworld.xml | 3 +-- site/views/helloworld/tmpl/default.xml | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 site/views/helloworld/tmpl/default.xml diff --git a/helloworld.xml b/helloworld.xml index c9a2e5e..c40417d 100644 --- a/helloworld.xml +++ b/helloworld.xml @@ -1,4 +1,3 @@ - @@ -12,7 +11,7 @@ Copyright Info License Info - 0.0.1 + 0.0.3 Description of the Hello World component ... diff --git a/site/views/helloworld/tmpl/default.xml b/site/views/helloworld/tmpl/default.xml new file mode 100644 index 0000000..4f15edd --- /dev/null +++ b/site/views/helloworld/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file