Beispiel #1
0
 /**
  * Return object's display
  *
  * @param $template          Template
  * @param $display_full_path boolean If object is a property, returns 'the.full.property.path'
  * @return string
  */
 public function getDisplay(Template $template, $display_full_path = false)
 {
     $object = reset($template->objects);
     if ($object instanceof Reflection_Property) {
         return Names::propertyToDisplay($display_full_path ? $object->path : $object->name);
     } elseif ($object instanceof Reflection_Class) {
         return Names::classToDisplay($object->name);
     } elseif ($object instanceof Reflection_Method) {
         return Names::methodToDisplay($object->name);
     } elseif (is_object($object)) {
         return (new Displayable(get_class($object), Displayable::TYPE_CLASS))->display();
     } else {
         return $object;
     }
 }