baserCMS クラスリファレンス

BcBaserHelper extends Helper
in package
Uses BcEventDispatcherTrait, BcContainerTrait

Class BcBaserHelper

Table of Contents

Properties

$BcAuth  : BcAuthHelper
$BcContents  : BcContentsHelper
$BcGoogleMaps  : BcGoogleMapsHelper
$BcHtml  : BcHtmlHelper
$BcXml  : BcXmlHelper
$Breadcrumbs  : BreadcrumbsHelper
$Flash  : FlashHelper
$helpers  : array<string|int, mixed>
ヘルパー
$Url  : UrlHelper
$_categoryTitle  : mixed
タイトルタグとパンくず用の配列を取得する際に取得するカテゴリタイトル $_categoryTitleOn が true の場合に取得するが、 $_categoryTitle が、true の場合は、パンくず用配列に格納された値を利用する setCategoryTitle() で設定を変更できる
$_categoryTitleOn  : mixed
カテゴリタイトル設定
$_pluginBasers  : array<string|int, mixed>
BcBaserHelper を拡張するプラグインのヘルパ
$_View  : View
View

Methods

__call()  : mixed|void
PluginBaserHelper 用マジックメソッド
__construct()  : mixed
コンストラクタ
_unsetIndexInContentsMenu()  : mixed
コンテンツメニューにおいてフォルダ内の index ページを除外する
addCrumb()  : void
パンくずリストの要素を追加する
afterRender()  : mixed
After Render
baseUrl()  : void
ベースとなるURLを出力する
blogDescription()  : void
blogDescriptionExists()  : bool
blogPostCategory()  : void
blogPostContent()  : void
blogPostDate()  : void
blogPostEyeCatch()  : void
blogPostNextLink()  : void
blogPostPrevLink()  : void
blogPosts()  : void
blogPostTitle()  : void
blogTagList()  : void
cacheHeader()  : void
ブラウザにキャッシュさせる為のヘッダーを出力する
charset()  : void
charset メタタグを出力する
content()  : void
コンテンツ本体を出力する
contentsMenu()  : void
コンテンツメニューを出力する
contentsName()  : void
コンテンツを特定する文字列を出力する
contentsNavi()  : void
コンテンツナビを出力する
contentsTitle()  : void
コンテンツのタイトルを出力する
copyYear()  : void
コピーライト用の年を出力する
createForm()  : string
createMailForm()  : string
crumbs()  : void
パンくずリストを出力する
crumbsList()  : void
パンくずリストを出力する
css()  : string|void
CSS タグを出力する
customContentDescription()  : void
customEntryPublished()  : string
customEntryTitle()  : void
customSearchControl()  : string
declarationI18n()  : string
i18n 用の変数を宣言する
dispatchLayerEvent()  : bool|Event
イベントを発火
element()  : void
エレメントテンプレートを出力する
endForm()  : string
endMailForm()  : string
flash()  : void
セッションに保存したメッセージを出力する
footer()  : void
フッターテンプレートを出力する
formControl()  : string
formError()  : string
formHidden()  : string
formLabel()  : string
formSubmit()  : string
freezeMailForm()  : void
func()  : void
ツールバーエレメントや CakePHP のデバッグ出力を表示
getBaseUrl()  : string
ベースとなるURLを取得する
getBlogCategories()  : array<string|int, mixed>
getBlogContentsUrl()  : string
getBlogPostContent()  : string
getBlogPostCount()  : int
getBlogPostLinkUrl()  : string
getBlogPosts()  : string
getBlogs()  : array<string|int, mixed>
getBlogTagList()  : array<string|int, mixed>
getBlogTitle()  : string
getContentByEntityId()  : array<string|int, mixed>
エンティティIDからコンテンツの情報を取得
getContentCreatedDate()  : null|string
コンテンツ作成日を取得
getContentModifiedDate()  : null|string
コンテンツ更新日を取得
getContentsMenu()  : string
メニューを出力する
getContentsName()  : string
コンテンツを特定する文字列を取得する
getContentsTitle()  : string
表示しているページのコンテンツタイトルを取得する
getContentsUrl()  : string
コンテンツ管理用のURLより、正式なURLを取得する
getCrumbs()  : array<string|int, mixed>
パンくず用の配列を取得する
getCurrentContent()  : Content
getCurrentPrefix()  : string
現在のサイトプレフィックスを取得する
getCurrentSite()  : Site
getCustomFieldTitle()  : string
getCustomFieldValue()  : string|array<string|int, mixed>
getCustomLinks()  : ResultSet
getDescription()  : string
meta タグ用のページ説明文を取得する
getElement()  : string
エレメントテンプレートのレンダリング結果を取得する
getFullUrl()  : string
フルURLに変換する
getGlobalMenu()  : string
グローバルメニューを取得する
getGoogleMaps()  : string
Google Maps を取得する
getHere()  : string
現在のページの純粋なURLを取得する
getImg()  : string
画像タグを取得する
getKeywords()  : string
meta タグ用のキーワードを取得する
getLink()  : string
アンカータグを取得する
getMailFormGroupValidErrors()  : array<string|int, mixed>
getMailFormSourceValue()  : mixed
getParams()  : array<string|int, mixed>
パラメータ情報を取得する
getParentContent()  : EntityInterface
getParentFolder()  : mixed
親フォルダを取得する
getPluginBaser()  : bool|mixed
Plugin 内の Baserヘルパを取得する
getRelatedSiteLinks()  : mixed
関連サイトのリンク一覧を取得
getService()  : array<string|int, mixed>|mixed|object
Get Service
getSitemap()  : string
サイトマップを取得する
getSiteName()  : string
Webサイト名を取得する
getSitePrefix()  : string|false
現在のサイトのプレフィックスを取得する
getSiteSearchForm()  : string
サイト内検索フォームを取得
getSiteUrl()  : string
WebサイトURLを取得する
getThemeUrl()  : string
現在のテーマのURLを取得する
getTitle()  : string
タイトルタグを取得する
getUpdateInfo()  : mixed
更新情報を取得する
getUri()  : string
プロトコルから始まるURLを取得する
getUrl()  : string
baserCMSの設置フォルダを考慮したURLを取得する
getUrlParams()  : array<string|int, mixed>
URL情報を取得する
getUserName()  : string
ユーザー名を整形して取得する
getWidgetArea()  : string
globalMenu()  : void
グローバルメニューを出力する
googleAnalytics()  : void
Google Analytics のトラッキングコードを出力する
googleMaps()  : void
Google Maps を出力する
hasChildBlogCategory()  : bool
hasService()  : bool
Has Service
header()  : void
ヘッダーテンプレートを出力する
i18nScript()  : mixed
JavaScript に、翻訳データを引き渡す `bcI18n.キー名` で参照可能 (例)bcI18n.alertMessage
icon()  : void
アイコン(favicon)タグを出力する
img()  : void
画像タグを出力する
initialize()  : void
initialize
isAdminUser()  : bool
管理者グループかどうかチェックする
isBlog()  : bool
isBlogCategory()  : bool
isBlogDate()  : bool
isBlogHome()  : bool
isBlogMonth()  : bool
isBlogSingle()  : bool
isBlogTag()  : bool
isBlogYear()  : bool
isCategoryTop()  : bool
現在のページがページカテゴリのトップかどうかを判定する 判定は、URLからのみで行う
isContentFolder()  : bool
現在のページがコンテンツフォルダかどうか確認する
isContentsParentId()  : bool
IDがコンテンツ自身の親のIDかを判定する
isCurrentUrl()  : bool
指定したURLが現在のURLと同じかどうか判定する
isDebug()  : bool
デバッグモードかどうか
isDisplayCustomEntrySearch()  : bool
isDisplayCustomField()  : bool
isHome()  : bool
現在のページがトップページかどうかを判定する
isLinkEnabled()  : true
リンクが有効化どうか
isMail()  : bool
isMailFormGroupLastField()  : bool
isPage()  : bool
現在のページが固定ページかどうかを判定する
isPluginLoaded()  : bool
プラグインがロードされているか判定する
isSSL()  : bool
SSL通信かどうか判定する
js()  : void
Javascript タグを出力する
link()  : void
アンカータグを出力する
listNum()  : void
表示件数設定機能を出力する
logo()  : void
mailFormAuthCaptcha()  : void
mailFormControl()  : string
mailFormDescription()  : void
mailFormDescriptionExists()  : bool
mailFormError()  : string
mailFormHidden()  : string
mailFormLabel()  : string
mailFormSubmit()  : string
mainImage()  : void
mark()  : string
文字列を検索しマークとしてタグをつける
meta()  : string
metaDescription()  : void
ページ説明文用のメタタグを出力する
metaKeywords()  : void
キーワード用のメタタグを出力する
page()  : void
固定ページをエレメントとして読み込む
pagination()  : void
ページネーションを出力する
relatedSiteLinks()  : mixed
関連サイトのリンク一覧を表示
rss()  : void
RSSフィードのリンクタグを出力する
scriptEnd()  : string
scripts()  : void
コンテンツ内で設定した CSS や javascript をレイアウトテンプレートに出力し、ログイン中の場合、ツールバー用のCSSも出力する また、テーマ用のCSSが存在する場合には出力する
scriptStart()  : void
set()  : void
レイアウトで利用する為の変数を設定する
setAlternateUrl()  : mixed
alternate タグ出力 スマホサイトが存在し、別URLの場合に出力する
setCanonicalUrl()  : mixed
setCanonicalUrl PCサイトの場合 - .html付:.htmlなしのカノニカルを出力 - .html無:自身のカノニカルを出力 スマホサイトの場合 - PCサイトが存在する場合、canonicalを出力
setCategoryTitle()  : void
タイトルとパンくずへのカテゴリタイトルの出力有無を設定する
setDescription()  : void
meta タグの説明文を設定する
setHomeTitle()  : mixed
トップページのタイトルをセットする
setKeywords()  : void
meta タグのキーワードを設定する
setScript()  : mixed
JavaScript に変数を引き渡す
setTableToUpload()  : void
setTitle()  : void
タイトルを設定する
sitemap()  : mixed
サイトマップを出力する
siteName()  : void
Webサイト名を出力する
siteSearchForm()  : void
サイト内検索フォームを出力
siteUrl()  : void
WebサイトURLを出力する
themeUrl()  : void
現在のテーマのURLを出力する
title()  : void
タイトルタグを出力する
truncateText()  : string
unlockMailFormField()  : MailformHelper
updateInfo()  : void
更新情報を出力する
url()  : void
baserCMSの設置フォルダを考慮したURLを出力する
webClipIcon()  : mixed
スマートフォン用のウェブクリップアイコン用のタグを出力する
widgetArea()  : void
xmlHeader()  : void
XMLヘッダタグを出力する
_initPluginBasers()  : void
PluginBaserHelper を初期化する

Properties

$helpers

ヘルパー

public array<string|int, mixed> $helpers = ['Url', 'Js', 'Session', 'Flash', 'BaserCore.BcHtml', 'BaserCore.BcXml', 'BaserCore.BcArray', 'BaserCore.BcPage', 'BaserCore.BcContents', 'BaserCore.BcAuth', 'Breadcrumbs', 'BaserCore.BcGoogleMaps']

$_categoryTitle

タイトルタグとパンくず用の配列を取得する際に取得するカテゴリタイトル $_categoryTitleOn が true の場合に取得するが、 $_categoryTitle が、true の場合は、パンくず用配列に格納された値を利用する setCategoryTitle() で設定を変更できる

protected mixed $_categoryTitle = true

boolean or string

$_categoryTitleOn

カテゴリタイトル設定

protected mixed $_categoryTitleOn = true

タイトルタグとパンくず用の配列を取得する際にカテゴリのタイトルを取得するかどうかの判定を保持 getCrumbs() と、setTitle() で設定を変更できる

boolean or null

$_pluginBasers

BcBaserHelper を拡張するプラグインのヘルパ

protected array<string|int, mixed> $_pluginBasers = []

BcBaserHelper::_initPluginBasers() で自動的に初期化される。

Methods

__call()

PluginBaserHelper 用マジックメソッド

public __call(string $method, array<string|int, mixed> $params) : mixed|void

BcBaserHelper に存在しないメソッドが呼ばれた際、プラグインで定義された PluginBaserHelper のメソッドを呼び出す call__ から __call へメソット名を変更、Helper の __call をオーバーライド

Parameters
$method : string

メソッド名

$params : array<string|int, mixed>

引数

Tags
checked
noTodo
Return values
mixed|void

PluginBaserHelper の戻り値

__construct()

コンストラクタ

public __construct(View $View[, array<string|int, mixed> $settings = [] ]) : mixed
Parameters
$View : View

ビュークラス

$settings : array<string|int, mixed> = []

ヘルパ設定値

Tags
checked
noTodo

_unsetIndexInContentsMenu()

コンテンツメニューにおいてフォルダ内の index ページを除外する

public _unsetIndexInContentsMenu(array<string|int, mixed> $contents[, bool $children = false ]) : mixed
Parameters
$contents : array<string|int, mixed>

コンテンツデータ

$children : bool = false

子かどうか

Tags
checked
noTodo
Return values
mixed

コンテンツデータ

addCrumb()

パンくずリストの要素を追加する

public addCrumb(string $name[, mixed $link = null ][, mixed $options = [] ]) : void

デフォルトでアクセス制限がかかっているリンクの場合でもタイトルを表示する $options の forceTitle キー に false を指定する事で表示しない設定も可能

Parameters
$name : string

パンくず用のテキスト

$link : mixed = null

パンくず用のリンク(初期値 : null)※ 指定しない場合はリンクは設定しない

$options : mixed = []

リンクタグ用の属性(初期値 : array()) ※ パラメータについては、HtmlHelper::link() を参照。

Tags
checked
noTodo
unitTest
doc

afterRender()

After Render

public afterRender(Event $event) : mixed
Parameters
$event : Event
Tags
checked

baseUrl()

ベースとなるURLを出力する

public baseUrl() : void

サブフォルダやスマートURLについて考慮されている事が前提

Tags
checked
noTodo

blogDescriptionExists()

public blogDescriptionExists() : bool
Return values
bool

blogPostCategory()

public blogPostCategory(BlogPost $post, array<string|int, mixed> $options = []) : void
Parameters
$post : BlogPost
$options = [] : array<string|int, mixed>

blogPostContent()

public blogPostContent(BlogPost $post, bool $moreText = true, bool $moreLink = false, bool $cut = false, bool $lastText = false) : void
Parameters
$post : BlogPost
$moreText = true : bool
$moreLink = false : bool
$cut = false : bool
$lastText = false : bool

blogPostEyeCatch()

public blogPostEyeCatch(BlogPost $post, array<string|int, mixed> $options = []) : void
Parameters
$post : BlogPost
$options = [] : array<string|int, mixed>
public blogPostNextLink(BlogPost $post, string $title = '', array<string|int, mixed> $htmlAttributes = []) : void

MailHelper

Parameters
$post : BlogPost
$title = '' : string
$htmlAttributes = [] : array<string|int, mixed>
public blogPostPrevLink(BlogPost $post, string $title = '', array<string|int, mixed> $htmlAttributes = []) : void
Parameters
$post : BlogPost
$title = '' : string
$htmlAttributes = [] : array<string|int, mixed>

blogPosts()

public blogPosts(string $contentsName = [], int $num = 5, array<string|int, mixed> $options = []) : void
Parameters
$contentsName = [] : string
$num = 5 : int
$options = [] : array<string|int, mixed>

blogPostTitle()

public blogPostTitle(BlogPost $post, bool $link = true, array<string|int, mixed> $options = []) : void
Parameters
$post : BlogPost
$link = true : bool
$options = [] : array<string|int, mixed>

blogTagList()

public blogTagList(string $name, array<string|int, mixed> $options = []) : void
Parameters
$name : string
$options = [] : array<string|int, mixed>

cacheHeader()

ブラウザにキャッシュさせる為のヘッダーを出力する

public cacheHeader([string|int|float $expire = null ][, string $type = 'html' ]) : void
Parameters
$expire : string|int|float = null

キャッシュの有効期間(初期値 : null) ※ 指定しない場合は、baserCMSコアのキャッシュ設定値

$type : string = 'html'

どのタイプ(拡張子)に対してのキャッシュか(初期値 : 'html')

charset()

charset メタタグを出力する

public charset([string $charset = null ]) : void

モバイルの場合は、強制的に文字コードを Shift-JIS に設定

Parameters
$charset : string = null

文字コード(初期値 : null)

Tags
checked
noTodo

content()

コンテンツ本体を出力する

public content() : void

レイアウトテンプレートで利用する

Tags
checked
noTodo

contentsMenu()

コンテンツメニューを出力する

public contentsMenu([mixed $id = null ][, int $level = null ][, string $currentId = null ]) : void

ログインしていない場合はキャッシュする contents_menu エレメントで、HTMLカスタマイズ可能

Parameters
$id : mixed = null

コンテンツID(初期値:null)

$level : int = null

階層(初期値:null)※ null の場合は階層指定なし

$currentId : string = null

現在のページのコンテンツID(初期値:null)

Tags
doc
checked
noTodo

contentsName()

コンテンツを特定する文字列を出力する

public contentsName([bool $detail = false ][, array<string|int, mixed> $options = [] ]) : void

URL を元に、第一階層までの文字列をキャメルケースで取得する ※ 利用例、出力例については BcBaserHelper::getContentsName() を参照

Parameters
$detail : bool = false

詳細モード true にした場合は、ページごとに一意となる文字列をキャメルケースで出力する(初期値 : false)

$options : array<string|int, mixed> = []

オプション(初期値 : array()) ※ オプションの詳細については、BcBaserHelper::getContentsName() を参照

Tags
checked
noTodo
unitTest
doc

contentsNavi()

コンテンツナビを出力する

public contentsNavi([array<string|int, mixed> $data = [] ][, array<string|int, mixed> $options = [] ]) : void
Parameters
$data : array<string|int, mixed> = []

読み込むテンプレートに引き継ぐパラメータ(初期値 : array())

$options : array<string|int, mixed> = []

オプション(初期値 : array()) ※ その他のパラメータについては、View::element() を参照

Tags
checked
noTodo
unitTest

contentsTitle()

コンテンツのタイトルを出力する

public contentsTitle() : void
Tags
checked
noTodo
unitTest

copyYear()

コピーライト用の年を出力する

public copyYear(int $begin) : void

《利用例》 $this->BcBaser->copyYear(2012)

《出力例》 2012 - 2014

Parameters
$begin : int

開始年

Tags
checked
noTodo

createForm()

public createForm(mixed $context, array<string|int, mixed> $options = []) : string
Parameters
$context : mixed
$options = [] : array<string|int, mixed>
Return values
string

createMailForm()

public createMailForm(mixed $context, mixed $options) : string
Parameters
$context : mixed
$options : mixed
Return values
string

crumbs()

パンくずリストを出力する

public crumbs([string $separator = '&raquo;' ][, string|bool $startText = false ][, mixed $onSchema = false ]) : void

事前に BcBaserHelper::addCrumb() にて、パンくず情報を追加しておく必要がある。 また、アクセス制限がかかっているリンクはテキストのみ表示する

Parameters
$separator : string = '&raquo;'

パンくずの区切り文字(初期値 : »)

$startText : string|bool = false

トップページを先頭に追加する場合にはトップページのテキストを指定する(初期値 : false)

$onSchema : mixed = false
Tags
checked
noTodo
unitTest
doc

crumbsList()

パンくずリストを出力する

public crumbsList([array<string|int, mixed> $data = [] ][, array<string|int, mixed> $options = [] ]) : void
Parameters
$data : array<string|int, mixed> = []

読み込むテンプレートに引き継ぐパラメータ(初期値 : array())

$options : array<string|int, mixed> = []

オプション(初期値 : array()) ※ その他のパラメータについては、View::element() を参照

Tags
checked
noTodo
unitTest
doc

css()

CSS タグを出力する

public css(mixed $path[, bool $inline = true ][, mixed $options = [] ]) : string|void

《利用例》 $this->BcBaser->css('admin/import')

Parameters
$path : mixed

CSSファイルのパス(css フォルダからの相対パス)拡張子は省略可

$inline : bool = true

コンテンツ内に Javascript を出力するかどうか(初期値 : true)

$options : mixed = []

オプション ※💣inline=false→block=trueに変更になったため注意

Tags
checked
unitTest
noTodo
doc
see
https://book.cakephp.org/4/ja/views/helpers/html.html#css

※ その他のパラメータについては、HtmlHelper::css() を参照。

下記のbasercms4系引数は残したまま

  • 'inline'=trueを指定する (代替:$options['block']にnullが入る)
  • 'inline'=falseを指定する (代替:$options['block']にtrueが入る)
Return values
string|void

customEntryTitle()

public customEntryTitle(CustomEntry $entry, array<string|int, mixed> $options = []) : void
Parameters
$entry : CustomEntry
$options = [] : array<string|int, mixed>

customSearchControl()

public customSearchControl(CustomLink $customLink, array<string|int, mixed> $options = []) : string
Parameters
$customLink : CustomLink
$options = [] : array<string|int, mixed>
Return values
string

declarationI18n()

i18n 用の変数を宣言する

public declarationI18n() : string
Tags
checked
noTodo
unitTest

ラッパーメソッドのためユニットテスト不要

Return values
string

dispatchLayerEvent()

イベントを発火

public dispatchLayerEvent(string $name[, array<string|int, mixed> $data = [] ][, mixed $options = [] ]) : bool|Event
Parameters
$name : string
$data : array<string|int, mixed> = []
$options : mixed = []
Tags
checked
unitTest
noTodo
Return values
bool|Event

element()

エレメントテンプレートを出力する

public element(string $name[, array<string|int, mixed> $data = [] ][, array<string|int, mixed> $options = [] ]) : void
Parameters
$name : string

エレメント名

$data : array<string|int, mixed> = []

エレメントで参照するデータ

$options : array<string|int, mixed> = []

オプションのパラメータ subDir (boolean) エレメントのパスについてプレフィックスによるサブディレクトリを追加するかどうか ※ その他のパラメータについては、View::element() を参照

Tags
checked
noTodo
unitTest
doc

endForm()

public endForm(array<string|int, mixed> $secureAttributes = []) : string
Parameters
$secureAttributes = [] : array<string|int, mixed>
Return values
string

endMailForm()

public endMailForm(array<string|int, mixed> $secureAttributes = []) : string
Parameters
$secureAttributes = [] : array<string|int, mixed>
Return values
string

flash()

セッションに保存したメッセージを出力する

public flash([string $key = 'flash' ]) : void

メールフォームのエラーメッセージ等を出力します。

Parameters
$key : string = 'flash'

出力するメッセージのキー(初期状態では省略可)

Tags
checked
noTodo
unitTest
doc

フッターテンプレートを出力する

public footer([array<string|int, mixed> $data = [] ][, array<string|int, mixed> $options = [] ]) : void
Parameters
$data : array<string|int, mixed> = []

エレメントで参照するデータ

$options : array<string|int, mixed> = []

オプションのパラメータ subDir (boolean) エレメントのパスについてプレフィックスによるサブディレクトリを追加するかどうか ※ その他のパラメータについては、View::element() を参照

Tags
checked
noTodo

formControl()

public formControl(string $fieldName, array<string|int, mixed> $options = []) : string
Parameters
$fieldName : string
$options = [] : array<string|int, mixed>
Return values
string

formError()

public formError(string $field, mixed $text, array<string|int, mixed> $options = []) : string
Parameters
$field : string
$text : mixed
$options = [] : array<string|int, mixed>
Return values
string

formHidden()

public formHidden(string $fieldName, array<string|int, mixed> $options = []) : string
Parameters
$fieldName : string
$options = [] : array<string|int, mixed>
Return values
string

formLabel()

public formLabel(string $fieldName, string|null $text = null, array<string|int, mixed> $options = []) : string

HtmlHelper

Parameters
$fieldName : string
$text = null : string|null
$options = [] : array<string|int, mixed>
Return values
string

formSubmit()

public formSubmit(string|null $caption = null, array<string|int, mixed> $options = []) : string
Parameters
$caption = null : string|null
$options = [] : array<string|int, mixed>
Return values
string

func()

ツールバーエレメントや CakePHP のデバッグ出力を表示

public func() : void

利用する際は、 タグの直前あたりに記述する。

Tags
checked
noTodo

getBaseUrl()

ベースとなるURLを取得する

public getBaseUrl() : string

サブフォルダやスマートURLについて考慮されている事が前提

Tags
checked
noTodo
unitTest
Return values
string

ベースURL

getBlogCategories()

public getBlogCategories(array<string|int, mixed> $options = []) : array<string|int, mixed>
Parameters
$options = [] : array<string|int, mixed>
Return values
array<string|int, mixed>

getBlogContentsUrl()

public getBlogContentsUrl(int $blogContentId, mixed $base) : string
Parameters
$blogContentId : int
$base : mixed
Return values
string

getBlogPostContent()

public getBlogPostContent(BlogPost $post, bool $moreText = true, bool $moreLink = false, bool $cut = false, bool $lastText = false) : string
Parameters
$post : BlogPost
$moreText = true : bool
$moreLink = false : bool
$cut = false : bool
$lastText = false : bool
Return values
string

getBlogPostCount()

public getBlogPostCount() : int
Return values
int

getBlogPostLinkUrl()

public getBlogPostLinkUrl(BlogPost $post, bool $base = true, bool $full = true) : string
Parameters
$post : BlogPost
$base = true : bool
$full = true : bool
Return values
string

getBlogPosts()

public getBlogPosts(string $contentsName = [], int $num = 5, array<string|int, mixed> $options = []) : string
Parameters
$contentsName = [] : string
$num = 5 : int
$options = [] : array<string|int, mixed>
Return values
string

getBlogs()

public getBlogs(string $name = '', array<string|int, mixed> $options = []) : array<string|int, mixed>
Parameters
$name = '' : string
$options = [] : array<string|int, mixed>
Return values
array<string|int, mixed>

getBlogTagList()

public getBlogTagList(string $name, array<string|int, mixed> $options = []) : array<string|int, mixed>
Parameters
$name : string
$options = [] : array<string|int, mixed>
Return values
array<string|int, mixed>

getBlogTitle()

public getBlogTitle() : string
Return values
string

getContentByEntityId()

エンティティIDからコンテンツの情報を取得

public getContentByEntityId(int $id, string $contentType[, string $field = null ]) : array<string|int, mixed>
Parameters
$id : int

エンティティID

$contentType : string

コンテンツタイプ ('Page','MailContent','BlogContent','ContentFolder')

$field : string = null

取得したい値 'name','url','title'など 初期値:Null 省略した場合配列を取得

Tags
checked
noTodo
unitTest

ラッパーメソッドのためユニットテスト不要

Return values
array<string|int, mixed>

or bool

getContentCreatedDate()

コンテンツ作成日を取得

public getContentCreatedDate([mixed $format = 'Y/m/d H:i' ]) : null|string
Parameters
$format : mixed = 'Y/m/d H:i'
Tags
checked
noTodo
unitTest
doc
Return values
null|string

getContentModifiedDate()

コンテンツ更新日を取得

public getContentModifiedDate([string $format = 'Y/m/d H:i' ]) : null|string
Parameters
$format : string = 'Y/m/d H:i'
Tags
checked
noTodo
unitTest
doc
Return values
null|string

getContentsMenu()

メニューを出力する

public getContentsMenu([mixed $id = null ][, int $level = null ][, string $currentId = null ][, array<string|int, mixed> $options = [] ]) : string

ログインしていない場合はキャッシュする contents_menu エレメントで、HTMLカスタマイズ可能

Parameters
$id : mixed = null

コンテンツID(初期値:null)

$level : int = null

階層(初期値:null)※ null の場合は階層指定なし

$currentId : string = null

現在のページのコンテンツID(初期値:null)

$options : array<string|int, mixed> = []

オプション(初期値 : [])

  • tree : ツリーデータを指定する
  • currentId : 現在表示しているページのID
    • excludeIndex : インデックスページを除外しない場合に false を指定
    • cache : キャッシュを有効にする場合に true を指定 ※ その他のパラメータについては、View::element() を参照
Tags
checked
noTodo
unitTest
doc
Return values
string

コンテンツメニュー

getContentsName()

コンテンツを特定する文字列を取得する

public getContentsName([bool $detail = false ][, array<string|int, mixed> $options = [] ]) : string

URL を元に、第一階層までの文字列をキャメルケースで取得する

《利用例》 $this->BcBaser->contentsName()

《出力例》

  • トップページの場合 : Home
  • about ページの場合 : About
Parameters
$detail : bool = false

詳細モード true にした場合は、ページごとに一意となる文字列をキャメルケースで取得する(初期値 : false)

$options : array<string|int, mixed> = []

オプション(初期値 : array())

  • home : トップページの場合に出力する文字列(初期値 : Home)
  • default : ルート直下の下層ページの場合に出力する文字列(初期値 : Default)
  • error : エラーページの場合に出力する文字列(初期値 : Error)
  • underscore : キャメルケースではなく、アンダースコア区切りで出力する(初期値 : false)
Tags
checked
unitTest
noTodo
doc
Return values
string

getContentsTitle()

表示しているページのコンテンツタイトルを取得する

public getContentsTitle() : string

コンテンツタイトルは、BcBaserHelper->setTitle() でセットする

Tags
checked
noTodo
unitTest
Return values
string

コンテンツタイトル

getContentsUrl()

コンテンツ管理用のURLより、正式なURLを取得する

public getContentsUrl([string $url = null ][, bool $full = false ][, bool $useSubDomain = null ][, bool $base = true ]) : string
Parameters
$url : string = null

コンテンツ管理用URLの元データ 省略時は request より現在のデータを取得 request が取得できない場合は、トップページのURLを設定

$full : bool = false

http からのフルのURLかどうか

$useSubDomain : bool = null

サブドメインを利用しているかどうか 省略時は現在のサイト情報から取得する

$base : bool = true

$full が false の場合、ベースとなるURLを含めるかどうか

Tags
checked
noTodo
Return values
string

getCrumbs()

パンくず用の配列を取得する

public getCrumbs([mixed $categoryTitleOn = null ]) : array<string|int, mixed>

基本的には、コントローラーの crumbs プロパティで設定した値を取得する仕様だが 事前に setCategoryTitle メソッドで出力内容をカスタマイズする事ができる

Parameters
$categoryTitleOn : mixed = null

親カテゴリの階層を表示するかどうか

Tags
todo

HTMLレンダリングも含めた状態で取得できる、HtmlHelper::getCrumbs() とメソッド名が 同じで、 処理内容がわかりにくいので変数名のリファクタリング要。 ただし、BcBaserHelper::getCrumbs() は、テーマで利用されている可能性が高いので、 後方互換を考慮する必要がある。

checked
noTodo
unitTest
doc
Return values
array<string|int, mixed>

パンくず用の配列

getCurrentPrefix()

現在のサイトプレフィックスを取得する

public getCurrentPrefix() : string
Tags
checked
noTodo
Return values
string

getCustomFieldTitle()

public getCustomFieldTitle(mixed $entry, string $fieldName) : string
Parameters
$entry : mixed
$fieldName : string
Return values
string

getCustomFieldValue()

public getCustomFieldValue(mixed $entry, string $fieldName, array<string|int, mixed> $options = []) : string|array<string|int, mixed>

TextHelper

Parameters
$entry : mixed
$fieldName : string
$options = [] : array<string|int, mixed>
Return values
string|array<string|int, mixed>
public getCustomLinks(int $tableId, bool $isThreaded = true) : ResultSet
Parameters
$tableId : int
$isThreaded = true : bool
Return values
ResultSet

getDescription()

meta タグ用のページ説明文を取得する

public getDescription() : string
Tags
checked
noTodo
Return values
string

meta タグ用の説明文

getElement()

エレメントテンプレートのレンダリング結果を取得する

public getElement(string $name[, array<string|int, mixed> $data = [] ][, array<string|int, mixed> $options = [] ]) : string
Parameters
$name : string

エレメント名

$data : array<string|int, mixed> = []

エレメントで参照するデータ

$options : array<string|int, mixed> = []

オプションのパラメータ subDir (boolean) エレメントのパスについてプレフィックスによるサブディレクトリを追加するかどうか ※ その他のパラメータについては、View::element() を参照

Tags
checked
unitTest
noTodo
doc
Return values
string

エレメントのレンダリング結果

getFullUrl()

フルURLに変換する

public getFullUrl(string $url) : string
Parameters
$url : string
Tags
checked
checked
noTodo
noTodo
unitTest

ラッパーメソッドのためユニットテスト不要

Return values
string

getGlobalMenu()

グローバルメニューを取得する

public getGlobalMenu([array<string|int, mixed> $level = 5 ][, array<string|int, mixed> $options = [] ]) : string
Parameters
$level : array<string|int, mixed> = 5

取得する階層(初期値 : 1)

$options : array<string|int, mixed> = []

オプション(初期値 : array()) ※ その他のパラメータについては、View::element() を参照

Tags
checked
noTodo
Return values
string

getGoogleMaps()

Google Maps を取得する

public getGoogleMaps([array<string|int, mixed> $data = [] ]) : string
Parameters
$data : array<string|int, mixed> = []

読み込むテンプレートに引き継ぐパラメータ(初期値 : array())

Tags
noTodo
checked
unitTest

ラッパーメソッドに付きテスト不要

Return values
string

getHere()

現在のページの純粋なURLを取得する

public getHere() : string

スマートURL、サブフォルダかどうかに依存しない、スラッシュから始まるURLを取得

Tags
checked
noTodo
Return values
string

URL

getImg()

画像タグを取得する

public getImg(mixed $path[, array<string|int, mixed> $options = [] ]) : string
Parameters
$path : mixed

画像のパス(img フォルダからの相対パス)

$options : array<string|int, mixed> = []

オプション(主にHTML属性) ※ パラメータについては、HtmlHelper::image() を参照。

Tags
checked
noTodo
unitTest
doc
Return values
string

画像タグ

getKeywords()

meta タグ用のキーワードを取得する

public getKeywords() : string
Tags
checked
noTodo
Return values
string

meta タグ用のキーワード

アンカータグを取得する

public getLink(string $title[, mixed $url = null ][, array<string|int, mixed> $options = [] ][, bool $confirmMessage = false ]) : string
Parameters
$title : string

タイトル

$url : mixed = null

オプション(初期値 : null)

$options : array<string|int, mixed> = []

オプション(初期値 : array())

  • escape : タイトルとHTML属性をエスケープするかどうか(初期値 : true)
  • escapeTitle : タイトルをエスケープするかどうか(初期値 : true)
  • prefix : URLにプレフィックスをつけるかどうか(初期値 : false)
  • forceTitle : 許可されていないURLの際にタイトルを強制的に出力するかどうか(初期値 : false)
  • ssl : SSL用のURLをして出力するかどうか(初期値 : false)
  • enabled : リンクが有効かどうか(初期値 : true) ※ その他のパラメータについては、HtmlHelper::image() を参照。
$confirmMessage : bool = false

確認メッセージ(初期値 : false) リンクをクリックした際に確認メッセージが表示され、はいをクリックした場合のみ遷移する

Tags
checked
unitTest
noTodo
doc
Return values
string

getMailFormGroupValidErrors()

public getMailFormGroupValidErrors(array<string|int, mixed> $mailFields, string $groupValid, array<string|int, mixed> $options = [], bool $distinct = true) : array<string|int, mixed>
Parameters
$mailFields : array<string|int, mixed>
$groupValid : string
$options = [] : array<string|int, mixed>
$distinct = true : bool
Return values
array<string|int, mixed>

getMailFormSourceValue()

public getMailFormSourceValue(string $fieldname, array<string|int, mixed> $options = []) : mixed
Parameters
$fieldname : string
$options = [] : array<string|int, mixed>

getParams()

パラメータ情報を取得する

public getParams() : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

パラメータ情報の配列

getParentContent()

public getParentContent(int $id = null, bool $direct = true) : EntityInterface
Parameters
$id = null : int
$direct = true : bool
Return values
EntityInterface

getParentFolder()

親フォルダを取得する

public getParentFolder(int $id[, bool $direct = true ]) : mixed
  • 引数なしで現在のコンテンツの親情報を取得
  • $id を指定して取得する事ができる
  • $direct を false に設定する事で、最上位までの親情報を取得
Parameters
$id : int
$direct : bool = true
Tags
checked
noTodo
unitTest

ラッパーメソッドのためユニットテスト不要

Return values
mixed

false|array

getPluginBaser()

Plugin 内の Baserヘルパを取得する

public getPluginBaser(string $name) : bool|mixed
Parameters
$name : string
Tags
checked
noTodo
Return values
bool|mixed

Plugin 内の Baserヘルパ

関連サイトのリンク一覧を取得

public getRelatedSiteLinks([int $id = null ][, mixed $excludeIds = [] ]) : mixed
Parameters
$id : int = null

コンテンツID

$excludeIds : mixed = []
Tags
checked
noTodo

getService()

Get Service

public getService( $service) : array<string|int, mixed>|mixed|object
Parameters
$service :
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>|mixed|object

getSitemap()

サイトマップを取得する

public getSitemap([int $siteId = 0 ]) : string

ログインしていない場合はキャッシュする

Parameters
$siteId : int = 0

サイトID

Tags
checked
noTodo
Return values
string

サイトマップ

getSiteName()

Webサイト名を取得する

public getSiteName() : string
Tags
checked
noTodo
Return values
string

サイト基本設定のWebサイト名

getSitePrefix()

現在のサイトのプレフィックスを取得する

public getSitePrefix() : string|false
Tags
checked
noTodo
Return values
string|false

getSiteSearchForm()

サイト内検索フォームを取得

public getSiteSearchForm([array<string|int, mixed> $data = [] ][, array<string|int, mixed> $options = [] ]) : string
Parameters
$data : array<string|int, mixed> = []

読み込むテンプレートに引き継ぐパラメータ(初期値 : array())

$options : array<string|int, mixed> = []

オプション(初期値 : array()) ※ その他のパラメータについては、View::element() を参照

Tags
checked
noTodo
Return values
string

getSiteUrl()

WebサイトURLを取得する

public getSiteUrl([mixed $ssl = false ]) : string
Parameters
$ssl : mixed = false
Tags
checked
noTodo
Return values
string

サイト基本設定のWebサイト名

getThemeUrl()

現在のテーマのURLを取得する

public getThemeUrl() : string
Tags
checked
noTodo
unitTest
doc
Return values
string

テーマのURL

getTitle()

タイトルタグを取得する

public getTitle([string $separator = '|' ][, array<string|int, mixed> $options = [] ]) : string

ページタイトルと直属のカテゴリ名が同じ場合は、ページ名を省略する version 3.0.10 より第2引数 $categoryTitleOn は、 $options にまとめられました。 後方互換のために第2引数に配列型以外を指定された場合は、 $categoryTitleOn として取り扱います。

Parameters
$separator : string = '|'

区切り文字

$options : array<string|int, mixed> = []

categoryTitleOn カテゴリタイトルを表示するかどうか boolean で指定 (初期値 : null) tag (boolean) false でタグを削除するかどうか (初期値 : true) allowableTags tagが falseの場合、削除しないタグを指定できる。詳しくは、php strip_tags のドキュメントを参考してください。 (初期値 : '')

Tags
checked
noTodo
Return values
string

メタタグ用のタイトルを返す

getUpdateInfo()

更新情報を取得する

public getUpdateInfo() : mixed
Tags
checked
noTodo
unitTest
doc

getUri()

プロトコルから始まるURLを取得する

public getUri(mixed $url) : string

《利用例》 $this->BcBaser->getUri('/about')

《出力例》 http://localhost/about

Parameters
$url : mixed

文字列のURL、または、配列形式のURL

Tags
checked
noTodo
Return values
string

プロトコルから始まるURL

getUrl()

baserCMSの設置フォルダを考慮したURLを取得する

public getUrl([mixed $url = null ][, bool $full = false ][, mixed $options = [] ]) : string

《利用例》 会社概要

Parameters
$url : mixed = null

baserCMS設置フォルダからの絶対URL、もしくは配列形式のURL情報 省略した場合には、PC用のトップページのURLを取得する

$full : bool = false

httpから始まるURLを取得するかどうか

$options : mixed = []
Tags
checked
unitTest
noTodo
Return values
string

URL

getUrlParams()

URL情報を取得する

public getUrlParams() : array<string|int, mixed>
Tags
checked
noTodo
unitTest
Return values
array<string|int, mixed>

URL情報の配列

getUserName()

ユーザー名を整形して取得する

public getUserName(EntityInterface $user) : string

姓と名を結合して取得 ニックネームがある場合にはニックネームを優先する

Parameters
$user : EntityInterface

ユーザーデータ

Tags
checked
noTodo
unitTest
doc
Return values
string

$userName ユーザー名

getWidgetArea()

public getWidgetArea(int $no = null, array<string|int, mixed> $options = []) : string
Parameters
$no = null : int
$options = [] : array<string|int, mixed>
Return values
string

globalMenu()

グローバルメニューを出力する

public globalMenu([array<string|int, mixed> $level = 1 ][, array<string|int, mixed> $options = [] ]) : void
Parameters
$level : array<string|int, mixed> = 1

取得する階層(初期値 : 1)

$options : array<string|int, mixed> = []

オプション(初期値 : array()) ※ その他のパラメータについては、View::element() を参照

Tags
checked
noTodo

googleAnalytics()

Google Analytics のトラッキングコードを出力する

public googleAnalytics([array<string|int, mixed> $data = [] ][, array<string|int, mixed> $options = [] ]) : void
Parameters
$data : array<string|int, mixed> = []

読み込むテンプレートに引き継ぐパラメータ(初期値 : array())

$options : array<string|int, mixed> = []

オプション(初期値 : array()) ※ その他のパラメータについては、View::element() を参照

Tags
checked
noTodo

googleMaps()

Google Maps を出力する

public googleMaps([array<string|int, mixed> $data = [] ]) : void
Parameters
$data : array<string|int, mixed> = []

読み込むテンプレートに引き継ぐパラメータ(初期値 : array())

Tags
noTodo
checked
unitTest

ラッパーメソッドに付きテスト不要

hasChildBlogCategory()

public hasChildBlogCategory(int $id) : bool
Parameters
$id : int
Return values
bool

hasService()

Has Service

public hasService( $service) : bool
Parameters
$service :
Tags
checked
noTodo
unitTest
Return values
bool

header()

ヘッダーテンプレートを出力する

public header([array<string|int, mixed> $data = [] ][, array<string|int, mixed> $options = [] ]) : void
Parameters
$data : array<string|int, mixed> = []

エレメントで参照するデータ

$options : array<string|int, mixed> = []

オプションのパラメータ subDir (boolean) エレメントのパスについてプレフィックスによるサブディレクトリを追加するかどうか ※ その他のパラメータについては、View::element() を参照

Tags
checked
noTodo

i18nScript()

JavaScript に、翻訳データを引き渡す `bcI18n.キー名` で参照可能 (例)bcI18n.alertMessage

public i18nScript(mixed $data[, mixed $options = [] ]) : mixed
Parameters
$data : mixed
$options : mixed = []
Tags
checked
unitTest
noTodo

icon()

アイコン(favicon)タグを出力する

public icon() : void
Tags
checked
noTodo

img()

画像タグを出力する

public img(string|array<string|int, mixed> $path[, array<string|int, mixed> $options = [] ]) : void
Parameters
$path : string|array<string|int, mixed>

画像のパス(img フォルダからの相対パス)

$options : array<string|int, mixed> = []

オプション(主にHTML属性) ※ パラメータについては、HtmlHelper::image() を参照。

Tags
checked
noTodo
unitTest
doc

initialize()

initialize

public initialize(array<string|int, mixed> $config) : void
Parameters
$config : array<string|int, mixed>
Tags
checked
noTodo
unitTest

isAdminUser()

管理者グループかどうかチェックする

public isAdminUser([array<string|int, mixed>|User $user = null ]) : bool
Parameters
$user : array<string|int, mixed>|User = null

ユーザー(初期値 : null)※ 指定しない場合は、現在のログインユーザーについてチェックする

Tags
checked
noTodo
unitTest
doc
Return values
bool

管理者グループの場合は true を返す

isBlogCategory()

public isBlogCategory() : bool
Return values
bool

isBlogSingle()

public isBlogSingle() : bool
Return values
bool

isCategoryTop()

現在のページがページカテゴリのトップかどうかを判定する 判定は、URLからのみで行う

public isCategoryTop() : bool
Tags
checked
noTodo
Return values
bool

カテゴリトップの場合は、 true を返す

isContentFolder()

現在のページがコンテンツフォルダかどうか確認する

public isContentFolder() : bool
Tags
checked
noTodo
unitTest

ラッパーメソッドのためユニットテスト不要

Return values
bool

isContentsParentId()

IDがコンテンツ自身の親のIDかを判定する

public isContentsParentId(int|null $id, int $parentId) : bool
Parameters
$id : int|null

コンテンツ自身のID

$parentId : int

親として判定するID

Tags
checked
noTodo
unitTest

ラッパーメソッドのためユニットテスト不要

Return values
bool

isCurrentUrl()

指定したURLが現在のURLと同じかどうか判定する

public isCurrentUrl(string $url) : bool

《比較例》 /news/ | /news/ ・・・○ /news | /news/ ・・・× /news/ | /news/index ・・・○

Parameters
$url : string

比較対象URL

Tags
checked
noTodo
Return values
bool

同じ場合には true を返す

isDebug()

デバッグモードかどうか

public isDebug() : bool
Tags
checked
checked
noTodo
noTodo
unitTest

ラッパーメソッドのためユニットテスト不要

Return values
bool

isDisplayCustomEntrySearch()

public isDisplayCustomEntrySearch(CustomLink $customLink, string $type = 'front') : bool
Parameters
$customLink : CustomLink
$type = 'front' : string
Return values
bool

isHome()

現在のページがトップページかどうかを判定する

public isHome() : bool

MEMO: BcRequest.(agent).aliasは廃止

Tags
checked
noTodo
unitTest
doc
Return values
bool

isLinkEnabled()

リンクが有効化どうか

public isLinkEnabled(string $link) : true

ログインしているユーザーの権限によって判定する

Parameters
$link : string
Tags
noTodo
checked
Return values
true

isMail()

public isMail() : bool

MailHelper

BlogHelper

Return values
bool

isMailFormGroupLastField()

public isMailFormGroupLastField(ResultSet $mailFields, MailField $currentMailField) : bool
Parameters
$mailFields : ResultSet
$currentMailField : MailField
Return values
bool

isPage()

現在のページが固定ページかどうかを判定する

public isPage() : bool
Tags
checked
noTodo
unitTest
doc
Return values
bool

固定ページの場合は true を返す

isPluginLoaded()

プラグインがロードされているか判定する

public isPluginLoaded(string $plugin) : bool
Parameters
$plugin : string
Tags
checked
checked
noTodo
noTodo
unitTest

ラッパーメソッドのためユニットテスト不要

Return values
bool

isSSL()

SSL通信かどうか判定する

public isSSL() : bool
Tags
checked
unitTest
noTodo
doc
Return values
bool

js()

Javascript タグを出力する

public js(string|array<string|int, mixed> $path[, bool $inline = true ][, mixed $options = [] ]) : void
Parameters
$path : string|array<string|int, mixed>

Javascriptのパス(js フォルダからの相対パス)拡張子は省略可

$inline : bool = true

コンテンツ内に Javascript を出力するかどうか(初期値 : true)

$options : mixed = []
Tags
checked
noTodo
unitTest
doc

アンカータグを出力する

public link(string $title[, mixed $url = null ][, array<string|int, mixed> $htmlAttributes = [] ][, string $confirmMessage = false ]) : void
Parameters
$title : string

タイトル

$url : mixed = null

オプション(初期値 : null)

$htmlAttributes : array<string|int, mixed> = []

オプション(初期値 : array())

  • escape : タイトルとHTML属性をエスケープするかどうか(初期値 : true)
  • escapeTitle : タイトルをエスケープするかどうか(初期値 : true)
  • prefix : URLにプレフィックスをつけるかどうか(初期値 : false)
  • forceTitle : 許可されていないURLの際にタイトルを強制的に出力するかどうか(初期値 : false)
  • ssl : SSL用のURLをして出力するかどうか(初期値 : false) ※ その他のパラメータについては、HtmlHelper::link() を参照。
$confirmMessage : string = false

確認メッセージ(初期値 : false) リンクをクリックした際に確認メッセージが表示され、はいをクリックした場合のみ遷移する

Tags
checked
noTodo
unitTest
doc

listNum()

表示件数設定機能を出力する

public listNum([array<string|int, mixed> $data = [] ][, array<string|int, mixed> $options = [] ]) : void
Parameters
$data : array<string|int, mixed> = []

読み込むテンプレートに引き継ぐパラメータ(初期値 : array())

$options : array<string|int, mixed> = []

オプション(初期値 : array()) ※ その他のパラメータについては、View::element() を参照

Tags
checked
noTodo
public logo(array<string|int, mixed> $options = []) : void

BcWidgetAreaHelper

Parameters
$options = [] : array<string|int, mixed>

mailFormAuthCaptcha()

public mailFormAuthCaptcha(string $fieldName, array<string|int, mixed> $options = []) : void
Parameters
$fieldName : string
$options = [] : array<string|int, mixed>

mailFormControl()

public mailFormControl(string $fieldName, array<string|int, mixed> $options = []) : string
Parameters
$fieldName : string
$options = [] : array<string|int, mixed>
Return values
string

mailFormDescription()

public mailFormDescription() : void

MailformHelper

mailFormDescriptionExists()

public mailFormDescriptionExists() : bool
Return values
bool

mailFormError()

public mailFormError(string $field, mixed $text, array<string|int, mixed> $options = []) : string
Parameters
$field : string
$text : mixed
$options = [] : array<string|int, mixed>
Return values
string

mailFormHidden()

public mailFormHidden(mixed $fieldName, mixed $options) : string
Parameters
$fieldName : mixed
$options : mixed
Return values
string

mailFormLabel()

public mailFormLabel(string $fieldName, string|null $text = null, array<string|int, mixed> $options = []) : string

BcUploadHelper

Parameters
$fieldName : string
$text = null : string|null
$options = [] : array<string|int, mixed>
Return values
string

mailFormSubmit()

public mailFormSubmit(string $caption = null, array<string|int, mixed> $options = []) : string
Parameters
$caption = null : string
$options = [] : array<string|int, mixed>
Return values
string

mainImage()

public mainImage(array<string|int, mixed> $options = []) : void
Parameters
$options = [] : array<string|int, mixed>

mark()

文字列を検索しマークとしてタグをつける

public mark(string|array<string|int, mixed> $search, string $text[, string $name = 'strong' ][, array<string|int, mixed> $attributes = [] ][, bool $escape = false ]) : string

《利用例》 $this->BcBaser->mark('強調', '強調します強調します強調します')

《取得例》 強調します強調します強調します

Parameters
$search : string|array<string|int, mixed>

検索文字列

$text : string

検索対象文字列

$name : string = 'strong'

マーク用タグ(初期値 : strong)

$attributes : array<string|int, mixed> = []

タグの属性(初期値 : array())

$escape : bool = false

エスケープ有無(初期値 : false)

Tags
todo

TextHelperに移行を検討

checked
noTodo
Return values
string

$text 変換後文字列

meta()

public meta(mixed $type, mixed $content, array<string|int, mixed> $options = []) : string

CustomContentHelper

Parameters
$type : mixed
$content : mixed
$options = [] : array<string|int, mixed>
Return values
string

metaDescription()

ページ説明文用のメタタグを出力する

public metaDescription() : void
Tags
checked
noTodo

metaKeywords()

キーワード用のメタタグを出力する

public metaKeywords() : void
Tags
checked
noTodo

page()

固定ページをエレメントとして読み込む

public page(string $url[, array<string|int, mixed> $params = [] ][, array<string|int, mixed> $options = [] ]) : void

※ レイアウトは読み込まずコンテンツ本体のみを読み込む

Parameters
$url : string

固定ページのURL

$params : array<string|int, mixed> = []

固定ページに引き継ぐパラメータ(初期値 : array())

$options : array<string|int, mixed> = []

オプション(初期値 : array())

  • subDir : テンプレートの配置場所についてプレフィックスに応じたサブフォルダを利用するかどうか(初期値 : true)
  • recursive : 固定ページ読み込みを再帰的に読み込むかどうか(初期値 : true)
  • checkExists : 固定ページの存在判定をするかどうか(初期値 : true)
Tags
checked
noTodo

pagination()

ページネーションを出力する

public pagination([string $name = 'default' ][, array<string|int, mixed> $data = [] ][, array<string|int, mixed> $options = [] ]) : void
Parameters
$name : string = 'default'
$data : array<string|int, mixed> = []

ページネーションで参照するデータ

$options : array<string|int, mixed> = []

オプションのパラメータ subDir (boolean) エレメントのパスについてプレフィックスによるサブディレクトリを追加するかどうか ※ その他のパラメータについては、View::element() を参照

Tags
checked
noTodo

関連サイトのリンク一覧を表示

public relatedSiteLinks([int $id = null ][, mixed $excludeIds = [] ]) : mixed
Parameters
$id : int = null

コンテンツID

$excludeIds : mixed = []
Tags
checked
noTodo

rss()

RSSフィードのリンクタグを出力する

public rss(string $title, string $link) : void
Parameters
$title : string

RSSのタイトル

$link : string

RSSのURL

Tags
checked
noTodo

scripts()

コンテンツ内で設定した CSS や javascript をレイアウトテンプレートに出力し、ログイン中の場合、ツールバー用のCSSも出力する また、テーマ用のCSSが存在する場合には出力する

public scripts() : void

利用する際は、タグの直前あたりに記述する。 コンテンツ内で、レイアウトテンプレートへの出力を設定する場合には、inline オプションを false にする

《利用例》 $this->BcBaser->css('admin/layout', false); $this->BcBaser->js('admin/startup', false);

Tags
checked
noTodo

scriptStart()

public scriptStart(array<string|int, mixed> $options = []) : void
Parameters
$options = [] : array<string|int, mixed>

set()

レイアウトで利用する為の変数を設定する

public set(string $key, mixed $value) : void

View::set() のラッパー

Parameters
$key : string

変数名

$value : mixed

Tags
checked
noTodo
unitTest

setAlternateUrl()

alternate タグ出力 スマホサイトが存在し、別URLの場合に出力する

public setAlternateUrl() : mixed
Tags
checked

setCanonicalUrl()

setCanonicalUrl PCサイトの場合 - .html付:.htmlなしのカノニカルを出力 - .html無:自身のカノニカルを出力 スマホサイトの場合 - PCサイトが存在する場合、canonicalを出力

public setCanonicalUrl() : mixed
Tags
checked

setCategoryTitle()

タイトルとパンくずへのカテゴリタイトルの出力有無を設定する

public setCategoryTitle([bool|string|array<string|int, mixed> $on = true ]) : void

コンテンツごとに個別設定をする為に利用する。 パンくずにも影響する。

Parameters
$on : bool|string|array<string|int, mixed> = true

true を指定した場合は、コントローラーで指定した crumbs を参照し、 文字列を指定した場合には、その文字列をカテゴリとして利用する。 パンくずにリンクをつける場合には、配列で指定する。 (例) array('name' => '会社案内', 'url' => '/company/index')

Tags
checked
noTodo

setDescription()

meta タグの説明文を設定する

public setDescription(string $description) : void
Parameters
$description : string

説明文

Tags
checked
noTodo
unitTest
doc

setHomeTitle()

トップページのタイトルをセットする

public setHomeTitle([string $title = null ]) : mixed
Parameters
$title : string = null
Tags
checked
noTodo

setKeywords()

meta タグのキーワードを設定する

public setKeywords(string $keywords) : void
Parameters
$keywords : string

キーワード(複数の場合はカンマで区切る)

Tags
checked
noTodo
unitTest
doc

setScript()

JavaScript に変数を引き渡す

public setScript(string $variable, array<string|int, mixed> $value) : mixed
Parameters
$variable : string

変数名(グローバル変数)

$value : array<string|int, mixed>

値(連想配列)

Tags
checked
noTodo
unitTest

ラッパーメソッドのためユニットテスト不要

setTableToUpload()

public setTableToUpload(string $tableName) : void

BcFormHelper

Parameters
$tableName : string

setTitle()

タイトルを設定する

public setTitle(string $title[, mixed $categoryTitleOn = null ]) : void
Parameters
$title : string

タイトル

$categoryTitleOn : mixed = null

カテゴリのタイトルを含むかどうか

Tags
checked
noTodo

sitemap()

サイトマップを出力する

public sitemap([int $siteId = 0 ]) : mixed

ログインしていない場合はキャッシュする

Parameters
$siteId : int = 0

サイトID

Tags
checked
noTodo

siteName()

Webサイト名を出力する

public siteName() : void
Tags
checked
noTodo

siteSearchForm()

サイト内検索フォームを出力

public siteSearchForm([array<string|int, mixed> $data = [] ][, array<string|int, mixed> $options = [] ]) : void
Parameters
$data : array<string|int, mixed> = []

読み込むテンプレートに引き継ぐパラメータ(初期値 : array())

$options : array<string|int, mixed> = []

オプション(初期値 : array()) ※ その他のパラメータについては、View::element() を参照

Tags
checked
noTodo

siteUrl()

WebサイトURLを出力する

public siteUrl([mixed $ssl = false ]) : void
Parameters
$ssl : mixed = false
Tags
checked
noTodo

themeUrl()

現在のテーマのURLを出力する

public themeUrl() : void
Tags
checked
noTodo
unitTest
doc

title()

タイトルタグを出力する

public title([string $separator = '|' ][, string $categoryTitleOn = null ]) : void
Parameters
$separator : string = '|'

区切り文字

$categoryTitleOn : string = null

カテゴリを表示するかどうか boolean で指定

Tags
checked
noTodo

truncateText()

public truncateText(string $text, int $length = 100, array<string|int, mixed> $options = []) : string
Parameters
$text : string
$length = 100 : int
$options = [] : array<string|int, mixed>
Return values
string

updateInfo()

更新情報を出力する

public updateInfo() : void
Tags
checked
noTodo

url()

baserCMSの設置フォルダを考慮したURLを出力する

public url([mixed $url = null ][, bool $full = false ]) : void

《利用例》 会社概要

Parameters
$url : mixed = null

baserCMS設置フォルダからの絶対URL、もしくは配列形式のURL情報 省略した場合には、PC用のトップページのURLを出力する

$full : bool = false

httpから始まるURLを取得するかどうか

Tags
checked
unitTest
noTodo
doc

webClipIcon()

スマートフォン用のウェブクリップアイコン用のタグを出力する

public webClipIcon([string $fileName = 'apple-touch-icon-precomposed.png' ][, bool $useGloss = false ]) : mixed
Parameters
$fileName : string = 'apple-touch-icon-precomposed.png'

ファイル名(webroot に配置する事が前提)

$useGloss : bool = false

光沢有無

Tags
checked
noTodo

widgetArea()

public widgetArea(int $no = null, array<string|int, mixed> $options = []) : void
Parameters
$no = null : int
$options = [] : array<string|int, mixed>

xmlHeader()

XMLヘッダタグを出力する

public xmlHeader([array<string|int, mixed> $attrib = [] ]) : void
Parameters
$attrib : array<string|int, mixed> = []

属性

Tags
checked
noTodo
unitTest

_initPluginBasers()

PluginBaserHelper を初期化する

protected _initPluginBasers() : void

BcBaserHelperに定義されていないメソッドをプラグイン内のヘルパに定義する事で BcBaserHelperから呼び出せるようになる仕組みを提供する。 プラグインのヘルパメソッドを BcBaserHelper 経由で直接呼び出せる為、 コア側のコントローラーでいちいちヘルパの定義をしなくてよくなり、 プラグインを導入するだけでテンプレート上でプラグインのメソッドが呼び出せるようになる。 例えば固定ページ機能のWYSIWYG内にプラグインのメソッドを書き込む事ができる。

《PluginBaserHelper の命名規則》 {プラグイン名}BaserHelper

《利用例》

  • BcBlogプラグインに BcBlogBaserHelper::blogPosts() が定義されている場合 $this->BcBaser->blogPosts('news');
Tags
checked
noTodo

        
On this page

Search results