Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 10th, 2011, 07: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:
http://localhost/cake/index.php/the-book/the-book/add.

If I use the original routes.php submitting the form gives me:
http://localhost/cake/index.php/addresses/addresses/add.

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.

Joe

Joe
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 01:39 PM
Problems with Example in Chapter 6 elly BOOK: Professional Crystal Reports for VS.NET 0 March 31st, 2008 04:39 PM
Chapter 6 problems slannesh7 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 August 15th, 2007 01:52 PM



All times are GMT -4. The time now is 03:12 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.