1

I am new to Craft CMS, now I run a demo site of Happy Lager, wanna add a web crawler to fetch some data to my db. I should develop a plugin to complete this feature, but if I need to change the craft/app folder? or how my services in plugin called by my site? call from the craft/app? please help me,thank you!

6

Short answer... no!!! You don't ever want to make changes to the craft/app folder. Any changes you make in the app folder will be overwritten when you update Craft.

If you need any custom behavior, the correct way to do it is to write a custom plugin. Your plugin will be safe outside of the Craft core, and will survive any Craft updates intact.

Read up on the complete documentation for creating a Craft plugin. You can also download the Business Logic template to see what some basic components look like. Or even better, spin up a custom plugin using the fantastic Plugin Factory!

| improve this answer | |
  • 1
    Some good stuff here. Never saw the Plugin Factory link, seems useful! I personally use the Business Logic template quite a bit. I'd also recommend Mijingo's course on Craft Development. It's somewhat basic but lays a good foundation, something I found the official Craft docs were missing a bit if you're not used to an OOP framework like Yii or Laravel before. – RitterKnight Feb 21 '16 at 4:10
  • thanks for your answers!!! before ask this question I had installed some plugin to my demo site to see how it works, the plugin contains Controllers folder,Services folder, Models folder etc.,but most confused me is where to use or call these services,in my own plugin or anywhere else? – hengyi cai Feb 21 '16 at 4:46
  • 1
    @hengyicai Considering your original question has been answered, it's probably best that you create new threads for any further questions you may have on plugin development. I'd recommend that you look at the resources Lindsey and RitterKnight linked to first, though – those should be very helpful in getting a grip on all the basic concepts. Good luck! – Mats Mikkel Rummelhoff Feb 22 '16 at 15:08
  • 1
    Hey @hengyicai, welcome to the Craft CMS Stack Exchange site! Please consider accepting Lindsey's answer if it helped you. – Matt Stein May 9 '17 at 22:21

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.