Building a native Joomla 3.x component

For Joomla! 3.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Locked
User avatar
pishro
Joomla! Explorer
Joomla! Explorer
Posts: 285
Joined: Tue Oct 09, 2012 7:22 am

Building a native Joomla 3.x component

Post by pishro » Thu Aug 22, 2013 5:19 pm

I decided to see what the new Joomla! MVC brings. Because I am a learning by doing kind of guy I started building a native Joomla! 3.x component, I mean without using the legacy classes in a real world project, not just hello world stuff.

As learning material point I've used the Lendr tutorial and I've also inspected a bit the new Joomla! jissues code.

One of the things that I miss from the legacy classes is JModelList. So I basically stated copy - pasting methods from there to my component.

Now everything is so light and flexible, but basically to achive the same functionality as with the legacy classes, I actually have to write and maintain more code. One of the functionalityes that I "love" writing are basic CRUD functionality.

So my question is: are there any good examples on using the new MVC from Joomla?


biometrx
Joomla! Apprentice
Joomla! Apprentice
Posts: 48
Joined: Sat Dec 11, 2010 11:23 pm
Location: london
Contact:

Re: Building a native Joomla 3.x component

Post by biometrx » Sun Aug 25, 2013 10:24 am

Hi, saw ur post and felt the need to respond. I am a joomla developer and have been working with joomla since 2007. What i have always done with all feature releases is to yes, look at the new tutorials for the joomla version but always compare my extension with what was done on a native extension that always ships with joomla. And that is the com_weblinks component. If u do that, with an ideal ide, u'll never go wrong ;)

User avatar
pishro
Joomla! Explorer
Joomla! Explorer
Posts: 285
Joined: Tue Oct 09, 2012 7:22 am

Re: Building a native Joomla 3.x component

Post by pishro » Sun Aug 25, 2013 11:16 am

biometrx wrote:And that is the com_weblinks component. If u do that, with an ideal ide, u'll never go wrong ;)
Hi biometrx :p
Thank you for your attention and help.

bbolli
Joomla! Explorer
Joomla! Explorer
Posts: 455
Joined: Fri Nov 11, 2011 9:43 pm
Location: Chicago, IL

Re: Building a native Joomla 3.x component

Post by bbolli » Tue Aug 27, 2013 10:01 pm

I've found that reverse engineering core extensions is a great way to go. More often then not, I'm using two or three separate core components to piece together the functionality I want or need.

Good luck!

User avatar
Bakual
Joomla! Guru
Joomla! Guru
Posts: 845
Joined: Sun Dec 13, 2009 9:00 pm
Location: Switzerland
Contact:

Re: Building a native Joomla 3.x component

Post by Bakual » Wed Aug 28, 2013 11:21 am

Actually, the core extensions are not really "native 3.0" extensions. They all use the old legacy MVC and not the new one.
However I'm not sure if there really are plans to move to the new MVC or if this is already a dead project :)

The legacy stuff for sure will stay till the end of 3.5, and maybe for 4.0 we will see the use of the "new MVC".

User avatar
pishro
Joomla! Explorer
Joomla! Explorer
Posts: 285
Joined: Tue Oct 09, 2012 7:22 am

Re: Building a native Joomla 3.x component

Post by pishro » Thu Aug 29, 2013 12:03 pm

bbolli wrote:I've found that reverse engineering core extensions is a great way to go. More often then not, I'm using two or three separate core components to piece together the functionality I want or need.
Bakual wrote:Actually, the core extensions are not really "native 3.0" extensions. They all use the old legacy MVC and not the new one.
However I'm not sure if there really are plans to move to the new MVC or if this is already a dead project :)

The legacy stuff for sure will stay till the end of 3.5, and maybe for 4.0 we will see the use of the "new MVC".
Hi guys! ;)
Help me thank you
If you found this article, please introduce
Thank you.

teutates
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Sep 09, 2013 11:27 am

Re: Building a native Joomla 3.x component

Post by teutates » Tue Sep 10, 2013 10:43 am

Hey there,

I also used the Lendr-Tutorial for developing a new 3.1 component but it wasn't very helpfull for me. Can someone please tell me whether it makes sense to develop native components or not? Actually, I don't what to use all the legacy classes as for example JViewLegecy.

User avatar
Bakual
Joomla! Guru
Joomla! Guru
Posts: 845
Joined: Sun Dec 13, 2009 9:00 pm
Location: Switzerland
Contact:

Re: Building a native Joomla 3.x component

Post by Bakual » Tue Sep 10, 2013 11:49 am

The Lendr tutorial uses the new MVC but the core extensions all use the legacy one. Imho it doesn't make much sense to use the new one, but of course you can do. There is just not much examples yet.

teutates
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Sep 09, 2013 11:27 am

Re: Building a native Joomla 3.x component

Post by teutates » Tue Sep 10, 2013 11:58 am

Thanks for your reply. I already noticed that there aren't much examples. ;) Do you know other examples than lendr?

Assuming I develop my component with the legacy MVC - do I have any limitations?

User avatar
Bakual
Joomla! Guru
Joomla! Guru
Posts: 845
Joined: Sun Dec 13, 2009 9:00 pm
Location: Switzerland
Contact:

Re: Building a native Joomla 3.x component

Post by Bakual » Tue Sep 10, 2013 12:12 pm

I don't know any examples and I don't know any limitations.
The only thing which could happen is that for Joomla 4.0 the legacy ones are depreceated and removed with 5.0. So you would have to rewrite the extension for 5.0. But really, I don't see any moves currently to change the core extensions to the new MVC, so I guess it is dead already.

You are probably better off with using at FOF from Akeeba and building your extension using that as it will be included in Joomla 3.2.

chamath100
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sun Jun 03, 2012 12:08 pm

Re: Building a native Joomla 3.x component

Post by chamath100 » Wed Oct 23, 2013 6:13 am

Hi biometrx and All,

I'm referring your component - com_weblinks. I need a clarification on submenu section.

Code: Select all

<submenu>
			<!--
				Note that all & must be escaped to & for the file to be valid
				XML and be parsed by the installer
			-->
			<menu link="option=com_weblinks" view="links" img="class:weblinks"
				alt="Weblinks/Links">com_weblinks_links</menu>
			<menu link="option=com_categories&extension=com_weblinks"
				view="categories" img="class:weblinks-cat" alt="Weblinks/Categories">com_weblinks_categories</menu>
		</submenu> 
Can you please explain img and alt attribute in menu tag and its contents.

And also can you explain link in com_weblinks_categories (option=com_categories&extension=com_weblinks)? How it work? What is the purpose of extension parameter?

Thanks a lot.

User avatar
Bakual
Joomla! Guru
Joomla! Guru
Posts: 845
Joined: Sun Dec 13, 2009 9:00 pm
Location: Switzerland
Contact:

Re: Building a native Joomla 3.x component

Post by Bakual » Wed Oct 23, 2013 6:30 am

The img is used for the menu in the Hathor template and also in Joomla 2.5. It's not used in the new Isis template. You can either reference a CSS class here or specify a file.

The link to com_categories goes obviously outside of your component. The extension parameter is there so com_categories will know from where the request comes. It will then load your sidebar menu, includes your component name into its title and show the categories related to your component. Basically it will look like it is part of your component, when in fact all you provide is this link.

chamath100
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sun Jun 03, 2012 12:08 pm

Re: Building a native Joomla 3.x component

Post by chamath100 » Thu Oct 24, 2013 7:37 am

Thanks Bakual


Locked

Return to “Joomla! 3.x Coding”