Hi,
I think that is more a PHP-related question, but it interferes with Phalcon. :/
I'm building an abstract class for a controller with some built-in functions. This class has a function, where the a type is set (e.g. 'keywords'). The abstract class has a non-abstract function showAction ($id), where a generic detailed view is built up (for e.g. 'keywords', 'names', 'locations', ...). That meas, that the picked view is always the same. So the only thing that must be different is the called Model.
That model - you guessed it - is named like the type-variable, say 'Keywords'.
In only-PHP this should work: $unique = 'SlipBOX\Models\'.$type::findFirstById($id); (the controllers have as namespace SlipBOX\Controllers).
But the error message says: Fatal error: Class 'Keywords' not found in C:\xampp\htdocs\slipbox\app\controllers\UniqueAbstractController.php on line 49
I've tried also: $unique = '\SlipBOX\Models\'.$type::findFirstById($id);
I don't know, where is the error? Yes, it's a simple question, but I hope you help me!
Great thanks and best wishes Aljoscha