Git Product home page Git Product logo

craft-businesslogic's Introduction

Want to learn how modules work? Check out the complete documentation...


Business Logic module template for Craft CMS

It's a module about nothing...

Uhh... what?

When building a Craft website for your clients, you may find that you occasionally need to write some quick PHP to solve a problem. The good news... Craft lets you write any PHP you want via a custom plugin or module! The bad news... Putting together a module just to write some simple business logic can be kind of a pain, and the effort often feels like overkill.

What do you mean by "business logic"?

The term business logic is common in the software world... It basically means, "any processing logic which is unique to this specific company".

It's a boring topic, so I'll let Wikipedia explain it...

So really, what does this module do?

It does whatever you want it to do. It's a very simple template, designed to give you the basic tools you need to create a quick PHP-based interaction with the rest of your website. What you write inside this module is entirely up to you, and we expect that every website will have its own unique implementation. Go nuts!

What's included?

Variables

If you just need to pull some data into your template, or want to run a quick process before handing an array (or string, or whatever) back to your template, then variables might be the way to go! More about Variables...

Controllers

You might need a submitted form to do something special, or have an AJAX call with some simple back-end logic to sort out. Putting that stuff into a controller will let you work your magic behind the scenes. More about Controllers...

Services

No serious module is complete without a services layer. When things start to get a little crazy with your business logic, try moving large chunks of it to the services file. And if you decide that you need to create any records (or interact with the database at all), then you'll definitely want to put that logic into the services file! More about Services...

What isn't included?

Field Types, Records, Models, Element Types... Basically anything that seems unnecessary for the vast majority of business logic needs. If you're capable of determining that your business logic requires something as complex as an Element Type, we figure that you're smart enough to know how to build it from scratch.


How to Install

For complete installation instructions, check out the docs...


Fork Me!

Think this template can be improved? Go ahead and fork it! Pull requests are welcome, just keep a few simple goals in mind...

  • This module is designed to be ultra simple!
  • Only the basic needs of business logic need to be met... If a developer requires something more complex, it's assumed that they are capable enough to add those features.
  • Documentation is important! The components of this plugin should explain what they do, so any Craft noob can figure out how to shove some quick PHP in there and be on their merry way.

Thanks for checking it out! And feel free to also grab our favorite plugin of all time...

craft-businesslogic's People

Contributors

alexmglover avatar iamkeir avatar lindseydiloreto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.