Exemple #1
0
function show_data_members(Documenter $d, $type, $arr)
{
    $arrdefaultvalue = $d->getDefaultproperties();
    echo "<h3>{$type}</h3>\n";
    foreach ($arr as $key => $value) {
        $strtemp = "<p><span class=\"keyword\">" . $d->getModifiers($value) . "</span> " . "<span class=\"name\">{$key}</span>";
        if (isset($arrdefaultvalue[$key])) {
            $val = $arrdefaultvalue[$key];
            if (is_string($val)) {
                $val = "\"{$val}\"";
            } elseif (is_array($val)) {
                $val = " array()";
            } elseif (is_bool($val)) {
                if ($val === true) {
                    $val = "true";
                } else {
                    $val = "false";
                }
            } else {
                //$val = "$val";
            }
        }
        if ($val) {
            $strtemp .= " = {$val}";
        }
        /* getDocComment() для свойств был добавлен в PHP 5.1.0. 
        	  но не работал до версии 5.1.3 */
        if ($value->getDocComment()) {
            $strtemp .= "<br /><span class=\"comment\">";
            $strtemp .= $value->getDocComment() . "</span><br />";
        }
        //}
        echo $strtemp;
        echo "</p>\n";
    }
}
Exemple #2
0
function _smarty_documenter_modifiers(Documenter $d, $value)
{
    //used in documentation
    return $d->getModifiers($value);
}