public function extension($var = null)
    {
        if ($var !== null) {
            $this->extension = $var;
        }
        if (empty($this->extension)) {
            $this->extension = '.' . pathinfo($this->name(), PATHINFO_EXTENSION);
        }

        return $this->extension;
    }
public function extension($var = null)
    {
        if ($var !== null) {
            $this->extension = $var;
        }
        if (empty($this->extension)) {
            $this->extension = '.' . pathinfo($this->name(), PATHINFO_EXTENSION);
        }

        return $this->extension;
    }
public function extension ( $ var = null ) { if ( $ var !== null ) { $ this -> extension = $ var ; } if ( empty ( $ this -> extension ) ) { $ this -> extension = '.' . pathinfo ( $ this -> name ( ) , PATHINFO_EXTENSION ) ; } return $ this -> extension ; }
Gets and sets the extension field.

@param null $var

@return null|string
Gets and sets the extension field .