helsingborg-stad / component-library
A library of components for use in WordPress
Installs: 14 213
Dependents: 1
Suggesters: 2
Security: 0
Stars: 4
Watchers: 11
Forks: 1
Open Issues: 4
Type:wordpress-muplugin
Requires
- php: ^8.0
- helsingborg-stad/blade: ^3.5.0
Requires (Dev)
- mockery/mockery: ^1.6
- phpunit/phpunit: ^9.6
- dev-main
- 4.32.0
- 4.31.0
- 4.30.0
- 4.29.0
- 4.28.0
- 4.27.9
- 4.27.8
- 4.27.7
- 4.27.6
- 4.27.5
- 4.27.4
- 4.27.3
- 4.27.2
- 4.27.1
- 4.27.0
- 4.26.24
- 4.26.23
- 4.26.22
- 4.26.21
- 4.26.20
- 4.26.18
- 4.26.17
- 4.26.16
- 4.26.15
- 4.26.12
- 4.26.10
- 4.26.8
- 4.26.7
- 4.26.6
- 4.26.5
- 4.26.4
- 4.26.3
- 4.26.2
- 4.26.1
- 4.26.0
- 4.25.7
- 4.25.6
- 4.25.5
- 4.25.4
- 4.25.3
- 4.25.2
- 4.25.1
- 4.25.0
- 4.24.2
- 4.24.0
- 4.23.14
- 4.23.13
- 4.23.12
- 4.23.11
- 4.23.10
- 4.23.9
- 4.23.7
- 4.23.6
- 4.23.5
- 4.23.4
- 4.23.2
- 4.23.1
- 4.23.0
- 4.22.9
- 4.22.8
- 4.22.7
- 4.22.6
- 4.22.4
- 4.22.3
- 4.22.0
- 4.21.2
- 4.21.1
- 4.21.0
- 4.20.7
- 4.20.6
- 4.20.5
- 4.20.4
- 4.20.3
- 4.20.2
- 4.20.1
- 4.19.3
- 4.19.2
- 4.19.1
- 4.19.0
- 4.18.2
- 4.18.1
- 4.18.0
- 4.17.1
- 4.17.0
- 4.16.0
- 4.15.1
- 4.15.0
- 4.14.8
- 4.14.7
- 4.14.6
- 4.14.5
- 4.14.4
- 4.14.3
- 4.14.2
- 4.14.1
- 4.14.0
- 4.13.6
- 4.13.5
- 4.13.4
- 4.13.3
- 4.13.2
- 4.13.1
- 4.12.0
- 4.11.6
- 4.11.5
- 4.11.4
- 4.11.3
- 4.11.2
- 4.11.1
- 4.11.0
- 4.10.0
- 4.9.0
- 4.8.1
- 4.8.0
- 4.7.0
- 4.6.34
- 4.6.33
- 4.6.32
- 4.6.30
- 4.6.28
- 4.6.27
- 4.6.26
- 4.6.25
- 4.6.24
- 4.6.23
- 4.6.22
- 4.6.21
- 4.6.20
- 4.6.19
- 4.6.18
- 4.6.17
- 4.6.16
- 4.6.15
- 4.6.14
- 4.6.13
- 4.6.12
- 4.6.11
- 4.6.10
- 4.6.9
- 4.6.8
- 4.6.6
- 4.6.5
- 4.6.4
- 4.6.3
- 4.6.2
- 4.6.1
- 4.6.0
- 4.5.0
- 4.4.0
- 4.3.0
- 4.2.2
- 4.2.1
- 4.2.0
- 4.0.34
- 4.0.32
- 4.0.31
- 4.0.30
- 4.0.29
- 4.0.28
- 4.0.26
- 4.0.25
- 4.0.24
- 4.0.23
- 4.0.22
- 4.0.21
- 4.0.20
- 4.0.19
- 4.0.18
- 4.0.17
- 4.0.16
- 4.0.15
- 4.0.14
- 4.0.13
- 4.0.12
- 4.0.11
- 4.0.9
- 4.0.6
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.17.5
- 3.17.3
- 3.17.2
- 3.17.1
- 3.17.0
- 3.16.1
- 3.16.0
- 3.15.0
- 3.14.1
- 3.14.0
- 3.13.5
- 3.13.4
- 3.13.3
- 3.13.2
- 3.13.1
- 3.13.0
- 3.12.21
- 3.12.19
- 3.12.18
- 3.12.17
- 3.12.16
- 3.12.14
- 3.12.13
- 3.12.12
- 3.12.11
- 3.12.9
- 3.12.7
- 3.12.6
- 3.12.5
- 3.12.4
- 3.12.3
- 3.12.2
- 3.12.1
- 3.12.0
- 3.11.2
- 3.11.1
- 3.11.0
- 3.10.2
- 3.10.1
- 3.10.0
- 3.9.1
- 3.9.0
- 3.8.4
- 3.8.3
- 3.8.2
- 3.8.1
- 3.8.0
- 3.7.0
- 3.6.2
- 3.6.1
- 3.6.0
- 3.5.0
- 3.4.8
- 3.4.7
- 3.4.6
- 3.4.4
- 3.4.3
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.0
- 3.2.0
- 3.1.0
- 3.0.3
- 3.0.2
- 2.0.0
- 1.0.0
- dev-feature/Erstt-Features-Grid-med-rendering-frn-Municipio-CU-8696jdckc
- dev-feat/signature-slot
- dev-feat/signature-placeholder-avatar
- dev-feat/allow-newsitem-ink
- dev-feat/newsitem
- dev-feat/button-is-working
- dev-feat/element-component
- dev-chore/linked-in-icon-corrected-names
- dev-chore/renaming-linkedin-icon
- dev-fix/site-selector-item-classList
- dev-fix/aria-controls-close-button
- dev-fix/drawer-aria-controls
- dev-fix/improved-image-detection-segments
- dev-fix/date-with-locale-support
- dev-fix/mega-menu-page-tree-fallback
- dev-feat/image-in-card
- dev-chore/remove-unsued-post-setting
- dev-chore/changing-card-content-after-class
- dev-feat/image-in-slider
- dev-fix/container-for-card-after-slot
- dev-feat/image-in-components
- dev-feat/install-npm
- dev-feat/container-query-images
- dev-feat/imageFocus
- dev-feature/wp-image
- dev-chore/added-trusted-acceptance-supplier
- dev-feat/fluid-grid-update
- dev-fix/truncate-breadcrumbs-adjustments
- dev-feat/truncate-and-breadcrumb-tooltip
- dev-fix/tags-filled
- dev-fix/osm-icon-size
- dev-feat/group-columns-per-row
- dev-feat/nav-compressed
- dev-fix/component--attributes-builder
- dev-feat/icon-default-filled
- dev-fix/missing-play-btn
- dev-feat/smaller-icons-bundle
- dev-fix/setting-standard-aria-label-if-none-exists
- dev-fix/notices-accordion-item
- dev-chore/footer-footerareas-typings
- dev-feat/osm-tooltip-and-layout
- dev-feat/modal-animation
- dev-refactor/custom-icons
- dev-fix/aria-label-card-truncate
- dev-feat/allow-component-type-null
- dev-feat/svg-path-icons
- dev-feat/nav-component-unique-button-styling
- dev-feat/adding-icon-decorative-parameter
- dev-feat/adding-aria-label-slider-item
- dev-fix/datebadge-mq-md-float
- dev-fix/file-upload-required
- dev-fix/adding-js-required-to-form-fields
- dev-fix/remove-icon-name
- dev-chore/inlineCssWrapper-typings
- dev-chore/modal-typings
- dev-chore/hero-typings
- dev-chore/gallery-typings
- dev-chore/footer-typings
- dev-chore/fileinput-typings
- dev-chore/dropdown-typings
- dev-chore/divider-typings
- dev-chore/datebadge-typings
- dev-chore/comment-typings
- dev-chore/collection__items-typings
- dev-chore/block-typings
- dev-chore/box-typings
- dev-chore/brand-typings
- dev-fix/empty-logotype-showing-from-brand-component
- dev-chore/breadcrumb-typings
- dev-chore/collection-typings
- dev-chore/image-null-typings
- dev-chore/image-typings-alt-and-caption
- dev-chore/accordion-item-heading-typing
- dev-chore/remove-quote
- dev-feat/init-quote-component
- dev-chore/button-typings
- dev-chore/accordion__item-types
- dev-feat/avatar-typings
- dev-feat/anchorMenu-typings
- dev-feature/acceptance-types
- dev-chore/date-typings
- dev-chore/image-typings
- dev-chore/icon-typings
- dev-feature/accordion-types
- dev-fix/hide-parameters-errors-in-production
- dev-fix/component-params-error-notices-exceptions
- dev-fix/wp-cli-error-component-typing-notices
- dev-fix/image-input-notices
- dev-fix/object-to-array
- dev-feat/pagination-prefix-url
- dev-feat/allow-icon-attribute-list-for-menu-items
- dev-fix/component-slots-protected-data-key
- dev-refactor/typography-variants
- dev-fix/typography-variant-headings
- dev-feat/handle-typography-variants
- dev-feature/component-type-check
- dev-feat/remove-caption
- dev-fix/undefined-variable-url-in-iframe
- dev-fix/accordion-headings-array
- dev-fix/typography-variant
- dev-feature/Hantera-embed-urls-i-Municipio-istllet-fr-komponenten-iframe-CU-8693h2a8z
- dev-feat/embed-Spotify-CU-h19dm2
- dev-feature/iframe-communication
- dev-fix/amp-select-symbol
- dev-fix/box--date-notices
- dev-fix/notice-component-id
- dev-fix/outside-context
- dev-fix/correct-key-notice-notices
- dev-chore/remove-filterselect
- dev-fix/listing-notices
- dev-chore/remove-old-unused-components
- dev-feature/dropdown-slot
- dev-feature/xfn-link-component
- dev-fix/amp-in-drawer
- dev-fix/hero-overlay
- dev-master
- dev-feature/component-lang
- dev-fix/aria-label-accordion
- dev-fix/segment-not-render-button-without-link
- dev-fix/typography-headings
- dev-feature/poster-for-iframe-video
- dev-feature/new-iframe-script-handling
- dev-feature/segment-placeholder-image
- dev-feature/removes-possibility-for-multiple-h1
- dev-fix/js-pagination
- dev-feature/image-photographer
- dev-fix/data-nosnippet-icons
- dev-fix/card-like-position
- dev-fix/xl-modifier-added
- dev-feat/hamburgermenu-name-change
- dev-fix/required-fileinputs
- dev-fix/links-without-labels
- dev-feature/drawer-button-color
- dev-feature/add-description-to-mega-menu
- dev-feature/add-placeholder-image-segment
- dev-fix/table-error-notices
- dev-fix/acceptance-error-notices
- dev-fix/nav-generating-unnecessary-span
- dev-fix/select-handle-fetched-elements
- dev-fix/slider-item-video
- dev-fix/android-select-dropdown
- dev-feature/multiselect-filtering-name-handling
- dev-feature/products-empty-body
- dev-fix/segment-wrong-imagefocus-value
- dev-feature/multiselect
- dev-refactor/removed-unused-component-alert
- dev-feature/js-pagination-list
- dev-feature/handle-empty-tooltips-osm
- dev-feature/select-hide-placeholder
- dev-fix/checkbox-not-clickable
- dev-feature/project-price-container
- dev-fix/attributeLists-non-strings
- dev-fix/basecontroller-buildargs-error
- dev-feature/background-image-roles
- dev-fix/duplicated-aria-labels-js-pagination
- dev-feature/expanded-sidebar
- dev-feature/group-fluid-grid
- dev-fix/slider-item-id-duplication
- dev-feature/no-google-translate-on-icons
- dev-feature/hamburger-menu-styling-kirki
- dev-fix/product-list
- dev-fix/header-button-size
- dev-fix/duplicated-menu-ids
- dev-fix/wrong-lat-lng-pins
- dev-fix/osm-nofollow
- dev-feature/pagination-randomize
- dev-feature/tags-compress
- dev-feature/slider-gap-padding
- dev-feature/hero-poster-image
- dev-feature/card-datebadge-no-image
- dev-feature/osm-accessibility
- dev-fix/icon-name-google-search
- dev-feature/drawer-close-context
- dev-fix/filterSelect-option-amp
- dev-feature/custom-css-to-styleguide
- dev-fix/segment-text-alignment
- dev-fix/segment-alignment
- dev-fix/component-has-content-warning
- dev-feature/field-labels
- dev-feature/osm-tooltip-link
- dev-fix/block-datebadge-position-CU-865c8ry0b
- dev-feature/openstreetmap-tooltip-data
- dev-feature/collection-posts
- dev-feature/added-some-defaults-to-osm
- dev-feat/modal-close-button-text-CU-865c4k3qa
- dev-fix/drawer-overlay-not-showing
- dev-feature/multiple-maps
- dev-feature/openstreetmap-sidebar-containerAwareness
- dev-feature/disabled-button-styling
- dev-fix/icon-classList
- dev-feature/Hela-textplattan-lnkad-i-Posts-modulens-layout-segment-CU-865c6dz40
- dev-fix/hero-trim-content-CU-865c63ydn
- dev-fix/toggle-button-states-CU-865c5r7e4
- dev-feature/openstreetmap-component
- dev-feature/slider-video-pause
- dev-feature/Bike-approved-accomodation-CU-865c4k9mc
- dev-fix/empty-blocks
- dev-feat/drawer-screen-sizes
- dev-feature/pagination-parameter
- dev-feature/hide-term-icon
- dev-feature/component-inlinestylecss
- dev-feature/inherit-term-colors
- dev-feature/custom-color-icon-on-tags
- dev-fix/fix-customColor-param-on-icon
- dev-feature/full-width-section-innerblox
- dev-feature/block-icon
- dev-feature/icon-background-color-menu
- dev-feature/segment-icon
- dev-feature/collection-as-posts
- dev-feature/hide-li-if-empty
- dev-feature/select-ev-filterSelect-fr-dubbla-idn-CU-865bzf66n
- dev-feature/like-posts
- dev-feature/list-styling
- dev-feature/list-icon-added
- dev-feature/multiple-preselected-select-values
- dev-feature/remove-segment-card-margin-no-image
- dev-feature/c-brand
- dev-fix/name-attribute-on-filterSelect
- dev-feature/card-icon
- dev-fix/select-size
- dev-feature/collection-style
- dev-feature/filterSelect-component
- dev-feature/outlined-icons
- dev-feat/hero-content-bg-color
- dev-feature/Vidareutveckla-social-medie-modulcurator-CU-865bhckjt-2
- dev-feature/3.0/siteselector
- dev-feature/adding-secondary-meta-to-box
- dev-feature/Hmta-in-befintlig-funktion-fr-att-visa-lstid-CU-865btwwv8
- dev-feature/tags-styling
- dev-feature/posts-segment-as-slider
- dev-feature/segment-cleanup
- dev-feature/tags-naming-refactor
- dev-feature/modal-component
- dev-feature/field-description
- dev-feature/nav-search-styling
- dev-feature/posts-as-collection
- dev-feature/hero-font-color
- dev-feature/hero-meta-acf
- dev-feature/dropdown-menu
- dev-feature/dropdown-idea
- dev-feature/hero-meta
- dev-feature/field-styling
- dev-feature/new-hero-view
- dev-feature/tooltip-overflow-fix
- dev-fix/tooltip-z-index
- dev-feature/new-hero-style
- dev-feature/Lgg-till-policy-fr-ny-leverantr-CU-865begc4v
- dev-feature/slider_item-utility
- dev-feature/header-nav-style
- dev-feature/segment-hide-content
- dev-fix/acceptance-play-button-appearance
- dev-feature/Cover-art-fr-videos-i-acceptance-CU-3ymrp06
- dev-3.0/feature/collection-layout
- dev-feature/segment-text
- dev-feature/progress-bar
- dev-feature/tooltip-rework
- dev-feature/card-slot
- dev-feature/card-meta-first
- dev-feature/smarter-group
- dev-feature/slider-tabindex
- dev-feature/fileupload-refactoring
- dev-feature/tooltip
- dev-feature/tab-index-acceptance-video
- dev-fix/unescape_slashes
- dev-feature/hamburger-icons
- dev-feature/hamburger-menu-colors
- dev-feature/slider-aria-labeledby
- dev-access/button-aria-label
- dev-feature/correct-role-and-aria-label-on-hero-+3wnwt19
- dev-feature/tabindex-modal
- dev-fix/Stt-aria-role-p-hero-CU-3wnwt19
- dev-feature/Ikoner-orsakar-problem-med-Synlig-etikett-och-tillgngligt-namn-verensstmmer-inte-CU-3wvjta9
- dev-feature/hero-video-animation
- dev-fix/acceptance-accessibility
- dev-feature/aria-role-region-on-hero
- dev-access/event-form-labels-etc
- dev-feature/hero-animation
- dev-feature/Omslut-drawer-med-nav-CU-3wnqxb3
- dev-feature/List-items-i-undermenyer-i-hamburger-menyn-anvnder-fel-post-id-CU-3waba4d
- dev-3.0/feature/video-subtitles
- dev-fix/field-validation-messages
- dev-feature/Rendera-bilder-i-the_content-via-komponenten-image-med-openModal-CU-3nb8pzn
- dev-feature/slider-accesibility
- dev-feature/Hantera-src-inlagda-med-dubbla-snedstreck-men-utan-protokoll-CU-3tmgvxm
- dev-feature/drawer-slot-check
- dev-feature/additional-embed-parameters-youtube
- dev-feature/drawer-id
- dev-feature/accordion-expandable-list
- dev-feature/input-focus-styler
- dev-fix/fixed-missing-curly-brace
- dev-feature/acceptance-supplier-visual-identification
- dev-feature/file-uplaod-list-rendering
- dev-feature/modal-colors
- dev-feature/iframe-v3
- dev-fix/ensure-json-not-string
- dev-feature/Feedback-filuppladdning-formulr-CU-3qfy5er
- dev-fix/wp-function-used-in-slider
- dev-feature/button-aria-label
- dev-feature/slider-in-post-module
- dev-fix/form-id-attribute-move
- dev-3.0/descriptions-etc-2
- dev-3.0/descriptions-for-form-inputs
- dev-fix/dropshadows
- dev-3.0/feature/aria-label-on-iframe-component-2
- dev-feature/translation-iframe
- dev-feature/added-supplier
- dev-feature/iframe-modifier
- dev-fix/button-accessibility
- dev-fix/table-fullscreen
- dev-3.0/feature/aria-label-on-iframe-component
- dev-fix/broken-radio-checkbox
- dev-feature/json-format
- dev-fix/iframe-default-values
- dev-fix/getSuppliers
- dev-feature/c-acceptance
- dev-feature/field-hidden-label
- dev-feature/auto-append-id
- dev-feature/c-iframe
- dev-feature/iframe-BEM
- dev-feature/iframe-video
- dev-feature/changeable-iframe-classes
- dev-feature/lit-web-component
- dev-3.0/feature/slider-navaigation-placement-parameter
- dev-3.0/iframe-unknown-name
- dev-3.0/fix/mitigate-undefined-variable-notice
- dev-feature/iframe-markup-moved
- dev-3.0/feature/iframe
- dev-feat/testimonials-slider
- dev-3.0/feature/table-flat-style
- dev-3.0/fix/prefooter-postfooter-undefined
- dev-fix/php-hero-warnings
- dev-fix/php-errors
- dev-build-attributes-handle-quotationmarks-2
- dev-revert-126-build-attributes-handle-quotationmarks
- dev-build-attributes-handle-quotationmarks
- dev-3.0/feature/iframe-build-embed-url
- dev-feature/testimonials-card
- dev-3.0/feature/iframe-implement-consent
- dev-feature/iframe-services-list-CU-3creqdc
- dev-3.0/feature/iframe-list-test
- dev-fix/drawer-description
- dev-bug/no-id-on-options
- dev-feature/iframe-border
- dev-feature/iframe-component
- dev-fix/iframe-gdpr-changes-deployed-too-early
- dev-feature/iframe-default-settings
- dev-feature/drawer-language
- dev-feature/add-iframe-component
- dev-3.0/feat-php-update
- dev-3.0/feature/drawer-component
- dev-feature/remove-unique-id
- dev-feature/card-footer
- dev-feature/card-image-position-fix
- dev-feature/autoslide
- dev-feature/products-new-design
- dev-feature/box-icon
- dev-feature/section-overlay
- dev-feature/added-autopromote-slider
- dev-feature/block-excerpt
- dev-feature/block-ratio
- dev-feature/dateformat
- dev-feature/slider-overlay-controller
- dev-feature/divider
- dev-feature/component-data-applicator
- dev-feature/fix-modal
- dev-feature/box
- dev-feature/pagination-fix
- dev-feature/add-placeholder-support
- dev-feature/button-width
- dev-feature/footer-margins
- dev-feature/new-footer
- dev-feature/subfooter
- dev-feature/datebadge
- dev-feature/refactor-post-module
- dev-feature/slider-remove-defaults
- dev-feature/use-button-styling-for-slider
- dev-feature/new-slider
- dev-feature/block-component
- dev-3.0/fix/adaptive-overlay
- dev-feature/css-vars
- dev-feature/multidimensional-head
- dev-fix/replace-wp_date
- dev-feature/table-header
- dev-feature/3.0/sanitizeStyleAttributes
- dev-feature/documentation-refresh
- dev-feature/hero
- dev-feature/table-scroll-indicator
- dev-feature/testimonials-redesign
- dev-feature/3.0/remove-js-adjustment
- dev-feature/3.0/slider-container
- dev-fix/nav-item-id
- dev-feature/fab-close-prompt
- dev-feature/link-icon-underline
- dev-3.0/feature/quicklinks-bg
- dev-feature/slider-simplification
- dev-feature/3.0/slider-focal-point
- dev-fix/options-aria-checked
- dev-feature/card-meta
- dev-feature/3.0/segments
- dev-feature/3.0/sections
- dev-feature/keep-in-viewport
- dev-wip/3.0/sections-general
- dev-feature/button-icon-sizes
- dev-feature/fab-panel
- dev-feature/slider-shadow
- dev-fix/slider-item-text-escape
- dev-feature/slider-hero
- dev-feature/slider-cta
- dev-feature/component-context
- dev-fix/naming
- dev-feature/component-class-and-modifier-filters
- dev-feature/card-arrow-right
- dev-feature/header-component
- dev-fix/input-label-placeholder
- dev-fix/signature-empty
- dev-fix/slider-image-alt
- dev-fix/signature-markup
- dev-feature/slider-image-alt
- dev-feature/file-input-files-max-attribute
- dev-fix/option-and-select-update
- dev-fix/3.0/accordion-label
- dev-fix/checkbox-acessability
- dev-fix/3.0/labelledby-attribute
This package is auto-updated.
Last update: 2024-11-11 07:02:38 UTC
README
A library of blade components compatible with WordPress.
Known issues
Have any issues? This list is your first resort.
- Components refuse to show up shortly after creation. This is due to the fact that component aliases are cached. Flush blade cache in order to display the component. If you are encountering this issue, you may be able to utilities the component name directly by referring to @component.component instead of @component.
Example usage
A registered component can be utilized as a component or directive just as in laravel. They do however have the added functionality to load the controller before render to enshure that stuff is formatted and defined.
Render a component
@icon(['icon' => 'apps', 'size' => 'md']) @endicon
Data flow
Base controller components This controller handles all data flow to every component. There are multiple ways of inputting data to a component.
-
The default configuration of the component. These settings are made in the configuration json in each component folder. All variables used in the controller SHOULD be declared here. This is to avoid undeclared variabe varnings.
-
By populating the directive (in view file). This should be data that idicates states like isDisabled => true etc. This is the main location of end user customization.
-
By data manipulation in the controller connected to each component. This data can be in every form, but should focus on translating other input to view data. This file can contain clear-text-classes.
Example:
if($isDisabled) { $this->classList[] = 'disabled'; }
Filters
When component library is used in WordPress. Filters are enabled to allow for filtering from WordPress. There are multiple filters for each component.
Filter (General): BladeComponentLibrary/Component/Data - Takes $data
Filter (Component specific): ComponentLibrary/Component/ComponentName/Data - Takes $data
Filter class (General): ComponentLibrary/Component/Class - Takes $class
Filter class (Component specific): ComponentLibrary/Component/ComponentName/Class - Takes $class
Each data attribute also has a corresponding filter eg. ComponentLibrary/Component/ComponentName/dataVar
Additional paths (WordPress Specific)
You may ask the component library to render more view paths by using the ComponentLibrary/ViewPaths filter. Simply add another path to the component library by doing the following:
add_filter('ComponentLibrary/ViewPaths', function($viewPaths) (
if(is_array($viewPaths)) {
$viewPaths = [];
}
$viewPaths[] = "/path/to/plugin/views";
return $viewPaths;
));
Iframe
ComponentLibrary/Component/Iframe/GetSuppliers
Alter the list of pre-defined suppliers (sources) for iframes
@param array $suppliers
- Array containing the suppliers as Supplier objects
apply_filters('ComponentLibrary/Component/Iframe/GetSuppliers', $suppliers );
add_filter('ComponentLibrary/Component/Iframe/GetSuppliers', function($suppliers) { return $suppliers; }, 10, 1 );
Icon
ComponentLibrary/Component/Icon/AltTextPrefix
Alter the prefix used when describing icons.
@param string $altTextPrefix
- String containing prefix for alt text.
add_filter('ComponentLibrary/Component/Icon/AltTextPrefix', function($altTextPrefix) { return $altTextPrefix; }, 10, 1 );
ComponentLibrary/Component/Icon/AltText
Alter the array used when describing icons.
@param array $altText
- Array containing key for icon, and value string for descriptions.
add_filter('ComponentLibrary/Component/Icon/AltText', function($altText) { return $altText; }, 10, 1 );
ComponentLibrary/Component/Icon/AltTextUndefined
Alter the undefined message used when describing icons.
@param string $altTextUndefined
- String containing undefined message for alt text.
add_filter('ComponentLibrary/Component/Icon/AltTextUndefined', function($altTextUndefined) { return $altTextUndefined; }, 10, 1 );
Add a builtin component
The most efficient and proposed way of adding a compning is by a PR to this package. It will then be available for everyone to be used. A internal component requires three different files.
- View (name.blade.php)
- Controller (Name.php)
- Configuration (name.json)
The view
The view sould be as simple as possible, in most cases just a few if-statements. For more advanced solution, please consider to use components as childs to a larger component according to Atomic design principle.
Example:
<a class="{{ $class }}" target="{{ $target }}" href="{{ $href or '#' }}">{{ $slot or $text }}</a>
The controller
The controller should handle all logic associated with a component. This file soule purpose is to remove any logic from the view.
Example:
namespace BladeComponentLibrary\Component\Foo; class Foo extends \BladeComponentLibrary\Component\BaseController { public function init() { $this->data['foo'] = "bar"; } }
The configuration
A simple configuration of the slug for the component (used as component name). The default parameters and the view name (defaults to the slug name). The configuration should be written in a valid json format. This file must contain the keys "slug", "default" (default parameters), description and "view".
Example:
{ "slug":"foo", "default":{ "foo":true, }, "description":{ "foo": "Is it foo?", }, "view":"foo.blade.php" }