CodeIgniter Forums

Full Version: Building modules help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]boony[/eluser]
Hi Guys,

I've started working on a project that requires a basic CMS to manage minimal content change. But there is also the need for user input to upload very specific data which can then be dynamically displayed via tables, graphs and or maps online. (Oh Yeah??? I hear the general groan). I went with PyroCMS as my basic CMS and have sort of started trying to build a specific module to provide the graphical output requirement.

As a result I'm trying to get my head around building the module. My most pressing problem is getting a grip on the way the different controllers and models are called and the various paths. I understand that these are developed using Matchbox Library so wonder if anyone has any advice or knows of some documentation or tutorial that can help me better understand building modules for CI using Matchbox.

El Forum

[eluser]Phil Sturgeon[/eluser]
I would take a look at the Matchbox Wiki first. v0.98 of Matchbox was released a few days ago and PyroCMS is still running the previous version, so some of the documentation may not match. Zack says its backwards compatible so it should be alright.

After that, I have made a VERY rough guide for creating a PyroCMS module on my personal blog.

El Forum

[eluser]boony[/eluser]
Thanks Phil,

Have already read these Smile But was looking for more detailed help. Where I'm struggling is the difference between the views in themes and modules. I'm having trouble working out how to get the data from my module into the theme pages/templates. I've tried getting the flow from the other bundled modules but a lack of comments (and basic incompetence on my part) makes this difficult.

Hey Ho ever onward...

El Forum

[eluser]Phil Sturgeon[/eluser]
Data from module to theem pages / templates? I guess you dont mean normal views here but the themes folder?

All data in the PyroCMS universe that goes towards view files of any sort (themes, layout files, module views, etc) all passes through $this->data. $this->data starts off in MY_Controller and goes through Admin_Controller/Public_Controller, then goes through the module which passes it to the Layout library.

The Layout lib makes a few more changes to it then outputs it to the usual $this->load->view().

I realize the non-existent documentation and lack of tutorials make it tricky. I plan to make a series of screencasts covering user flow and simple development when it gets to v1.0, right now its too subject to change.