0

I've had experience working with the osCommerce shopping cart and I like how they use "require" to just add different boxes to either the left or right side columns of the website.

require(DIR_WS_BOXES . 'shopping_cart.php');

I'm having a programmer create a new website for me and he is doing it in CakePHP. I asked him if he could use the same logic when creating boxes like osCommerce uses this way I can just "require" these boxes on different pages fairly easy.

He tells me that in frameworks like CakePHP it is not easy to work on the pages code like it is in smarty ones; I'm guessing by smarty is he is referring to osCommerce.

Is this true? With CakePHP will creating separate box php files and just requiring them on different pages like osCommerce not work?

Thank you!

olimits7
  • 555
  • 2
  • 9
  • 26

1 Answers1

1

It can be done by hacking around with views, or you may be able to do something with plugins, but the way that CakePHP is written (and the way you write with it) is significantly different to how you'd write something with osCommerce.

Cake uses something called MVC (http://www.phpro.org/tutorials/Model-View-Controller-MVC.html) which makes it easier to manage large applications, and easier to re-use code (and nicer to maintain, IMO) whereas osCommerce is all inline - it uses lots of include()s and define()s to make things work.

You'd probably be best taking his word on this one rather than trying to force him to hack something together which probably won't work quite how you want it to - move on to new ways of doing things, rather than trying to make new tech work in an old way.

Joe
  • 15,669
  • 4
  • 48
  • 83