ウェブプログラミングで使えるデザインパターン (170レス)
前次1-
抽出解除 レス栞

リロード規制です。10分ほどで解除するので、他のブラウザへ避難してください。
155
(1): nobodyさん [sage] 2006/01/20(金) 13:38:24 ID:??? AAS
PHPだけど、
class array_formatter{
    function format_array(&$array){
        if(!count($array)) return $this->format_empty();

        $html  = $this->format_header($array);
        foreach($array as $key => $value){
            $html .= $this->format_item($key, $value);
        }
        $html .= $this->format_footer($array);
        return $html;
    }
    function format_empty(){
    }
    function format_header(&$array){
    }
    function format_footer(&$array){
    }
    function format_item($key, $value){
    }
}

こんな感じのクラスを継承して使いまくってる。
156: nobodyさん [] 2006/01/25(水) 17:02:55 ID:thETe4Qv(1) AAS
>>155
それがデザインパターンと何の関係があるの?
前次1-
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル

ぬこの手 ぬこTOP 0.011s