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

Code (php)
  1. $controller->setBaseUrl($baseUrl);

instead of

Code (php)
  1. $router->setRewriteBase($baseUrl);
  2.  

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

  1. Nice idea, but is it necessary to do it?

    Comment by nelson — December 22, 2006 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Since May 6,2007 We have Visitors
dog ramps

Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds. Valid XHTML and CSS. ^Top^