Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Building PHP Applications with Symfony, CakePHP, and Zend Framework
|
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 4th, 2011, 12:09 AM
Registered User
 
Join Date: Apr 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default php programming using symfony, cake php and zend or something like that

The symfony Hello World example returns a not found with the url: http://localhost/symfony/hello but works just fine with http:// localhost/symfony/web. I have no idea if this is because I did something wrong or if this is an error in your book
 
Old April 6th, 2011, 03:43 AM
Registered User
 
Join Date: Apr 2011
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yes, I recreated this on a clean install of XAMPP on Win7 and this definitely is a bug, thanks for pointing this out. There are 2 ways to make it right:

The first and simplest one is to use the address http://localhost/symfony/web , as it is shown in the figures. I hope more readers will be able to spot it :)

The second one (and this is how “it should be done”) is to edit the httpd.conf in Apache configuration and add the following alias:
Code:
Alias /symfony "C:\xampp\htdocs\symfony\web"
    <Directory "C:\xampp\htdocs\symfony\web">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
    </Directory>
Then you can access the hello world module with http://localhost/symfony .
We made the code review on a server configured this way and that’s why the error somehow slipped our attention ;)
 
Old April 6th, 2011, 09:19 AM
Registered User
 
Join Date: Apr 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks.

I eventually figured it out before I got your answer but this may help somebody faced with the same problem.

Joe
 
Old April 7th, 2011, 09:12 PM
Registered User
 
Join Date: Apr 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default New problem

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?

Joe
 
Old April 8th, 2011, 10:50 PM
Registered User
 
Join Date: Apr 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

I haven't tried it yet, but I assume changing the column names in the table to firstName and lastName will fix this.
 
Old April 8th, 2011, 11:37 PM
Registered User
 
Join Date: Apr 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Zend Framework part of Chapter 4 has one more problem. 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;

Joe





Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP design pattern (factory?) from Zend Cert crmpicco Beginning PHP 0 July 25th, 2010 02:10 PM
Zend PHP 5 Certification: Exam Question Assistance (06 May 2010) crmpicco PHP How-To 0 May 6th, 2010 05:27 PM
PHP Design Pattern - interface (from Zend Cert) crmpicco PHP How-To 0 April 21st, 2010 04:52 PM
Do u know PHP Programming is Most Used Programming Language annaawills Beginning PHP 5 March 8th, 2010 09:48 AM





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