php - How to format Zend_db Rowset output? -


I have a model that is referred to in the table Registry extension Zend_Db and some methods that basically use fetchAll () all the time.

What happens: My table has the DATE field and I want it to be pre-generated for output when I call $ row-> reg_date in the model Is it possible to do something or do I have to format manually?

You've got some options:

  • reg_date > Overwrite in your table
  • Format in, like & lt ;? = $ This- & gt; FormatDate ($ this->; row-> reg_date, 'fancy');
  • In theory you may have been given the answer, which has been deducted from the following:

    < Pre> extends class user baseuser {public function SetPassword ($ password) {return $ this- & gt; _set ('password', md5 ($ password)); }} $ User = new user (); $ User- & gt; User name = 'jwage'; $ User- & gt; Password = 'change'; Echo $ user- & gt; password; // Output MD5 hash and not changeme

    If I were you , then I had to go with the Visual Assistant option you can add custom CSS there and it Ready to go if you need it, you can change it to one place and with the renewal of your application.

    In addition, if you ever wanted to do anything with the date (compare second date, only months, localization, etc.) you want a clean start point , Which you will store in the database (i.e. 2010-05-16 or 2010) -05-16 16:55:00 ). Therefore: the scene settings are included in the scene.


Comments