I have a class that is not loading when I use Phalcon 2/php5.5.9 that loads in phalcon 1.3.4/php5.5.22 .
Has loading behaviour on namespaces become more restrictive in Phalcon 2?
My model and all else loads but gets stuck not seeing my trait class .
bog standard loader:
$loader = new \Phalcon\Loader();
$loader->registerDirs(
array(
$config->application->controllersDir,
$config->application->modelsDir,
$config->application->libraryDir,
$config->application->pluginsDir
)
)->register();
app->models->User.php
class User extends \Phalcon\Mvc\Model
{
use Traits\MyTimestampable; //Error is here with - PHP Fatal error: Trait 'Traits\\MyTimestampable' not found
}
app->models->traits->MyTimestampable.php
namespace Traits;
trait MyTimestampable
{
public function beforeValidationOnCreate()
{
$this->created = date("Y:m:d H:i:s");
$this->modified = date("Y:m:d H:i:s");
}
public function beforeUpdate()
{
$this->modified = date("Y:m:d H:i:s");
}
}
Any idea/hints etc. ?