framework cakephp

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
dme69
New Member
New Member
Posts: 7
Joined: Wed Dec 21, 2005 9:19 pm

framework cakephp

Post by dme69 »

Hello all,
I'm working with cakephp framework and i want to know if you know :) how to use a such framework to make modules for cmsms ?

Dominique
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm
Location: Finland

Re: framework cakephp

Post by tsw »

as cmsms is a framework itself and two frameworks wont usually mix well together I think this is close to impossible, please tell if you get it working
dingonv
New Member
New Member
Posts: 7
Joined: Thu Aug 04, 2005 6:11 pm

Re: framework cakephp

Post by dingonv »

While it may not be feasible to build modules using cake, and i don't think i would advise it anyway, it is more than possible to very easily use your cake output in your CMS-MS site.

custom usertags allow you to get the cake processing easily
include('http://yoursite/cake/controller/action/params')

call anything you want.
oh, you want to actually get the data that cake creates? well, CMS-MS just becomes your view in that case.

in your cake controller, instead of '$this->set'ting your variables
serialize the results and echo them at the end of the controller action and exit so no render is performed.
in cake controller, in whatever action:
$data = $this->Model->findAll();
echo serialize($data);
exit;

in your custom tag in CMS-MS use this php:
$data = file_get_contents('http://yoursite/cake/controller/action');
$data = unserialize($data):

bingo.

i prefer to set my layout to null in cake, and just echo the formatted results with cake's views and not worry about manipulating variables in CMS-MS.

Now, i am sure there is a way to create a helper of somesort, in cake, that uses CMS-MS features in depth, but i didn't think it worth the hassle.

i just setup the admin of my cake side to use the same auth tables as CMS-MS
savagekabbage
Forum Members
Forum Members
Posts: 75
Joined: Mon Apr 23, 2007 3:51 pm
Location: Northern Virginia, United States

Re: framework cakephp

Post by savagekabbage »

dingonv:

That is very interesting idea to use CMSMS as the "view" for CakePHP.  I had not thought of that before, and will definitely be trying this on some applications in the future.
cyberman

Re: framework cakephp

Post by cyberman »

savagekabbage wrote: and will definitely be trying this on some applications in the future.
Maybe you can tell us something about results  ;) ...
Post Reply

Return to “Developers Discussion”