「ver4/関数リファレンス/BcBaser element」の版間の差分
提供: baserCMS公式ガイド
行11: | 行11: | ||
## パラメータ | ## パラメータ | ||
(string)$name | (string)$name | ||
− | : | + | : エレメントのテンプレート名(Elementsフォルダからの相対パス) |
(array)$data | (array)$data |
2018年10月23日 (火) 22:41時点における版
[このコンテンツは内容調整中です]
目次
説明
/theme/{テーマ名}/Elements/内にあるエレメント(部品)テンプレートを出力する。
使い方
<?php $this->BcBaser->element( $name , [$data] , [$options] ); ?>
パラメータ
- (string)$name
- エレメントのテンプレート名(Elementsフォルダからの相対パス)
- (array)$data
- エレメントで参照するデータ
- (array)$options
- オプションのパラメータ
-
subDir
(boolean) エレメントのパスについてプレフィックスによるサブディレクトリを追加するかどうかを設定する。 - ※ その他のパラメータについては、View::element() を参照
戻り値
なし
用例
基本
サイドバーを出力する。
コード
<?php $this->BcBaser->element('sidebar') ?>