PHP code example of cnp / pattern-library

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

    

cnp / pattern-library example snippets


$brief_args = [
	'name' => 'brief',
	'structure' => [
		'title' => 'The Brief',
		'description' => 'Here's the Brief!',
	]
];

$post_card_args = array(
	'name'           => 'posts',
	'posts'          => $latest_posts,
	'posts-structure' => [
		'item' => [
			'children' => ['PostClass'],
			'class' => 'column'
		],
		'PostClass' => [
			'children' => ['item-image', 'item-text'],
			'class' => 'posts-item-inside'
		],
		'item-image' => [
			'parts' => [
				'PostThumbnail'
			]
		],
		'item-text' => [
			'parts' => [
				'PostTitleLink',
				'ForceExcerpt'
			]
		]
	]
);