make sense since ObjectDecorator does not implement Iterator or ArrayAccess. maybe property_exists can do
On Feb 4, 5:09 pm, Mark Smith <marksmith5...@jungle-monkey.com> wrote: > That returns a fatal exception: "Call to undefined method > sfOutputEscaperObjectDecorator::offsetExists()".... > > The only static methods I can see on that class are: > > markClassAsSafe($class) > markClassesAsSafe(array $classes) > isClassMarkedAsSafe($class) > unescape($value) > escape($escapingMethod, $value) > > A quick search through the library code reveals that this method > exists on an IteratorDecorator and an ArrayDecorator, but not an > ObjectDecorator... > > On Feb 4, 4:44 am, ken <marfillas...@gmail.com> wrote: > > > > > sfOutputEscaperObjectDecorator::offsetExists > > > On Feb 4, 12:38 am, Mark Smith <marksmith5...@jungle-monkey.com> > > wrote: > > > > Hi, > > > > In my template I only want to print properties that exist. > > > > In pure PHP I would use isset: > > > > echo isset($object->property) ? $object->property : ""; > > > > However when the object is an sfOutputEscaperObjectDecorator, isset > > > always returns false, even when the property is there. > > > > As a workaround I am currently using: > > > > echo !is_null($object->property) ? $object->property : ""; > > > > However this triggers an undefined property notice. Not good practise. > > > > What is the best way to check the presence of a property on an > > > sfOutputEscaperObjectDecorator? > > > > I am using symfony 1.2 > > > > Thanks for any help. -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.