goFrendiAsgard / No-CMS

No-CMS, A CodeIgniter Based CMS Framework
299 stars 199 forks source link

merge a grocery crud application into cms #43

Closed davidoster closed 11 years ago

davidoster commented 11 years ago

I have a grocery crud application with each own MySQL db. How can I merge this into NO-CMS?

Shall I make a module? What is exactly the procedure in order to successfully merge it?

goFrendiAsgard commented 11 years ago

Yes, you should make a module. It can simply done by make a directory in /modules/ (let's say you want to make gc_app, then it should be /modules/gc_app) Next you need to put all of your models, views and controllers in that directory. You will probably need some adjustment, especially on some external css and javascript link.

If you want your pages to be integrated with No-CMS itself, you will need to make a new navigation (Complete Menu | CMS Management | Navigation Management).Fill out the url (e.g: "gc_app/my_controller/my_function") and the navigation code (e.g: gc_app_my_page) And in your controller, do this:

$this->view('my_view', $data, 'my_page'); // my_page is corresponding navigation code

instead of

$this->load->view('my_view', $data);

That's all

davidoster commented 11 years ago

Thank you very much! It is very clear and simple. That's what I was thinking of. I suppose, since I will be using a different db for the gc app I will need to do something like this within my controller,

$this->load->database($my_config);

right?

goFrendiAsgard commented 11 years ago

exactly :)

davidoster commented 11 years ago

thank you!