第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

php中如何給類規(guī)范的注釋?

php中如何給類規(guī)范的注釋?

慕田峪7331174 2019-02-06 11:07:43
經(jīng)??吹絼e人寫的php庫注釋相當(dāng)好,像這樣/*** @param array $params parameters* @param string $content contents of the block* @param Smarty_Internal_Template $template template object* @param boolean &$repeat repeat flag* @return string content re-formatted* @author Monte Ohrt <monte at ohrt dot com>*/想知道這種注釋在哪有格式規(guī)定,用什么編輯器能快速生產(chǎn)這種注釋,或者幫我寫左邊的*號(hào)。
查看完整描述

2 回答

?
湖上湖

TA貢獻(xiàn)2003條經(jīng)驗(yàn) 獲得超2個(gè)贊

標(biāo)準(zhǔn)請(qǐng)參考 PHPDoc標(biāo)準(zhǔn)


以Zend Studio為例,你應(yīng)該先完成代碼,如

function test(array $arr) {

    return $arr;

}


然后在function之前的一行敲入 /** 然后按回車,就會(huì)自動(dòng)得到以下注釋

/**

 * //這行空白,留給你寫功能說明的

 * @param array $arr

 * @return array

 */


當(dāng)然,根據(jù)內(nèi)容的不同注釋也不一定,對(duì)文件注釋,變量,屬性,方法,函數(shù),常量,類等都有自己的格式。


例子

123456789101112131415161718192021222324252627282930313233343536373839<?php/** * Project Form object, extends Zend_Form * * @author Nick <------@gmail.com> 2012-4-18 */class Project_Form extends Zend_Form {            /**     * Options name of default values     * @var string     */    const OPTIONS_DEFAULTE_VALUES = 'defaults';            /**     * Name of required attribute     * @var string     */    const NAME_OF_ATTRIBUTE_REQUIRED = 'required';            /**     * Extend is valid     * @param array $data     * @return void     */    protected function _beforeIsValid(array $data) {        return $data;    }            /**     * Validate submitted data     * @see Zend_Form::isValid()     */    public function isValid($data) {        $data $this->_beforeIsValid($data);        return parent::isValid($data);    }        }



查看完整回答
反對(duì) 回復(fù) 2019-03-19
  • 2 回答
  • 0 關(guān)注
  • 625 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)