Core Classes
The shared base (Node → Component → Action/Field), the four contracts, the Schema/Page/Cluster composition layer, and the Catalog and chart-driver extension points.
Node
abstract classCg\ComponentFramework\Component\Node
Implements:RenderableNode、Htmlable
| Method | Returns | Notes |
|---|---|---|
attribute(string $name, mixed $value = true) | static | |
attributes(array $attributes) | static | |
attributesHtml(array $defaults = [], array $except = []) | HtmlString | |
attributeTokens(string $name, array|string $tokens) | static | 把 ARIA idref、rel 等空白分隔 token 安全附加到既有屬性。 |
class(array|string $classes) | static | |
getAttribute(string $name, mixed $default = null) | mixed | |
getView() | string | |
hidden(Closure|bool $condition = true) | static | |
interactionAttributes() | HtmlString | |
isVisible() | bool | |
key(?string $key = null) | static|string|null | 不帶參數=讀取 key;帶參數=設定 key 並回傳自己(可串接)。 |
linker(string $alias, array $params = []) | static | |
nodeType() | string | |
render() | HtmlString | |
renderAuto(string $controller, string $method = 'components', array $params = [], array $extra = []) | static | 頁面載入後自動向 controller 要內容,取代這個節點裡面的 HTML(等同 Blade 的 @renderAuto)。 節點裡原本的內容就是載入前的佔位,通常放 Skeleton: |
renderBlade(string $controller, string $method = 'components', array $params = [], ?string $target = null, array $extra = []) | static | |
renderObject(string $name, array $allow = ['render']) | static | |
stateless(string $alias) | static | |
toHtml() | string | |
toView() | View | |
view(string $view) | static | |
visible(Closure|bool $condition = true) | static | |
withViewData(array $data) | static |
Component
abstract classCg\ComponentFramework\Component\Component
最小 UI 節點。所有具體元件都由這裡開始。
Extends:Node · Implements:Htmlable、RenderableNode
Inherited methods (23)
from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Action
abstract classCg\ComponentFramework\Component\Action\Action
Extends:Component → Node · Implements:Htmlable、RenderableNode、ActionComponent
Constants (allowed values)
COLORS:neutral·primary·success·warning·danger·infoSIZES:sm·md·lgVARIANTS:solid·outline·ghost
| Method | Returns | Notes |
|---|---|---|
closesModal(string $key) | static | |
color(string $color) | static | |
disabled(Closure|bool $condition = true) | static | |
icon(Icon|Closure|string|null $icon, string $position = 'before') | static | |
iconOnly(?string $accessibleLabel = null) | static | |
linkerCall(string $method, array|string|null $args = null, array $extra = [], array|string|null $confirm = null, string $on = 'click', ?int $debounce = null, bool $prevent = true) | static | 呼叫最近一層 Linker host。參數直接交給既有 LinkerAttributes 驗證, Component 層不建立另一種 binding wire format。 |
static make(Htmlable|Closure|string $label) | static | |
opensModal(string $key) | static | |
size(string $size) | static | |
stateSet(string $key, mixed $value) | static | |
stateToggle(string $key) | static | |
variant(string $variant) | static |
Inherited methods (23)
from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Field
abstract classCg\ComponentFramework\Component\Field\Field
Extends:Component → Node · Implements:Htmlable、RenderableNode、FieldComponent
| Method | Returns | Notes |
|---|---|---|
disabled(Closure|bool $condition = true) | static | |
error(Closure|string|null $message, string $bag = 'default') | static | |
errorBag(string $bag) | static | |
getId() | string | |
getName() | string | |
helperText(Closure|string|null $text) | static | |
id(?string $id) | static | |
label(Htmlable|Closure|string|null $label) | static | |
linkerCall(string $method, array|string|null $args = null, array $extra = [], array|string|null $confirm = null, string $on = 'click', ?int $debounce = null, bool $prevent = true) | static | 呼叫最近一層 Linker host。參數直接交給既有 LinkerAttributes 驗證, Component 層不建立另一種 binding wire format。 |
live(string $method, array|string|null $args = null, ?int $debounce = 300, array $extra = []) | static | |
readOnly(Closure|bool $condition = true) | static | |
required(Closure|bool $condition = true) | static | |
state(string $key) | static |
Inherited methods (23)
from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
RenderableNode
interfaceCg\ComponentFramework\Component\Contracts\RenderableNode
Implements:Htmlable
| Method | Returns | Notes |
|---|---|---|
key(?string $key = null) | static|string|null | 不帶參數=讀取 key;帶參數=設定 key 並回傳自己(可串接)。 |
nodeType() | string | |
render() | HtmlString | |
toHtml() | — | Get content as a string of HTML. |
ActionComponent
interfaceCg\ComponentFramework\Component\Contracts\ActionComponent
Marker contract:只有可被使用者操作的元件才能進入 Actions Schema。
Implements:RenderableNode、Htmlable
| Method | Returns | Notes |
|---|---|---|
key(?string $key = null) | static|string|null | 不帶參數=讀取 key;帶參數=設定 key 並回傳自己(可串接)。 |
nodeType() | string | |
render() | HtmlString | |
toHtml() | — | Get content as a string of HTML. |
FieldComponent
interfaceCg\ComponentFramework\Component\Contracts\FieldComponent
Marker contract:可提交或參與表單狀態的輸入元件。
Implements:RenderableNode、Htmlable
| Method | Returns | Notes |
|---|---|---|
key(?string $key = null) | static|string|null | 不帶參數=讀取 key;帶參數=設定 key 並回傳自己(可串接)。 |
nodeType() | string | |
render() | HtmlString | |
toHtml() | — | Get content as a string of HTML. |
RequiresMultipart
interfaceCg\ComponentFramework\Component\Contracts\RequiresMultipart
元件本身或其後代需要由 multipart/form-data 表單提交。
Implements:RenderableNode、Htmlable
| Method | Returns | Notes |
|---|---|---|
key(?string $key = null) | static|string|null | 不帶參數=讀取 key;帶參數=設定 key 並回傳自己(可串接)。 |
nodeType() | string | |
render() | HtmlString | |
requiresMultipart() | bool | |
toHtml() | — | Get content as a string of HTML. |
Schema
classCg\ComponentFramework\Schema\Schema
Extends:Node · Implements:Htmlable、RenderableNode · View:cg-schema::SchemaView
| Method | Returns |
|---|---|
components(iterable $components) | static |
getComponents() | NodeCollection |
static make(iterable $components = []) | static |
push(Component $component) | static |
schemaType() | string |
Inherited methods (23)
from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Form
final class not extendableCg\ComponentFramework\Schema\Form
Extends:Schema → Node · Implements:RenderableNode、Htmlable · View:cg-schema::SchemaView
| Method | Returns |
|---|---|
action(?string $action) | static |
csrf(bool $condition = true) | static |
static make(iterable $components = []) | static |
method(string $method) | static |
multipart(bool $condition = true) | static |
novalidate(bool $condition = true) | static |
Inherited methods (27)
from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
from Schema:components getComponents push schemaType
Entries
final class not extendableCg\ComponentFramework\Schema\Entries
Extends:Schema → Node · Implements:RenderableNode、Htmlable · View:cg-schema::SchemaView
| Method | Returns |
|---|---|
static make(iterable $components = []) | static |
Inherited methods (27)
from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
from Schema:components getComponents push schemaType
Actions
final class not extendableCg\ComponentFramework\Schema\Actions
Extends:Schema → Node · Implements:RenderableNode、Htmlable · View:cg-schema::SchemaView
| Method | Returns |
|---|---|
static make(iterable $components = []) | static |
Inherited methods (27)
from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
from Schema:components getComponents push schemaType
Page
classCg\ComponentFramework\Page\Page
Extends:Node · Implements:Htmlable、RenderableNode · View:cg-page::PageView
| Method | Returns |
|---|---|
getSchemas() | NodeCollection |
getSlug() | string |
getTitle() | string |
getUrl() | ?string |
static make(Closure|string $title) | static |
push(Schema $schema) | static |
schemas(iterable $schemas) | static |
slug(?string $slug) | static |
url(?string $url) | static |
Inherited methods (23)
from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
Cluster
classCg\ComponentFramework\Cluster\Cluster
Extends:Node · Implements:Htmlable、RenderableNode · View:cg-cluster::ClusterView
| Method | Returns | Notes |
|---|---|---|
activePage(?string $key, bool $render = true) | static | Select one page and opt in to rendering it below the cluster navigation. |
getLabel() | string | |
getPages() | NodeCollection | |
getSlug() | string | |
static make(Closure|string $label) | static | |
page(string $key) | ?Page | |
pages(iterable $pages) | static | |
push(Page $page) | static | |
renderActivePage(bool $condition = true) | static | |
slug(?string $slug) | static |
Inherited methods (23)
from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData
ComponentCatalog
final class not extendableCg\ComponentFramework\Component\Catalog\ComponentCatalog
| Method | Returns |
|---|---|
all(ComponentCategory|string|null $category = null) | array |
count() | int |
find(string $id) | ?ComponentDefinition |
get(string $id) | ComponentDefinition |
grouped() | array |
has(string $id) | bool |
register(ComponentDefinition $definition, bool $replace = false) | self |
registerMany(iterable $definitions, bool $replace = false) | self |
search(string $query) | array |
ComponentDefinition
final class not extendableCg\ComponentFramework\Component\Catalog\ComponentDefinition
| Method | Returns |
|---|---|
category() | ComponentCategory |
componentClass() | string |
description() | string |
static fromArray(string $id, array $definition) | self |
id() | string |
isAction() | bool |
isField() | bool |
label() | string |
package() | string |
since() | string |
tags() | array |
toArray() | array |
ComponentCategory
enumCg\ComponentFramework\Component\Catalog\ComponentCategory
Cases:Primitive = primitive · Action = action · Field = field · Data = data · Feedback = feedback · Navigation = navigation · Status = status · Content = content · Overlay = overlay · Structure = structure · Accessibility = accessibility
| Method | Returns |
|---|---|
label() | string |
static resolve(self|string $category) | self |
ChartDriverManager
final class not extendableCg\ComponentFramework\Component\Chart\ChartDriverManager
Chart 驅動註冊表(容器 singleton;對外請用 Facade ChartDrivers)。
| Method | Returns | Notes |
|---|---|---|
default() | string | |
extend(string $name, ChartDriver|Closure|string $driver) | static | register() 的舊名稱。 |
static forgetRegistrations() | void | 測試用:清掉所有排隊中的註冊。 |
get(string $name) | ChartDriver | |
has(string $name) | bool | |
names() | array | |
origin(string $name) | ?string | 驅動註冊在哪裡(內建、config 或檔案:行號),除錯用。 |
static queue(string $name, ChartDriver|Closure|string $driver, bool $replace = false) | void | 不需要容器也能呼叫(例如 bootstrap 階段);效果與 register()/replace() 相同。 |
register(string $name, ChartDriver|Closure|string $driver) | static | 註冊新驅動;同名已存在(內建、config 或其他呼叫)會丟例外。 |
replace(string $name, ChartDriver|Closure|string $driver) | static | 明確覆蓋既有驅動(例如換掉內建的 amcharts)。 |
setDefault(string $name) | static |
Generated from source by scripts/wiki-components/generate.php via reflection. Do not edit by hand.