Wrox Programmer Forums
BOOK: Building PHP Applications with Symfony, CakePHP, and Zend Framework
This is the forum to discuss the Wrox book Building PHP Applications with Symfony, CakePHP, and Zend Framework by Bartosz Porebski, Karol Przystalski, Leszek Nowak; ISBN: 978-0-470-88734-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Building PHP Applications with Symfony, CakePHP, and Zend Framework section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 10th, 2011, 06:08 PM
Registered User
Join Date: Apr 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default More Chapter 4 problems

I have a new problem with the CakePHP project in Chapter 4. Configured routes.php as you said but using the url http://localhost/cake/the-book didn't work. I could get the index page by using the url http://localhost/cake/index.php/the-book. However then when I click the link to get to the add page I get in my browser http://localhost/cake/index.php/addresses/add.

If I add the following additional line to routes.php: Router::connect('the-book/:action',array('controller'=>'addresses')
my result is http://localhost/cake/index.php/the-book/add.

This would be great except when I submit the form on the add page it goes to:

If I use the original routes.php submitting the form gives me:

Neither of these gets the form values processed.

Since the form action appears to be generated by the framework, I am stuck as to how to fix this. Have i missed a step somewhere?

There are some problems with the Zend Framework part of Chapter 4:

In the book you refer to the models as AddressBook and AddressBookMapper while in the source code they are Addresses and AddressesMapper.

In the sql for setting up the table you use fields first_name, last_name but in the models you use firstName and lastName. This results in an error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'firstName' in 'field list

Changing the column names in the table to firstName and lastName will fix this.

The AddressEdit form after extending the Address form needs to have two hidden elements: id and created.

Without id it creates a NEW entry, and without created it loses the created time and sets it to 0;

As of yet I haven't got the Cake thing to work properly. I was able to fix the Zend Framework example as I am familiar with the Zend Framework.

By the way, I do appreciate this book, as it exposes me to the two other frameworks which I hadn't tried up to now.



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with chapter 1 macuser BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 2 April 2nd, 2009 12:39 PM
Problems with Example in Chapter 6 elly BOOK: Professional Crystal Reports for VS.NET 0 March 31st, 2008 03:39 PM
Chapter 6 problems slannesh7 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 August 15th, 2007 12:52 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.