BlogHelper::getEyeCatch PHP Method

getEyeCatch() public method

アイキャッチ画像を取得する
public getEyeCatch ( array $post, array $options = [] ) : string
$post array ブログ記事
$options array オプション(初期値 : array()) - `imgsize` : 画像サイズ[thumb|small|medium|large](初期値 : thumb) - `link` : 大きいサイズの画像へのリンク有無(初期値 : true) - `escape` : タイトルについてエスケープする場合に true を指定(初期値 : false) - `mobile` : モバイルの画像を表示する場合に true を指定(初期値 : false) - `alt` : alt属性(初期値 : '') - `width` : 横幅(初期値 : '') - `height` : 高さ(初期値 : '') - `noimage` : 画像が存在しない場合に表示する画像(初期値 : '') - `tmp` : 一時保存データの場合に true を指定(初期値 : false) - `class` : タグの class を指定(初期値 : img-eye-catch) - `force` : 画像が存在しない場合でも強制的に出力する場合に true を指定する(初期値 : false) - `output` : 出力形式 tag, url のを指定できる(初期値 : '') ※ その他のオプションについては、リンクをつける場合、HtmlHelper::link() を参照、つけない場合、Html::image() を参照
return string アイキャッチ画像のHTML
    public function getEyeCatch($post, $options = array())
    {
        $this->setContent($post['BlogPost']['blog_content_id']);
        $options = array_merge(array('imgsize' => 'thumb', 'link' => true, 'escape' => false, 'mobile' => false, 'alt' => '', 'width' => '', 'height' => '', 'noimage' => '', 'tmp' => false, 'class' => 'img-eye-catch', 'output' => ''), $options);
        return $this->BcUpload->uploadImage('BlogPost.eye_catch', $post['BlogPost']['eye_catch'], $options);
    }