PHP code example of amteich / kirby-patterns

1. Go to this page and download the library: Download amteich/kirby-patterns 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/ */

    

amteich / kirby-patterns example snippets


return [
    'amteich.patterns.lock' => true,
    'amteich.patterns.title' => 'Kirby Pattern Lab',
    'amteich.patterns.path' => 'patterns',
    'amteich.patterns.directory' => '/var/www/yoursite.com/site/patterns',
    'amteich.patterns.error' => 'error',
    'amteich.patterns.preview.mode' => 'preview',
    'amteich.patterns.preview.background' => false,
    'amteich.patterns.preview.css' => 'assets/css/index.css',
    'amteich.patterns.preview.js' => 'assets/js/index.js'
];

'amteich.patterns.preview.css', ['assets/css/main.css', 'assets/css/theme.css']);

'amteich.patterns.preview.js', ['assets/js/jquery.js', 'assets/js/patterns.js']);

 

return [
  // your pattern config goes here
];

return [
  'title' => 'Pattern Title'
];

return [
  'defaults' => [
    'title' => 'Default title',
    'text'  => 'Default text'
  ]
];

return [
  'background' => '#000'
];

return [
  'hide' => true
];
 
return [
  'preview' => function() {

    site()->visit('some/page');

    return [
      'title' => page('blog/article-xyz')->title(),
      'text'  => 'Lorem ipsum…'
    ];

  }
];

 pattern('header/logo') 

 pattern('header/logo', ['class' 'logo logo-on-black'])