Download the PHP package tyokinuhata/html-builder without Composer
On this page you can find all versions of the php package tyokinuhata/html-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download tyokinuhata/html-builder
More information about tyokinuhata/html-builder
Files in tyokinuhata/html-builder
Download tyokinuhata/html-builder
More information about tyokinuhata/html-builder
Files in tyokinuhata/html-builder
Vendor tyokinuhata
Package html-builder
Short Description A library that can write HTML in PHP
License MIT
Package html-builder
Short Description A library that can write HTML in PHP
License MIT
Please rate this library. Is it a good library?
Informations about the package html-builder
HTML Builder
PHPでHTMLの組み立てができるライブラリ
このライブラリを利用する場合
インストール
サンプルコード
基本的に要素は, ->要素名()
の形式で記述します.
属性と値を取る要素の場合は, ->要素名('属性', '値')
のように記述します.
例外として, 値を取らなくて良い属性を記述する場合は, ->要素名('@属性')
のように記述します.
プレーンなテキストを記述する場合は, ->text('テキスト')
のように, 引数に対して描画したいテキストを渡します.
CSSの記述は, ->div('style', 'プロパティ:値;')
, ->link('rel', '.cssファイルのパス')
のようにできる他, ->style(['セレクタ' => ['プロパティ' => '値'])
のように記述することも可能です.
->upstream()
はその階層を抜ける場合に使用します.
複数階層抜ける場合は->upstream(2)
のように, 抜ける階層数を引数に指定します.
->build('パス')は
ビルド用のメソッドです.
引数で指定したパスに対して, PHPファイルを基にHTMLファイルを生成します.
->append()
は出力用のメソッドです.
ビルドインサーバの起動
使用可能な要素一覧
- html
- head
- title
- link
- meta
- style
- script
- body
- section
- nav
- article
- aside
- h1 ~ h6
- header
- footer
- p
- hr
- pre
- ol
- ul
- li
- dl
- dt
- dd
- div
- main
- a
- strong
- sub
- sup
- i
- b
- span
- br
- wbr
- img
- iframe
- table
- caption
- col
- tbody
- thead
- tfoot
- tr
- td
- th
- form
- label
- input
- button
- select
- option
- textarea
このライブラリを開発する場合
クローン
セットアップ
ビルドインサーバの起動
各ファイルの説明
ファイル名 | 説明 |
---|---|
HtmlBuilder | 要素とポインタの管理, 各トレイトを呼び出すクラス |
Insert | バッファへの挿入を行うメソッドをまとめたトレイト |
Core | 重要な操作をまとめたトレイト |
Root | 根本となる要素のトレイト |
Meta | 文書のメタデータ関連のトレイト |
Section | セクション関連のトレイト |
Content | コンテンツの分類関連のトレイト |
Text | テキスト関連のトレイト |
Embedded | コンテンツの埋め込み関連のトレイト |
Table | テーブル関連のトレイト |
Form | フォーム関連のトレイト |
リンク
All versions of html-builder with dependencies
PHP Build Version
Package Version
The package tyokinuhata/html-builder contains the following files
Loading the files please wait ....