If, like me, you are relatively new to PHP with the Zend Framework there are a few things you need to know that will help you complete the early chapters.
Configuring virtual hosts is one area that may give you grief. Be sure to include localhost as a virtual host as well as all of your other virtual hosts.
You may find that the code on page 34 of Ch. 2 doesn't work for you:
?= $this
The reason is that you don't have short tags enabled in your php.ini file. If you don't want to enable short tags, you'll have to use the following code instead:
?php echo $this
Also in Ch.2, make sure you understand the section "Retrieving POST Parameters" on page 36 -- you'll need it to correct some code errors in Ch. 5.
One last thing about Ch. 2 -- you don't need to create custom routes or define URL parameters to continue with the book. Those are just some of the excellent code snippets and programming methods that the author sprinkles throughout the book.
Newbies may want to read Ch. 11, then come back to the testing sections at the end of each chapter.
Ch. 3 has lots of useful code snippets, but I don't know if they can be used in a "sing along with Mitch" fashion. I'm sure I'll come back to this chapter time and again as I struggle to learn the Zend Framework.
Like Ch. 3, Ch. 4 has lots of useful information and code snippets that I'm sure I'm come back to. It's must reading, but don't get mired by it -- forge ahead.
Ch. 5 had me spittin' nails for the longest time. No matter what I tried, I couldn't echo my username and password back to the browser or get the form validation to work.
Time to review that section in Ch. 2 I mentioned earlier. Turns out that you need to replace this code shown on page 67 of Ch. 5 (change those square brackets to html brackets):
$email = $form->getValue('email');
$pswd = $form->getValue('pswd');
with this code:
$email = $this->_request->getPost('email');
$pswd = $this->_request->getPost('pswd');
After that things began to work as advertized. (I sometimes wonder if those typos on purpose.)
The author mentions that you can customize your error messages and points you in the right direction, but he doesn't really say how to do so. What I did was copy this code from his companion website in /public/css/styles.css:
#flash, #errors {
background-color: #0061CE;
color: white;
font-weight: bold;
border: 1px solid black;
width: 50%;
margin: 3px;
padding: 3px;
}
then modify is slightly and paste it into /application/views/scripts/account/login.phtml as:
ul.errors {
background-color: #0061CE;
color: white;
font-weight: bold;
border: 1px solid black;
width: 50%;
margin: 3px;
padding: 3px;
}
all enclosed between html-style tags and placed between the closing html-head and opening html-body tags. (Blogger gets persnickety about html like tags in these missives.) Now I get the same God-awful bold error messages in white against a blue background that come with the companion website!
Installing the GameNomad companion website. I've downloaded and installed all the files I need and have the gamenomad database set up. I'm still struggling with the seed.php script, which is used to seed the database with data pulled from the Amazon.com website. That may require some help from the offer, and I'll be sure to share once I get it working.
Subscribe to:
Post Comments (Atom)
3 comments:
I agree with your comments and am at about the same level of understanding as you.
I also am having issues with the seed.php file; haven't found the answer yet, either.
jb
Hi jb -- email me offline and I'll send you the file Jason walked me through over the phone. Give me a little time as I've got a deadline this evening! -- Frank
doolyATnovatoDOTnet
What is this.. i cant get what you want to tell. please post the blog properly...
Post a Comment