9

I understand Craft Templating pretty well, but when it comes to programmation I am entirely lost, I don't get how it works. I used to use CodeIgniter a lot, which is a MVC as you guys may know. In CodeIgniter, everything goes through the controller, then in the controller, I call models. In models, I interact with database and then return the data to the controller and then display a view. In Craft, it doesn't seems to work like this. Is there any good tutorials for "programming" in Craft or develop a plugin? Like how controllers, models, services and events works? Or is there any good people willing to help me?

I want to use Craft so much, I just need to understand it before I use it at large for my client's projects.

I appreciate your help.

3
  • This seems to be a duplicate of this question. See if that doesn't help. If you have a more specific question, please ask — we'll be glad to help. Additionally, you might want to check out a plugin called BusinessLogic which provides a nice plugin template for getting started. Commented Dec 16, 2014 at 20:35
  • Hi, thanks for your answer. I did some reverse engineering on a plugin to see how things work. It seems that "models" in codeIgniter are "services" in Craft and "models" are used to validate data. I can accomplish what I need to do but it would be great if I could understand the basics.
    – JeePee
    Commented Dec 16, 2014 at 21:21
  • 1
    Check out the plugin development docs. They provide a pretty good overview of the different components. Commented Dec 16, 2014 at 21:42

4 Answers 4

10

We just published a video course on Craft plugin development that might help you. https://craftquest.io/courses/how-to-create-craft-plugin

4
  • 3
    Pay almost 50 bucks for the lack of documentation? That's ridiculous.
    – Stalinko
    Commented Feb 16, 2018 at 17:38
  • @Stalinko Why shouldn't they charge for their work? Confused. It's not like it's a video made by the developers of Craft Commented Oct 17, 2023 at 16:45
  • @ChuckLeButt if those guys aren't affiliated with Craft then I don't blame them. Rather I blame Craft makers in this case.
    – Stalinko
    Commented Oct 18, 2023 at 6:24
  • @Stalinko There has been documentation for plugin development dating back to when this question was asked, but it has improved dramatically since then. (It's been almost 10 years, so it better have!) craftcms.com/docs/4.x/extend Commented Dec 8, 2023 at 10:13
7

You can have https://pluginfactory.io generate the Craft CMS plugin framework for you.

If you're writing a plugin for Craft CMS 3, this may help you as well: So You Wanna Make a Craft 3 Plugin?

6

You can find the plugin development docs here

There is also the cocktail recipes plugin by Adrian Macneil inspired on the docs

Both will give you a pretty good understanding of how plugins, controllers, models, services, ... work

You can also find lots of free / open source plugins on straightupcraft.

2
  • I know this answer is a couple years old, so no disrespect... but at this point, the Cocktail Recipes plugin is extremely outdated, and shouldn't be used as a reference point for learning plugin development.
    – Lindsey D
    Commented Jun 24, 2016 at 22:11
  • @LindseyD Do you know if there is a Craft 3 plugin that would be good to start learning plugin development? I'm feeling pretty overwhelmed right now. Commented Aug 24, 2018 at 11:53
1

I wrote an article with introductory topics on building a Craft CMS 4 plugin and welcome any feedback.

Exploring GitHub repos for existing Craft plugins is also a great way to learn.

And finally, joining Craft's Discord has excellent discussion and support.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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