Hi, this is my solution
create a file what extends \Phalcon\Mvc\User\Plugin;
<?php
use \Phalcon\Mvc\User\Plugin;
class Utils extends Plugin
{
public function uuid()
{
$result = $this->db->query("SELECT UUID_SHORT()");
$arr = $result->fetch();
return $arr[0];
}
}
in index.php
$di->set('utils',function(){
require '../app/public/utils/Utils.php';
$utils = new Utils();
return $utils;
});
in controller
echo $this->utils->uuid();//95426888817704969
or model
echo $this->getDI()->getUtils()->uuid();