/**
* Gets an option's value.
*
- * @param string $option The name of the option to fetch.
- * @param boolean $html Whether to format the return value in HTML.
- * @param string $default A default value to use in case none is set for
- * the requested option.
+ * @param string $option The name of the option to fetch.
*
* @return mixed The option's value.
*/
- public function getOption($option, $html = false, $default = null)
+ public function getOption($option)
{
- $value = null;
-
- if (!isset($this->_options[$option]) && !is_null($default)) {
- /* Requested option has not been but there is a
- * default. */
- $value = $default;
- } elseif (isset($this->_options[$option])) {
- /* Requested option has been set, get its value. */
- $value = $this->_options[$option];
- }
-
- if ($html && !is_null($value)) {
- /* Format value for html output. */
- $value = sprintf(' %s="%s"', $option, $value);
- }
-
- return $value;
+ return isset($this->_options[$option])
+ ? $this->_options[$option]
+ : null;
}
/**
* @param array $params Additional parameters:
* <pre>
* alternate - (boolean) Alternate shading in the table?
+ * DEFAULT: false
* class - (string) The class to use for the table.
+ * DEFAULT: ''
* hideHeaders - (boolean) Don't render any HTML for the header row, just
* use the widths.
+ * DEFAULT: false
* lines - (boolean) Show tree lines?
+ * DEFAULT: true
+ * lines_base - (boolean) Show tree lines for the base level? Requires
+ * 'lines' to be true also.
+ * DEFAULT: false
* multiline - (boolean) Do the node labels contain linebreaks?
+ * DEFAULT: false
* </pre>
*/
public function __construct($name, array $params = array())
{
+ $params = array_merge(array(
+ 'lines' => true
+ ), $params);
+
parent::__construct($name, $params);
}