This post is marked as solved. If you think the information contained on this thread must be part of the
official documentation, please contribute submitting a
pull request to its repository.
How to use the table prefix to code a project in phalcon?
One way to acomplish this is to include the table prefix within your config object. For each model that you define, you will also need the set the source so that the table prefix is applied.
return new \Phalcon\Config(array(
'db' => array(
'tblPrefix' => 'xyz_'
class Robots extends \Phalcon\Mvc\Collection
public function getSource()
$source = $this->getDi()->getConfig()->db->tblPrefix . 'robots';
$config = include APPLICATION_PATH . '/config/config.php';
Think you for your answer