Refactor!
December 19, 2006 on 9:19 pm | In Zend Framework |Waiting is boring, but I have to wait, I am waiting for Zend_Auth, I am waiting for Rob’s update because Version 0.6.0 chnaged Zend_Controller a lot.
So far I just use
-
$controller->setBaseUrl($baseUrl);
instead of
-
$router->setRewriteBase($baseUrl);
-
in index.php
But, The _action property is no longer set. … Anyway, Rob’s is going to update his tutorial soon. It is better not repeating this job. let me do something else! Do you still remember these in Rob’s tutorial?
Refactor!
It shouldn’t have escaped your notice that AddAction() and EditAction() are very similar and
that the add and edit templates are identical. Some refactoring is in order!
I’ve left it as an exercise for you, dear reader…
As a matter of fact, not only addAction() and editAction, but manys other actions would do the similar behavior. As far as I know is registerAction() which I will add into my project.
So it is time to think about it. I’d like to develop some models named Bkadd.php Bkupdate.php etc, they will handle all actions that related to add/update one record to table.
1 Comment »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^
Nice idea, but is it necessary to do it?
Comment by nelson — December 22, 2006 #