Digging deeper into learning

Permalink
I come from a coding background but haven't coded very much PHP - to tackle problems in Concrete 5 should I look to CodeIgnitor documentation for answers or is Concrete 5 just based on Codeignitor and has become it's own?

The reason I ask is that I keep coming across things that I need to do within the code and wonder if I should look up how it's done in CodeIgnitor if I can't find how it's done in Concrete 5?

INTcommunications
 
mkly replied on at Permalink Reply
mkly
Hello,
concrete5 does make use patterns found in MVC(Model View Controller) frameworks like CodeIgniter, but it isn't actually based on it. It does use some library from Zend Framework(1.x) but the general framework is unique to concrete5.

This talks some about pages and concrete5 flavored MVChttp://www.concrete5.org/documentation/developers/pages/mvc-approac...

If you are unfamiliar with web MVC type setups I'll give you a super quick run down.

Models are typically where you will get stuff from the database. The majority of your business logic will go there.

Controllers are were you pass Models into the View, and in concrete5 Controllers do more lifting than you may be used to in stricter MVC implementations, so often you'll see people sending emails formatting data etc in a Controller.

Views are hopefully logic free. Of course this is the ideal, but you want to aim for essentially just outputting values you have set from the view.

Beyond that there are tools files, which are kind of like anything goes files. They don't follow any of the MVC stuff and are closer to what you may be used to in traditional PHP procedural development. They are often used for AJAX requests.

Elements are for small bits of a View that you might need in other places. Some other frameworks call these Partials.

concrete5 has what are called Single Pages. These are Controller/View pairs that are probably the most similar to what you find in MVC. Basically they map to a path by the naming of the Controller class and the location in the controllers and single_pages directory.

Blocks often do not use Models if they have simple storage requirements and handle traditional Model stuff in their Controllers. There is some pretty good documentation around the site along with some videos. Blocks are a great way to get started with the concrete5 way of doing things.

Then there are Page Types. These can have Controllers, but sometimes are simple enough that they are just Views when all they do is output a couple areas inside some HTML Markup.

After you check out some block video tutorials, check out "c5 Boilerplate" in the marketplace(it's free don't worry). That's a great summary of common things we use in concrete5 and would definitely help to get you up and running. Also check out the videos here on concrete5.org

Best Wishes and Happy Hacking,
Mike
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
I don't think that it will be helpful for you if you look into Codeignitor to understand the coding of Concrete5. Rather you can have a look into how MVC works in google. You will get a basic idea of how it is coded. But the best option is to study C5 tutorials & documentations first to understand it. Also there are many how-to available by which you can get answers of your questions.

Rony
INTcommunications replied on at Permalink Reply
INTcommunications
Thanks for the input - ( both answers) to my question

The actual MVC framework as a concept is pretty straight forward. Is it best to put Javascript ( jquery)in the view or the controller? Little confused as to where in the folder structure to put everything - I guess it will all fall into place in my head eventually. I have looked at several themes and add-on etc. ( code ) and seems that not everyone puts things in the same places or attacks problems the same way. This is where the confusion and the learning curve comes in. Am I looking at old versions of code? When going through tutorials / forums etc. there are references to scrapbook and other features or links in the dashboard that are no longer there - maybe this forum the version # should be a selection for posts - so that future searchers can tell exactly which version they are reading about.
JohntheFish replied on at Permalink Reply
JohntheFish
That depends on whether it is specific to just a particular view/template for a block, or general to any template for a block.