Hello,
I'm following the Rob Allen's "Getting started with zend framework"
tutorial (http://akrabat.com/zend-framework-tutorial/) and coming to
the point of setting up the model I was wondering how I could take a
table prefix from my .ini config file and use it..

Here is my solution:

class Albums extends Zend_Db_Table {
        protected $_name = '';

        public function __construct() {
                $this->_name =_TABLE_PFX.'albums';
                parent::__construct();
        }

}


I've set _TABLE_PFX in the bootstrap.php file reading it from the
config (the .ini file):
define('_TABLE_PFX', $config->db->table_pfx);

Can you tell me is this solution can be considered "ok" or if there is
a better way to achieve this?

Thanks.

Giovanni.

Reply via email to