I am using the following feature from propel http://www.propelorm.org/documentation/09-inheritance.html.
I am also using Symfony2 and Twig
I have a class structure using the above feature that looks something like this
class Event {}
class Birthday extends Event {}
class Walking extends Event {}
now I pass an event object to a twig template and I want to know what type of event it is
For instance I want to display an image of a cake if its a birthday and I want to display map routes if its walking event.
I cannot use instanceof in Twig as this feature does not exist. Does anyone now why this does not exist? and is there a way I can replicate this functionality without having to do something like
public function getType()
in each class, or
public function isBirthday()
in the event class.
I found this on github but it is of no use to me. I have commented on their to see if I can get an answer.
\Twig_Test
, or is it an alias to another class?\Twig_Test
itself is abstract and thus uninstantiatable. – Hypercritical