PHP code example of madebyraygun / craft-component-library
1. Go to this page and download the library: Download madebyraygun/craft-component-library library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
madebyraygun / craft-component-library example snippets
return [
'title' => 'Button', // Custom title for the component
'hidden' => false, // Hides the component
'preview' => '@preview', // The template to render the component
'context' => [
'text' => 'Lorem Ipsum Dolor',
'class' => 'is-primary',
],
]
return [
'context' => [
'ctaText' => 'Lorem ipsum dolor sit amet',
'button' => '@button', //pulls in the entire @button context
]
]
return [
'context' => [
'ctaText' => 'Lorem ipsum dolor sit amet',
'button' => [
'text' => 'Custom text',
'class' => '@button.class' //pulls in just class value from the button component
]
]
]