about
This site is the official support site for php|architect’s Guide to Programming with Zend Framework. It is mantained by the book’s author, Cal Evans.
All posts are (c) Cal Evans and all rights are reserved. All comments are considered copyright of the original poster.
All posts and comments are released under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.

Reader's Comments
Dear Cal Evans,
I’m reading through the Guide to Programming ZF. Though, I’m finding a few bugs/errors/typos/missing instructions in the book (I’m documenting them for you and I’ll send you my findings), so far, it’s a nice beginners guide, I’m enjoying it.
There’s one thing. I went to download the source code for example2. Does example 2 have to include all the source code for Zend Framework? Can just the application/bootstrap be included? It’s a lot of extra stuff to download ZF again if all we want is the sample source.
Cheers!
John
Hi John!
Please email any errata to cal at calevans dot com. I’ll make sure that the manuscript gets updated and that they get published here under the errata category.
In the next day or so I’ll try to create example_*_small that assumes you have ZF already installed. My goal was to make each example file “drop-in” but to do that you have to have the framework.
Check back, when i get them done I will post them on the sourceCode page.
Thanks for buying the book and thanks for taking the time to comment.
=C=
Hi Cal,
I like your book. I try to follow it very carefully.
For now I’ve a problem with messages coming from ‘MemberController.php’ to ‘IndexController.php’ - example3.zip. I cannot get any message coming from the MemberController like for ex. ‘Welcome Back…’. It looks like ‘flashMessenger’ is not working. I’ve check my and your source code.
Any idea?
Best Regards,
Jacek
Hi Jacek,
No, not off the top of my head. You can check to make sure FlashMessanger is there, it should be in “lib\Zend\Controller\Action\Helper” however, if it’s missing you’ve probably got other problems.
I’ve just rechecked the examples and it does seem to be working. Email me if you are still having problems and we’ll see if we can’t figure them out for you.
=C=
Hello Cal,
I have just purchased you book(pdf version) and started reading.
Thank you for all effort..
I have a small question regarding to Chapter 4.
I am trying to find explation of Member.php code in the book but I think I am lost. I found the Member.php in the source code but I could not find it in the book.
Again congs for all your good work..
Regards
Hi Cal,
I’ve purchased your book and created a development environment on my computer using XAMPP. I downloaded all of the examples as a single .zip file and extracted to my htdocs directory. I’ve begun working through the examples, but am having a difficult time getting them to work. The problem that is immediately apparent is that you’ve hard coded paths to the various directories in your index.php and IndexController like so:
$lib_paths = array();
$lib_paths[] = “c:/web/htdocs/application/”;
$lib_paths[] = “c:/web/htdocs/lib/”;
$frontController->setControllerDirectory(’c:/web/htdocs/application/controllers/’);
Since this is not the path to my files, I’m forced to search through each file to correct each such occurence. Perhaps you could consider updating your code to be a bit more flexible such as:
set_include_path(’.’ . PATH_SEPARATOR . ‘.././lib/’
. PATH_SEPARATOR . ‘.././application/models’
. PATH_SEPARATOR . get_include_path());
This would be immensely helpful for me, and likely for others. I’m finding it difficult enough to try and grasp MVC & the Zend Framework without the added difficulty of troubleshooting non-working code.
I hope you will find my criticism constructive, as it was intended.
Thanks,
Brad
i have buy your book, i have try your source code, but why if i use .htaccess, the server getting error, i use xampp.
thanks
jamz
@jamz
Hi! Thanks for writing and thanks for buying the book. Honestly I do not know why using an .htaccess file would cause your XAMPP install to throw an error. My knowledge of Apache is limited to things I’ve learned the hard way and I’ve not run across that one yet. :)
You may want to post on their mailing list and see if anyone can suggest a solution.
Thanks again for writing,
=C=
Hi Cal,
I love the book, it has really helped me get to grips with Zend_Auth. I can’t quite work out the architecture for Zend_ACL though. Where should I be putting it in relation to the rest of my docs?
I like your book not because it is a comprehensive guide to each component of ZF (which it isn’t), but because it’s more of a heads-up, an eye opener to the opportunities a good framework offers.
@Bogdan,
I’m glad you like the book. No it’s not a comprehensive guide and wasn’t written to be one. Rob Allen is working on one of those and I have no doubt that it’s going to be great.
=C=
i was wondering that will u be amending the erratas into the available PDF download. since i purchased the book+pdf option, it wud be nice if the erratas are amended into the PDF, so that i will have the updated version of the book.
@isse,
That is totally in the hands of the publisher. I’ve collected all of it and if they will allow it, I would love to publish a cleaned up version.
=C=
Hi Cal,
I’ve just started to read your book and have run into some problems. In chapter 3 (The Controller) I’ve made an additional controller called BaseController with the token code. When I run index.php I get the following error..
Fatal error: Uncaught exception ‘Zend_Controller_Action_Exception’ with message ‘IndexController::generateToken() does not exist and was not trapped in __call()
It seems like its looking for the generateToken() function in IndexController page. Is there a way to link IndexController and BaseController pages? Or is there another solution to this?
Thanks.
Hi ssin!
Yes, this is an exampel of where I changed the code in the example code but the change didn’t get propagated to the book. Please download the sample code and give it a try.
=C=
Hi Cal, I have just purchased the book and am pleased with the easy to understand approach.
I however have found a small issue in that in Chapter 3 you start to discuss plugins and helpers - you go on to discuss helpers and state that you approach plugins in Chapter 4 (which is called ‘The Model’).
I have had a good dig around chapter four and cant find any reference to plugins in there (or for that matter in the book anywhere) and its a particularly useful bit of info that could have gone so well with the layout appendix at the back to bolster the layout code.
Is there a plan to publish your section on plugins? I want to seperate the layout phtml and code without having to put code inside every controller - this I think is a most appropriate use of plugins (as per your book).
Otherwise nice writing.
Oo
Cal -
on page 50, ‘The Model’ chapter, you list source like so:
public function processregisterAction() …
shouldn’t that be ‘processRegisterAction()…’
plus that’s how it’s given in the sample code available for download
@clint,
Thanks!
I’ll correct the book’s source.
=C=
Cal -
Page 76 ‘Data Access’ reads:
“Let’s take a look at the member model we created… In the method ‘checkEmail()’…”
the method is ‘emailCheck()’, defined on page 47 “The Model”, and in source /application/models/Member.php
Cal -
on page 90 we unpack example4 and start replacing code, first adding BaseModel.php to the models and ripping out some other stuff.
knowing Member extended BaseModel i made the haste-full mistake of also replacing member.php. every time after i logged in, i was always getting logged in as the first member in the database, regardless of creds (it was authenticating, just always setting the user to the first user in the DB).
turns out example4.zip, the member.php file differs from what the book explains. on page 95, middle code block, :
if($result->isValid()) {
$memberArray = $authAdapter->getResultRowObject(’id’);
$returnValue = (int)$memberArray->id;
}// if($result->isValid())
return $returnValue;
is not in the example source code, instead:
$result = $authAdapter->authenticate();
return $result->isValid();
that explains why i was always getting the user as the first user in the DB, the source i mistakenly replaced mine with was missing that $returnValue = (int)$memberArray->id; to set the correct ID
correction of my previous post, it’s page 93, lower code block, not page 95. page got turned mid-post
Cal -
page 108, in the information block, reads:
“That’s a good idea of you get charged …”
i think that’s a typo and should be “if you get charged”
page 50(listing 3.10):
…
$placesFinder = new Places();
$this->view->places = $places->fetchLatest();
….
$places should be $placesFinder!
Behind the scenes, startMvc() creates a Singleton instance of Zend_Layout and [the] registers a front
controller …
[the] - should be then! page 54
sorry the comments I made are not for this book. Sorry for any issues caused ;)
Leave a Reply