例 |
- // Get the default instance
+ // デフォルトのインスタンスを取得
$theme = \Theme::instance();
/**
- * Assign the 'partials/menu' view to the 'sidebar' section of the
- * currently loaded page template.
+ * 現在読み込まれているページテンプレートの 'sidebar' セクションに
+ * 'partials/menu' ビューを割り当てます。
*
- * In the template, this partial is echo'd out as $partials['sidebar'];
+ * テンプレート内で、このパーシャルは $partials['sidebar'] として echo されます。
*/
$theme->set_partial('sidebar', 'partials/menu');
@@ -797,44 +797,44 @@ set_partial($section, $view, $overwri
partial_count($section)
- The partial_count method returns a count of the number of partials defined for the given section.
+ partial_count メソッドは、指定されたセクション用に定義されたパーシャルの数を返します。
- Static |
- No |
+ 静的 |
+ いいえ |
- Parameters |
+ パラメータ |
- Param |
- Type |
- Default |
- Description |
+ パラメータ |
+ 型 |
+ デフォルト |
+ 説明 |
$section |
string |
- required |
- The name of page template section you want to check for defined partials. |
+ 必須 |
+ 確認したいパーシャルが定義されたページテンプレートセクションの名前 |
|
- Returns |
+ 返り値 |
Integer |
- Example |
+ 例 |
- // Get the default instance
+ // デフォルトのインスタンスを取得
$theme = \Theme::instance();
-// Get the number of partials assigned to the sidebar
+// sidebar に割り当てられたパーシャルの数
$partials = $theme->partial_count('sidebar');
|
@@ -846,47 +846,47 @@ partial_count($section)
has_partials($section)
- The has_partials method allows you to check if a template section has any partials defined.
+ has_partials メソッドは、テンプレートセクションが任意のパーシャルの定義を持つかどうかを確認することができます。
- Static |
- No |
+ 静的 |
+ いいえ |
- Parameters |
+ パラメータ |
- Param |
- Type |
- Default |
- Description |
+ パラメータ |
+ 型 |
+ デフォルト |
+ 説明 |
$section |
string |
- required |
- The name of page template section you want to check for defined partials. |
+ 必須 |
+ 確認したいパーシャルが定義されたページテンプレートセクションの名前 |
|
- Returns |
+ 返り値 |
Boolean |
- Example |
+ 例 |
- // Get the default instance
+ // デフォルトのインスタンスを取得
$theme = \Theme::instance();
-// Check if we have sidebar partials defined
+// sidebar のパーシャルが定義されているか確認
if ( ! $theme->has_partials('sidebar'))
{
- // some code here to hide the sidebar...
+ // サイドバーを非表示にする何らかのコード...
}
|
@@ -898,13 +898,13 @@ has_partials($section)
get_chrome($section)
- The get_chrome method allows you to get the view instance of a previously set partial chrome.
+ get_chrome メソッドは、事前に設定されたパーシャルクロームのビューのインスタンスを取得することができます。
静的 |
- No |
+ いいえ |
パラメータ |
@@ -919,8 +919,8 @@ get_chrome($section)
$section |
string |
- required |
- The name of section you want to get the partial chrome from. |
+ 必須 |
+ パーシャルクロームを取得したいセクションの名前。 |
@@ -932,14 +932,14 @@ get_chrome($section)
例 |
- // Get the default instance
+ // デフォルトのインスタンスを取得
$theme = \Theme::instance();
/**
- * Get the View instance for the chrome assigned to the 'sidebar' of the
- * template and assign a variable to it.
+ * テンプレートの 'sidebar' に割り当てられたクロームのための
+ * View インスタンスを取得し、そこに変数を割り当てる。
*/
-$theme->get_chrome('sidebar')->set('title', 'This is a sidebar');
+$theme->get_chrome('sidebar')->set('title', 'これはサイドバーです');
|
@@ -950,13 +950,13 @@ get_chrome($section)
set_chrome($section, $view, $var = 'content')
- The set_chrome method allows you to define chrome for a partial section of your page template.
+ set_chrome メソッドは、ページテンプレートのパーシャルセクションのためのクロムを定義することができます。
静的 |
- No |
+ いいえ |
パラメータ |
@@ -971,20 +971,20 @@ set_chrome($section, $view, $var = 'co
$section |
string |
- required |
- The name of page template section you want to add this partial to. |
+ 必須 |
+ このパーシャルを追加したいページテンプレートセクションの名前 |
$view |
string|View |
- required |
- The name of view to use for the chome of the partial, or a View object. |
+ 必須 |
+ パーシャルのクロームのために使用するビューの名前、または View オブジェクト |
$var |
string |
'content'
|
- The name of the variable in the chrome view used to output the partial content. |
+ クロームビューがパーシャルコンテンツの出力時に利用する変数の名前 |
@@ -996,15 +996,15 @@ set_chrome($section, $view, $var = 'co
例 |
- // Get the default instance
+ // デフォルトのインスタンスを取得
$theme = \Theme::instance();
/**
- * Assign the 'chrome/roundedcorners' view to the 'sidebar' section of the
- * currently loaded page template to give the partial section a border with
- * rounded corners.
+ * パーシャルセクションに丸みを帯びた角を持つ枠を与えるために現在読み込まれている
+ * ページテンプレートの 'sidebar' セクションに 'chrome/roundedcorners'
+ * ビューを割り当てます。
*
- * In the chrome view, the partial output is echo'd out as $body;
+ * クロムビュー内で、パーシャルの出力は $body として echo されます;
*/
$theme->set_chrome('sidebar', 'chrome/roundedcorners', 'body');
@@ -1017,54 +1017,54 @@ set_chrome($section, $view, $var = 'co
set_order($section, $order)
- The set_order method allows you to define a custom ordering in which your partial
- sections will be rendered.
+ set_order メソッドは、パーシャルセクションがレンダリングされるカスタムな順序を
+ 定義することができます。
- This can be useful if some partials depend on what happens in others, for example if your partials
- can generate messages, and you have a messages partial which will display them. In this case, you
- would want to render the messages partial after all others.
- Sections without a defined order are rendered before all others.
+ いくつかのパーシャルが何か他に起こることに依存している場合、たとえば、パーシャルが messages を生成でき、
+ そしてそれらを表示する messages パーシャルを持っている場合、これは便利です。 この場合、
+ 他のすべてより後に messages パーシャルをレンダリングしたいと思うでしょう。
+ 定義された順序がないセクションでは他のすべてより前にレンダリングされます。
- Static |
- No |
+ 静的 |
+ いいえ |
- Parameters |
+ パラメータ |
- Param |
- Type |
- Default |
- Description |
+ パラメータ |
+ 型 |
+ デフォルト |
+ 説明 |
$section |
string |
- required |
- The name of page template section you want to define the order on. |
+ 必須 |
+ 順序を定義したいページテンプレートセクションの名前。 |
$order |
integer |
- required |
- The relative order of the partial section. Must be between 1 and 9. |
+ 必須 |
+ パーシャルセクションの相対的な順序。 1 から 9 の間でなければらない。 |
|
- Example |
+ 例 |
- // Get the default instance
+ // デフォルトのインスタンスを取得
$theme = \Theme::instance();
/**
- * Make sure the messages partial is rendered after all others
+ * messages パーシャルが他のすべてより後にレンダリングされるようにする
*/
$theme->set_chrome('messages', 9);
@@ -1077,13 +1077,13 @@ set_order($section, $order)
find($theme)
- The find method will iterate over the defined search paths to find the theme requested.
+ find メソッドは、要求されたテーマを見つけるために定義された検索パスを繰り返し処理します。
静的 |
- No |
+ いいえ |
パラメータ |
@@ -1098,30 +1098,30 @@ find($theme)
$theme |
string |
- required |
- The name of the theme to find. |
+ 必須 |
+ 検索するテーマの名前。 |
|
返り値 |
- mixed. Returns the path to the theme if found, or false if not. |
+ mixed. 見つかった場合はテーマへのパスを返し、そうでない場合は false 。 |
例 |
- // Get the default instance
+ // デフォルトのインスタンスを取得
$theme = \Theme::instance();
-// find the 'darkglow' theme
+// 'darkglow' テーマを探す
if ($path = $theme->find('darkglow'))
{
- // the theme can be found in $path
+ // テーマは $path で見つかった
}
else
{
- // unable to find the theme
+ // テーマを見つけることができなかった
}
|
@@ -1133,17 +1133,17 @@ find($theme)
all()
- The all method returns an array of all themes in all theme paths, sorted alphabetically.
+ all メソッドは、アルファベット順にソートされたすべてのテーマパス内のすべてのテーマの配列を返します。
静的 |
- No |
+ いいえ |
パラメータ |
- None |
+ なし |
返り値 |
@@ -1152,10 +1152,10 @@ all()
例 |
- // Get the default instance
+ // デフォルトのインスタンスを取得
$theme = \Theme::instance();
-// fetch all installed themes
+// インストールされているすべてのテーマを取得
$themes = $theme->all();
|
@@ -1167,52 +1167,52 @@ all()
use_modules($enable = true)
- The use_modules method enables or disables the prefixing feature for views loaded from a
- module. If true, the views loaded via the Theme class will be prefixed by the current active module
- name (if any). If a string is passed, it will be prefixed as well, allowing you to store all modules in a
- separate directory, to avoid name conficts between module names and non-prefixed view names. If the view can
- not be found, it's checked again without the prefix, allowing for global views from inside a module. If that
- doesn't exist either, the View class will be called to load the view the regular way.
+ use_modules メソッドは、モジュールから読み込まれたビューのプレフィックス機能を有効または無効にします。
+ true の場合、 Theme クラスを介してビューが読み込まれ、 (もしあれば) 現在アクティブなモジュール名が付きます。
+ 文字列が渡された場合、それは同じようにプレフィックス付き、モジュール名とプレフィックスが付いていないビュー名の間で名前の競合を避けるために、
+ 別のディレクトリにすべてのモジュールを格納することができます。
+ ビューが見つからない場合、それはプレフィックスを付けず再確認され、モジュール内からグローバルビューを利用可能にします。
+ どちらも存在しない場合、View クラスはビューを通常の方法を読み込むために呼び出されます。
静的 |
- No |
+ いいえ |
- Parameters |
+ パラメータ |
- Param |
- Type |
- Default |
- Description |
+ パラメータ |
+ 型 |
+ デフォルト |
+ 説明 |
$enable |
boolean | string |
true
|
- True or a string containing a folder name to enable the feature, false to disable it. |
+ True またはフォルダ名を含む文字列の場合はは機能を有効にし、それを無効にする場合は false 。 |
|
- Returns |
+ 返り値 |
Theme |
- Example |
+ 例 |
- // Get the default instance
+ // デフォルトのインスタンスを取得
$theme = \Theme::instance();
-// when in the module 'test', this will load the theme view 'test/controller/view'
+// モジュール 'test' 内の場合、これはテーマビュー 'test/controller/view' を読み込みます。
$info = $theme->use_modules()->set_partial('content', 'controller/view')->use_modules(false);
-// when in the module 'test', this will load the theme view 'modules/test/controller/view'
+// モジュール 'test' 内の場合、これはテーマビュー 'modules/test/controller/view' を読み込みます。
$info = $theme->use_modules('modules')->set_partial('content', 'controller/view')->use_modules(false);
|
@@ -1221,21 +1221,21 @@ use_modules($enable = true)
- You can set a global default value through the use_modules key of the theme.php configuration file.
+ theme.php 設定ファイルの use_modules キーによりグローバルなデフォルト値を設定することができます。
load_info($theme = null)
- The load_info method returns the complete info array for a theme.
- If no theme is specified, the info of the active theme is returned.
+ load_info メソッドはテーマの完全な情報の配列を返します。
+ テーマが指定されていない場合、アクティブなテーマの情報が返されます。
静的 |
- No |
+ いいえ |
パラメータ |
@@ -1251,7 +1251,7 @@ load_info($theme = null)
$theme |
string |
null
|
- The name of the theme. |
+ テーマの名前。 |
@@ -1262,15 +1262,15 @@ load_info($theme = null)
例外 |
- \ThemeException, when the requested theme could not be found. |
+ \ThemeException 、リクエストされたテーマが見つからない場合。 |
例 |
- // Get the default instance
+ // デフォルトのインスタンスを取得
$theme = \Theme::instance();
-// get the information array for the 'basic' theme.
+// 'basic' テーマの情報配列を取得します。
$info = $theme->load_info('basic');
|
@@ -1279,23 +1279,23 @@ load_info($theme = null)
- If no theme info file could be found, this method Throws \ThemeException if require_info_file is
- set to true, or an empty array is returned if require_info_file is
- set to false.
+ テーマ情報ファイルがない場合、require_info_file が true
+ に設定されている場合、このメソッドは \ThemeException を発生させ、 require_info_file が
+ false に設定されている場合、空の配列が返されます。
save_info($type = 'active')
- The save_info saves the contents of the theme info array
- back to the theme info file.
+ save_info はテーマ情報ファイルへテーマ情報の配列の内容を
+ 保存します。
静的 |
- No |
+ いいえ |
パラメータ |
@@ -1311,7 +1311,7 @@ save_info($type = 'active')
$type |
string |
'active'
|
- Whether the active or fallback theme info should be saved. |
+ アクティブまたはフォールバックテーマの情報を保存するかどうか。 |
@@ -1322,15 +1322,15 @@ save_info($type = 'active')
例外 |
- \ThemeException, when the requested theme could not be found. |
+ \ThemeException 、リクエストされたテーマが見つからない場合。 |
例 |
- // Get the default instance
+ // デフォルトのインスタンスを取得
$theme = \Theme::instance();
-// save the information array for the active theme.
+// active テーマの情報配列を保存します。
$info = $theme->save_info('active');
|
@@ -1339,23 +1339,23 @@ save_info($type = 'active')
- If no theme info file could be found, this method Throws \ThemeException if require_info_file is
- set to true, or an empty array is returned if require_info_file is
- set to false.
+ テーマ情報ファイルがない場合、require_info_file が true
+ に設定されている場合、このメソッドは \ThemeException を発生させ、 require_info_file が
+ false に設定されている場合、空の配列が返されます。
get_info($var, $default = null, $theme = null)
- The get_info method returns a specific variable from the theme info array.
- If no theme is specified, the info array of the active theme is used.
+ get_info メソッドはテーマ情報配列から特定の変数を返します。
+ テーマが指定されていない場合、アクティブなテーマの情報配列が使用されます。
静的 |
- No |
+ いいえ |
パラメータ |
@@ -1370,20 +1370,20 @@ get_info($var, $default = null, $theme =
$var |
string |
- required |
- The name of the info variable to retrieve. |
+ 必須 |
+ 取得する情報変数の名前。 |
$default |
mixed |
null
|
- The value to return if the requested $var does not exist. |
+ 要求された $var が存在しない場合に返る値。 |
$theme |
string |
null
|
- The name of the theme whose info file should be searched. |
+ 情報ファイルが検索されるべきテーマの名前。 |
|
@@ -1394,15 +1394,15 @@ get_info($var, $default = null, $theme =
例外 |
- \ThemeException, when the requested theme could not be found. |
+ \ThemeException 、リクエストされたテーマが見つからない場合。 |
例 |
- // Get the default instance
+ // デフォルトのインスタンスを取得
$theme = \Theme::instance();
-// get the color defined the the 'basic' theme, and if not set, use 'blue'
+// 'basic' テーマで定義した色を取得し、設定されていない場合 'blue' を利用
$var = $theme->get_info('color', 'blue', 'basic');
|
@@ -1410,22 +1410,22 @@ get_info($var, $default = null, $theme =
- If you specify a theme, the value is loaded from the theme info file. This is true even if the theme specified
- is currently set as active or passive theme. For those, the loaded (and possibly modified) info is not used!
+ テーマを指定した場合、値がテーマ情報ファイルからロードされます。 これは、指定されたテーマは現在アクティブまたはパッシブ
+ テーマとして設定されている場合も同様です。それらのために、読み込まれた (そしておそらく変更された) 情報は利用されません!
set_info($var, $value = null, $type = 'active')
- The set_info method allows you to set a varaible in the active or fallback theme info array.
- If no theme is specified, the info array of the active theme is used.
+ set_info メソッドは、アクティブまたはフォールバックテーマ情報配列内の変数を設定することができます。
+ テーマが指定されていない場合、アクティブなテーマの情報配列が使用されます。
静的 |
- No |
+ いいえ |
パラメータ |
@@ -1440,20 +1440,20 @@ set_info($var, $value = null, $type = 'a
$var |
string |
- required |
- The name of the info variable to set. |
+ 必須 |
+ 設定する情報変数の名前。 |
$value |
mixed |
null
|
- The value to set. |
+ 設定する値。 |
$type |
string |
'active'
|
- Whether the variable should be set in the active or fallback theme. |
+ アクティブまたはフォールバックテーマのどちらに値を設定する必要があるか。 |
@@ -1465,10 +1465,10 @@ set_info($var, $value = null, $type = 'a
例 |
- // Get the default instance
+ // デフォルトのインスタンスを取得
$theme = \Theme::instance();
-// set the color to blue of the fallback theme
+// フォールバックテーマを青に色を設定
$theme->set_info('color', 'blue', 'fallback');
|
|