Example of how to build an MVC application

466 views
Skip to first unread message

Stefan Neculai

unread,
Oct 23, 2012, 5:27:42 AM10/23/12
to joomla-de...@googlegroups.com
Hello,

Is there any example of how to build an MVC application using Joomla! Framework?


--
Thanks,
Stefan Neculai

Marius van Rijnsoever

unread,
Oct 23, 2012, 5:30:27 AM10/23/12
to joomla-de...@googlegroups.com

Stefan Neculai

unread,
Oct 23, 2012, 5:37:07 AM10/23/12
to joomla-de...@googlegroups.com
Ignoring what  Marius van Rijnsoever said has anyone an example of how to build an MVC app? I am looking for an MVC app itself rather then how to build a component in the CMS.

--
Thanks again,
Stefan

Marius van Rijnsoever

unread,
Oct 23, 2012, 5:43:36 AM10/23/12
to joomla-de...@googlegroups.com
Easy took me two seconds to modify the search:

http://lmgtfy.com/?q="mcv+application"+joomla+example

top hit give a detailed tutorial:

http://tutpages.com/?option=com_content&view=article&id=10%3Ahow-do-i-localise-joomla-to-my-language&catid=32%3Alanguages&Itemid=47&paged=6

On Tue, Oct 23, 2012 at 5:37 PM, Stefan Neculai

Stefan Neculai

unread,
Oct 23, 2012, 5:58:49 AM10/23/12
to joomla-de...@googlegroups.com
Thanks Marius but you are totally unuseful. 

--
Stefan

Marius van Rijnsoever

unread,
Oct 23, 2012, 6:10:42 AM10/23/12
to joomla-de...@googlegroups.com
yes that last answer was useless indeed, but to give me credit i did
one handed while putting the kids in bath. One more attempt:

https://www.google.com.au/search?q=+howto+buildjoomla+framework+application

http://docs.joomla.org/How_to_create_a_stand-alone_application_using_the_Joomla!_Platform

google is your friend :) happy to help with more questions.....


On Tue, Oct 23, 2012 at 5:58 PM, Stefan Neculai

Stefan Neculai

unread,
Oct 23, 2012, 6:27:04 AM10/23/12
to joomla-de...@googlegroups.com
Well.. thank you for the 3rd time in a row. FYK the example from the last link is written by me. Now, could you please use your both hands to take care of the kids as you don't understand what I am looking for?

--
Stefan

Marius van Rijnsoever

unread,
Oct 23, 2012, 6:30:39 AM10/23/12
to joomla-de...@googlegroups.com

Excellent thanks for your hard work on these docs!!!!!

Obviously I can't get the full picture of what you want, so I will sign off now and leave it to the rest here ;)

Best wishes, marius

Ole Ottosen (ot2sen)

unread,
Oct 23, 2012, 6:56:45 AM10/23/12
to joomla-de...@googlegroups.com
Hi Stefan,
 
In the upcoming weekend Rouven is to do 2 sessions at our J!Day Denmark on that exact topic:
I guess that if we ask him nicely there would be a good chance that he will publish the workshop material for the community to use and learn from. :)
 
Just wait till he stops by and read this thread, then you will know.
 
Best regards,
 
Ole

Chad Windnagle

unread,
Oct 23, 2012, 9:20:34 AM10/23/12
to joomla-de...@googlegroups.com

Hi Stefan:

Check out tr jtracker project which is using the new MVC classes:



Small Logo
Chad Windnagle
s-go Consulting
607-330-2574 x103
607-229-6260 (Cell)
Website Design - SEO - Video

Follow Me: Facebook LinkedIn Twitter

Stefan Neculai

unread,
Oct 23, 2012, 10:59:53 AM10/23/12
to joomla-de...@googlegroups.com
Thanks Chad. Elin told me about Louis's terster (https://github.com/LouisLandry/pulltester) which is more appropriate to what I was looking for.

--
Stefan

Stefan Neculai

unread,
Oct 23, 2012, 11:05:25 AM10/23/12
to joomla-de...@googlegroups.com
Hey,

Thanks Ole. I would definitely look forward for such material from Rouven.

--
Stefan

Elin Waring

unread,
Oct 23, 2012, 2:37:18 PM10/23/12
to joomla-de...@googlegroups.com
Actually

Is better.

Elin

Andrew Eddie

unread,
Oct 25, 2012, 2:43:06 AM10/25/12
to joomla-de...@googlegroups.com
You've got a pretty good handle on the M & the C already. The only
changes I've made in my head lately is that I don't think model's need
to have "Model" in the class name anymore. For example,
JSolrModelQuery could just become JSolrQuery (extends JModelBase).
It's probably still worth putting "Controller" in the name of a
controller if there's nothing better to call it (the only reason the
tradition was established was to do all the crazy name parsing in 1.5
so you could infer the model and view names from the controller).

I've not really had the chance to play with views yet, but they should
really easy to implement. Wouldn't mind throwing some ideas and gists
around about how that can be approached from a ground-up Platform App
point of view. I like the idea of going to "theme" rather than
"template" (Louis is a big fan of this) as the container for layouts
and the media resources [that are exposed to the web server]. If you
wanted single theme apps, it would probably look something like:

/code
../theme
..../tmpl (or /layout)
..../theme.php
/www
../theme
..../css
..../js

Multi-theme is obviously not hard to imagine from there:

/code
../theme
..../axiom
....../tmpl (overrides)
..../tmpl (default layouts)
..../theme.php (default theme container)
/www
../theme
..../axiom
....../css
....../js

Just shooting from the hip really ...

You'd probably have an application view class that does things like
injecting a model, adding a magic __get method to get model methods,
etc.

Regards,
Andrew Eddie
http://learn.theartofjoomla.com - training videos for Joomla developers

Stefan Neculai

unread,
Oct 25, 2012, 10:46:22 AM10/25/12
to joomla-de...@googlegroups.com
Hi Andrew,

Thanks for the tips. I am planning to play with this a little over the weekend and came back with a gist for some feedback and suggestions.

--
Stefan

javier gómez

unread,
Oct 25, 2012, 10:58:08 AM10/25/12
to joomla-de...@googlegroups.com
Stefan,

We are all waiting for the results of your investigation with a lot of expectation. There is a lot of devs that would love to see an easy example of "How to build an app with the new MVC". It will be awesome if you can share a bit of documentation of your experience. If not possible, anyway we will be happy checking your code.

^_^

Thanks very much
--
Javi

Donald Gilbert

unread,
Oct 30, 2012, 11:31:43 AM10/30/12
to joomla-de...@googlegroups.com
Rouven posted this code from his Joomla Day 2012 this past weekend - https://github.com/realityking/jd12dk

It's a good walkthrough example of building a basic guestbook app on the Joomla Platform using the new MVC style.

Chad Windnagle

unread,
Oct 30, 2012, 11:41:02 AM10/30/12
to joomla-de...@googlegroups.com
That's great! Thanks Rouven!

-Chad

Regards,
Chad Windnagle
Fight SOPA

Mark Dexter

unread,
Oct 30, 2012, 11:49:06 AM10/30/12
to joomla-de...@googlegroups.com
Any chance someone could write this up in the docs Wiki? Mark

Ofer Cohen

unread,
Oct 30, 2012, 7:09:42 PM10/30/12
to joomla-de...@googlegroups.com
What about the HMVC? Is the new Joomla-Platform capable for this?

Thanks, Ofer

Andrew Eddie

unread,
Oct 30, 2012, 7:17:52 PM10/30/12
to joomla-de...@googlegroups.com
I've added the link to this page on the repo's wiki:

https://github.com/joomla/joomla-platform/wiki/Examples

Regards,
Andrew Eddie
http://learn.theartofjoomla.com - training videos for Joomla developers


Andrew Eddie

unread,
Oct 30, 2012, 7:18:26 PM10/30/12
to joomla-de...@googlegroups.com
HMVC is just a pattern - there's no reason why you can't implement it

Regards,
Andrew Eddie

David Hurley

unread,
Oct 30, 2012, 7:27:04 PM10/30/12
to joomla-de...@googlegroups.com
If you mean utilizing partial views HMVC, then I've implemented it. Not sure how amazing it is. :) I created another phtml.php (partial html) that implements the render() function. In a helper I instantiate the view and then return the view object. Once I have the view assigned to a variable I can simply $variable->render() from the location where I want to show the view.

-
Thanks,
David

Ofer Cohen

unread,
Oct 31, 2012, 6:32:29 PM10/31/12
to joomla-de...@googlegroups.com
Andrew, why we changed the JView to interface in 12.1??

Andrew Eddie

unread,
Oct 31, 2012, 8:12:53 PM10/31/12
to joomla-de...@googlegroups.com
Unfortunately that's a simple question with a very long answer. For
now, I'll just refer you to the pull request:

https://github.com/joomla/joomla-platform/pull/1120

Regards,
Andrew Eddie

Ofer Cohen

unread,
Nov 1, 2012, 7:45:47 AM11/1/12
to joomla-de...@googlegroups.com
Hey Andrew,

Thanks for your reply.
This link just increased my questions. I'll organize few basic questions and by your answers (or others) I'll documented into the wiki. This probably would help for others.

Thanks, Ofer

Elin Waring

unread,
Nov 2, 2012, 7:10:03 PM11/2/12
to joomla-de...@googlegroups.com
Part of the motivation of what Yannick did with the reusable  layouts in a well known platform application was to allow for hmvc.  I think we all know it needs some more development but I think also that it is possible that it gets pushed upstream eventually.



Elin

Stefan Neculai

unread,
Nov 15, 2012, 8:57:47 AM11/15/12
to joomla-de...@googlegroups.com
Hello,

I've been working lately on my version of MVC using Joomla! Platform (I will make some more updates in the next days). I am a fan on Ruby on Rails so most of it is following the structure of a RoR application, also I added there a router that works almost like the one from Rails (handling RESTful routes too).


I would appreciate any feedback if you have.

--
Stefan

Emerson da Rocha Luiz

unread,
Nov 15, 2012, 10:56:22 AM11/15/12
to joomla-de...@googlegroups.com
Nice Stefan! Good work! 

I personally like the idea of ​​testing more than one way of doing the same implementation, since not all projects one way is the best way.

--
Emerson Rocha Luiz
+55 51 9881-9146
 | Skype: fititnt | GTalk: fititnt | Twitter: @fititnt | http://www.fititnt.org
Membro do JUGRS
Reply all
Reply to author
Forward
0 new messages