\NetCommonsHtmlHelper

NetCommonsでHtmlHelperをOverrideしたHelper

Add your application-wide methods in the class below, your helpers will inherit them.

Summary

Methods
Properties
Constants
__call()
script()
css()
json()
url()
link()
blockTitle()
editLink()
$helpers
No constants found
No protected methods found
No protected properties found
N/A
__getUrl()
No private properties found
N/A

Properties

$helpers

$helpers : array

使用するHelpers

Type

array

Methods

__call()

__call(string  $method, array  $params) : string

HtmlHelperラップ用マジックメソッド。

指定されたメソッドにより、各プラグインのHelperメソッドを呼び出します。

$method の内容による出力

Parameters

string $method

メソッド

array $params

パラメータ

Returns

string

script()

script(string|array  $url, array|boolean  $options = array()) : mixed

NetCommonsによるHtmlHelper::script()を共通化

Parameters

string|array $url

javascriptファイルのURL

array|boolean $options

HTML属性のオプション

Returns

mixed —

<script>タグの出力

css()

css(string|array  $path, array  $options = array()) : string

NetCommonsによるHtmlHelper::css()を共通化

Parameters

string|array $path

CSS style sheetのパス

array $options

HTML属性のオプション

Returns

string —

CSS <link> or <style>タグの出力

json()

json(array  $results = array(), string  $name = 'OK', integer  $status = 200) : string

Google JSON Style Guideに沿ってJSON形式の出力

Parameters

array $results

出力結果配列

string $name

レスポンスメッセージ

integer $status

ステータスコード

Returns

string —

JSON形式の文字列

url()

url(mixed  $url = null, array  $options = array()) : string

URLの取得

Parameters

mixed $url

URL

array $options

HTML属性オプション

Returns

string —

URL

link()

link(string  $title = '', mixed  $url = null, array  $options = array()) : string

`<a>`タグの出力

Parameters

string $title

<a>のタイトル

mixed $url

URL

array $options

HTML属性オプション

Returns

string —

<a>タグ

blockTitle()

blockTitle(string  $text = '', array  $options = array()) : string

タイトル(ブロックタイトル)の出力

サンプル

echo $this->NetCommonsHtml->blockTitle($bbs['name'])
出力結果
<h1>新しい掲示板 20160513074815</h1>

Parameters

string $text

タイトル

array $options

HTML属性オプション

Returns

string —

<h1>タグ

editLink()

editLink(string  $title = '', mixed  $url = null, array  $options = array()) : string

Creates a `<a>` tag for add link. The type attribute defaults 後で削除予定(現状、ブロック設定の一覧のリンクで使っている)

Parameters

string $title

The anchor's caption. Not automatically HTML encoded

mixed $url

Link url

array $options

Array of options and HTML attributes.

Returns

string —

A HTML button tag.

__getUrl()

__getUrl(mixed  $url = null) : string

URL生成処理

Parameters

mixed $url

URL

Returns

string —

URL