Cruise Holidays Website
The site is for a cruise company that has 2 ships and offers about 125 cruises per year around the Mediterranean and across the Atlantic. Passenger capacities are up to about 1900 per cruise. In addition to allowing users to search for and book cruises online, the site also offers flights from about 20 UK airports, and stays in about 20 hotels in Majorca. There are also loads more features that complement the core functionality. Take a look around the site to see what I mean.
http://www.islandcruises.com/
Data in most of the 106 tables is managed through simple CRUD actions and views, and others by more complex interactions, in a powerful CMS whose permissions can be locked down by controller action and user group. The sales side is backed up with information pages in the front end, added by a powerful JavaScript-enabled, full-featured content management system that copes with multiple layouts and various module types, including data driven "functional" and WYSIWYG text modules.
I was lead programmer on the project and all my experience prior to it has been in writing procedural code, not OO and not MVC, however, after spending a few days looking through the manual and checking out the wiki, we decided to give CakePHP a try. Although, at the beginning, this seemed like a really bad idea as progress was slow and heads were literally being banged against a brick wall, as our experience grew, we began to like Cake more and more. Especially after discovering unbindModel() - in a site where practically every table has created_by and modified_by user id fields that belongsTo the User.id, and where some findAll queries need effectively 7 levels of recursion, this handy little method is invaluable. One die(pr()); call resulted in 80 Mb of data before we added unbindModel() calls!
We also found the contributions from the community on the wiki/bakery and in the snippets, an incredibly valuable resource and in fact made use of articles and code from othAuth, Pagination, Improved Advance Validation with Parameters, Sending Email With PHPMailer.
Although I would not recommend you do this, in my naivety when baking controllers, models and views for the CMS CRUD functionality, I realised I could hack around in bake.php and tailor the resulting baked files to our specific requirements. I needed about 50 models, controllers and index/add/edit screens. This saved enormous amounts of time. We baked almost our entire CMS in half a day! When I say I don't recommend you do this... I mean don't hack bake.php, maybe try and extend it, or write your own based on it. It should make upgrading a lot easier.
Something else we did was to extract functionality (such as enabling, disabling and logically deleting records, which we indicated by a tinyint status field with values of 1,2 or 3), required on multiple models and controllers to the respective app_ files.
In summary, if someone with no OO/MVC experience can pick up a framework and create a site as large and complex as this one within a couple of months, that framework must be pretty damn good, so a big thanks go to the Cake team, and a big thanks goes to the baking community who contribute to the wiki/bakery. I expect our next big application will be developed twice as rapidly!
Data in most of the 106 tables is managed through simple CRUD actions and views, and others by more complex interactions, in a powerful CMS whose permissions can be locked down by controller action and user group. The sales side is backed up with information pages in the front end, added by a powerful JavaScript-enabled, full-featured content management system that copes with multiple layouts and various module types, including data driven "functional" and WYSIWYG text modules.
I was lead programmer on the project and all my experience prior to it has been in writing procedural code, not OO and not MVC, however, after spending a few days looking through the manual and checking out the wiki, we decided to give CakePHP a try. Although, at the beginning, this seemed like a really bad idea as progress was slow and heads were literally being banged against a brick wall, as our experience grew, we began to like Cake more and more. Especially after discovering unbindModel() - in a site where practically every table has created_by and modified_by user id fields that belongsTo the User.id, and where some findAll queries need effectively 7 levels of recursion, this handy little method is invaluable. One die(pr()); call resulted in 80 Mb of data before we added unbindModel() calls!
We also found the contributions from the community on the wiki/bakery and in the snippets, an incredibly valuable resource and in fact made use of articles and code from othAuth, Pagination, Improved Advance Validation with Parameters, Sending Email With PHPMailer.
Although I would not recommend you do this, in my naivety when baking controllers, models and views for the CMS CRUD functionality, I realised I could hack around in bake.php and tailor the resulting baked files to our specific requirements. I needed about 50 models, controllers and index/add/edit screens. This saved enormous amounts of time. We baked almost our entire CMS in half a day! When I say I don't recommend you do this... I mean don't hack bake.php, maybe try and extend it, or write your own based on it. It should make upgrading a lot easier.
Something else we did was to extract functionality (such as enabling, disabling and logically deleting records, which we indicated by a tinyint status field with values of 1,2 or 3), required on multiple models and controllers to the respective app_ files.
In summary, if someone with no OO/MVC experience can pick up a framework and create a site as large and complex as this one within a couple of months, that framework must be pretty damn good, so a big thanks go to the Cake team, and a big thanks goes to the baking community who contribute to the wiki/bakery. I expect our next big application will be developed twice as rapidly!
Comments
Comment
1 Great site
Question
2 Code samples
Comment
3 Re 2 Code sample
Comment
4 Great Great Job
Neilc, it seems you have multple dynamc conents on different blocks in the same view, what have used.
Can you give me a hint on how I can have a controller that does not use any model Thankx
Comment
5 CMS
Great site.
I was very interested in your CMS system that you built.
Can you describe it a little more on what you exactly created?
I am designing a site for a client currently and I am afraid that they will not get along well with the cake php folder layout system. I was thinking of adding some sort of CMS system so they can edit pages, layouts and views on the fly.
Were you able to do this with your CMS system?
Also I am looking for an ajax version of WYSIWYG editor so our users can enter formatted data into our database so when we output it to our site it is still formatted correctly just as they put it in.
I was thinking of a php process that can translate the WYSIWYG formatting into html tags. Is that a correct approach?
Thanks!
Question
6 please share some of your knowledge
I can understand this, but have some specific questions, which you may help with?
Can you tell me how you have managed the data & menu creation? and how did you manage the user & group access?
Could you possibly do some simple tutorials on this?
Comment
7 Knowledge shared
Sorry for not replying to your comments sooner, just got an email about a new one so came along here to check it out and saw there were a few more that I have not replied to. I doubt my responses to those will still be of interest but I'll include them anyway.
@Chris - The CMS allows the client to perform CRUD actions on all the data elements of the application like cruises, ships, cabins, ports of call, shore excursions, flights, hotels etc etc, all the prices on each date for all the different holiday components and passenger types, and also the ability to create and edit pages with different grids and module types using drag 'n' drop, inplace rich text editors, other widgets.
@Joseph - Try to adhere to the convention of fat models and skinny controllers, so if you need a controller action and view that actually gets data from several different tables/models, include those models in the controller's $uses array property, or load the models dynamically and call a function in the relevant model for the data you want. This will give you "multple dynamc conents on different blocks in the same view" (at least I think thats what you mean). For a "controller that does not use any model", if this functionality will be used in several controllers, make it a component, else consider using a model, but with $useTable = false. There's lots of other stuff it does as well, like uploading files and images and managing system configuration settings too. I'm not sure why your client would not get along with the directory structure, can you elaborate if this is still a problem? I think there are articles on the bakery about using FCKEditor and TinyMCE, and one describes using AJAX I think. The way these WYSIWYG editors work is they actually post the HTML code for the content you've added in the editor for you, so you don't need to convert anything.
@Jim - Menu creation on the site is based on records set up in a pages table in the CMS. These have an order and parent_id field to make it hierarchical. Then you can build the menu using a recursive function, or checkout findAllThreaded. Suggest you cache the menu so you don't need to build on every page hit. I'm not sure what you mean by data creation? User and group access uses othAuth as mentioned in the case study. If you are starting a new project, I recommend using 1.2, and the Auth component with ACL however.