Properties

$px

$px : 

Picklesオブジェクト

Type

$path_theme_dir

$path_theme_dir : 

テーマディレクトリのパス

Type

$page

$page : 

カレントページの情報

Type

$param_theme_switch

$param_theme_switch : 

テーマスイッチ名

Type

$cookie_theme_switch

$cookie_theme_switch : 

テーマ名を格納するクッキー名

Type

$param_layout_switch

$param_layout_switch : 

レイアウトスイッチ名

Type

$theme_id

$theme_id : 

選択されるテーマID

Type

$theme_collection

$theme_collection : 

テーマコレクション

Type

$theme_options

$theme_options : 

テーマのコンフィグオプション

Type

$conf

$conf : 

px2-multithemeの設定情報

Type

Methods

exec()

exec(object  $px, object  $options = null) 

entry method

Parameters

object $px

Picklesオブジェクト

object $options

プラグイン設定

__construct()

__construct(object  $px, object  $options = null) 

constructor

Parameters

object $px

Picklesオブジェクト

object $options

プラグイン設定

get_option()

get_option(string  $key) : mixed

テーマごとのオプションを取得する

コンフィグオプションに指定されたテーマ別設定の値を取り出します。

Parameters

string $key

取り出したいオプションのキー

Returns

mixed —

テーマのオプション

mk_theme_collection()

mk_theme_collection() : array

テーマコレクションを作成する

テーマコレクションディレクトリおよびvendorディレクトリを検索し、 選択可能なテーマの一覧を生成します。

Returns

array —

テーマコレクション

is_valid_theme_id()

is_valid_theme_id(string  $theme_id) : boolean

テーマIDとして有効な文字列か検証する

Parameters

string $theme_id

検証対象のテーマID

Returns

boolean —

有効なら true, 無効なら false

get_layout()

get_layout() : string

選択されたレイアウト名を取得する

レイアウトは、Pickles 2 のサイトマップCSVの layout 列に指定すると選択できます。

layout列には、拡張子を含まない値を指定してください。 レイアウト hoge.html を選択したい場合、 layout列には hoge と入力します。

layout列が空白の場合、 default.html が選択されます。

Returns

string —

レイアウト名

get_theme_id()

get_theme_id() : string

選択されたテーマIDを取得する

Returns

string —

Theme ID

get_attr_bowl_name_by()

get_attr_bowl_name_by() : string

$conf->attr_bowl_name_by 設定の値を受け取る

このメソッドが返す値は、 テーマのコンテンツエリアを囲うラッパー要素にセットされるべき、bowl名を格納するための属性名です。 デフォルトは data-contents-area ですが、コンフィグオプションで変更することができます。

bowl main は次のように実装します。

<div class="contents" <?= htmlspecialchars($theme->get_attr_bowl_name_by())?>="main">
     <?= $px->bowl()->pull() ?>
</div>

独自の名前 hoge という bowl を作るには、次のように実装します。

<div class="contents" <?= htmlspecialchars($theme->get_attr_bowl_name_by())?>="hoge">
     <?= $px->bowl()->pull('hoge') ?>
</div>

この値は、 Pickles 2 Desktop Tool のGUI編集機能が、テーマの画面から編集可能領域を探しだすために利用します。

Returns

string —

bowl名を格納するための属性名

auto_select_theme()

auto_select_theme() 

auto select theme

find_layout_realpath()

find_layout_realpath() : string

レイアウトを選択し、ファイルのパスを取得する

  1. まず、パラメータ LAYOUT が指定されていて、かつレイアウトファイルが存在したら それが最優先。
  2. 次に、ページに layout 列が指定されていて、かつレイアウトファイルが存在したら それを採用。
  3. 次に、固定文字列 'default' でレイアウトファイルを探し、存在したらそれを採用。
  4. どれも該当がなければ、 固定レイアウト './default/default.html' を採用する。

Returns

string —

レイアウトファイルのパス

bind()

bind(object  $px) : string

bind content to theme

Parameters

object $px

Picklesオブジェクト

Returns

string —

テーマを実行した結果のHTMLコード

get_composer_root_dir()

get_composer_root_dir() : string

composer のルートディレクトリのパスを取得する

Returns

string —

vendorディレクトリの絶対パス