Hi,

I have a custom tree form element that uses a custom view helper, set via
the public $helper property of the custom form element.

The custom form element outputs a tree view of categories, with a checkbox
next to the category name:

<checkbox> <category>

The custom view helper extends Zend_View_Helper_FormMultiCheckbox, and the
custom form elment extends Zend_Form_Element.

I have a situation where I would like to output the same tree but without
the checkbox, and the category name wrapped in an anchor tag so I can use in
my views, similar to::

<?php echo $this->tree("test", null, null, $this->data); ?>
(note: Above is how I currently do this, but it only outputs a checkbox as
indicated initially.)

Now, the code for this would be/is extremely similar to the custom view
helper I use with the custom tree element. Is it possible to use the same
view helper for both of the scenarios I present?

I think I would need a flag to determine whether to output a checkbox or
wrap in an anchor tag, but I cant see where i could set this flag
beforehand, as the parameter list to my custom helper is thus:

tree($name, $value = null, $attribs = null, $options = null, $listsep = "<br
/>\n").

I do not use a view script for my form.

Thanks for any advice.
Daniel Latter

Reply via email to