5

If I were to create a Joomla social media component from scratch, say something similar to communitybuilder (used for interpals for example), would every page (profile, register, list of profiles) be a separate component?

I find all the components I see are built in such a complicated matter, so it's hard for me as a beginner to jump in on it. I figured I'd start creating one from scratch to experiment with user registration and database usage.

6

Not everything by default is a separate component. For example:

com_users:

This component consists of everything to do with a user such as:

  • Registration
  • Login
  • Logout
  • Profile

So if you are thinking of creating your own component, you only need 1. The component will then consist of different views. The exact same concept as com_users. Each bullet point mentioned above is a different view and has a controller and model to go with it.

| improve this answer | |
  • Glad this helped. Hopefully someone will elaborate on this and provide a better insight as components are not my strong point at all. – Lodder Nov 22 '14 at 12:57
  • @Lodder, if that's the case, I wish my strong points were as good as your weak points, lol. – GDP Nov 22 '14 at 17:08
  • 1
    @GDP - You would be surprised. I've never built a component, nor do I even fully understand how MVC works as I'm actually a frontend developer :) Anything I answer regarding components is done with a bit of research, quick test or just from the little I do know – Lodder Nov 22 '14 at 18:06
4

@Lodder has given the right answer, so this is only a suggestion from one who has been trying to learn the intricacies of a Joomla 3 component as well.

I've become a strong proponent of Component Creator - the free version allows you to build a fully functional component with one table and a view for the frontend and another for the backend. The generated code is very clean and consistent, and easy to follow for a beginner.

The paid version allows mulitple tables, as well as multiple views for each of those tables, so for a very small investment, you can have the basic code structure for your entire component generated in only a few hours.

| improve this answer | |
3

i would suggest you to follow Mr David Hurley's Lendr Component Build Component from scratch. Here you can find a very good way to manage your component's MVC easily with best practice. By writing your component's Routing file, you can show it like the way you want. The pattern of mvc in components is using one master controller and other sub-controller.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.