Documentation: class reference with inline cross reference

Like in drupal docs:

http://api.drupal.org/api/drupal/modules--field--field.module/function/field_help/7

Every function in the code is clickable to track where it’s defined.

We can do that in yii docs.

phpXref http://www.google.com/search?q=phpXref do that in this way too.

I don’t understand what you mean… but on all yii api pages… there is a link to the google repository source file… and all functions have a link to the google code repository source…and a “show” link that displays the source code right on the api page…

For example:




Source Code: framework/base/CComponent.php#108 (hide)

public function __get($name)

{

    $getter='get'.$name;

    if(method_exists($this,$getter))

        return $this->$getter();

    else if(strncasecmp($name,'on',2)===0 && method_exists($this,$name))

    {

        // duplicating getEventHandlers() here for performance

        $name=strtolower($name);

        if(!isset($this->_e[$name]))

            $this->_e[$name]=new CList;

        return $this->_e[$name];

    }

    else if(isset($this->_m[$name]))

        return $this->_m[$name];

    else if(is_array($this->_m))

    {

        foreach($this->_m as $object)

        {

            if($object->getEnabled() && (property_exists($object,$name) || $object->canGetProperty($name)))

                return $object->$name;

        }

    }

    throw new CException(Yii::t('yii','Property "{class}.{property}" is not defined.',

        array('{class}'=>get_class($this), '{property}'=>$name)));

}



property_exists and get_class … in above, will link to php manual, and Yii::t; will link to where it defined in the reference:

The Yii::t() in the code above will be rendered as:

Yii::[url="http://www.yiiframework.com/doc/api/1.1/YiiBase#t-detail"]t/url

<- You see, that’s better for quick reference,and if it’s a ajax link to directly show the targeted contents in popup-divs, will be more handy.