PHP code example of netflex / pages
1. Go to this page and download the library: Download netflex/pages 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/ */
netflex / pages example snippets
use Netflex\Pages\Components\Picture;
/**
*
*/
return [
'breakpoints' => [
'xss' => 320,
'xs' => 480,
'sm' => 768,
'md' => 992,
'lg' => 1200,
'xl' => 1440,
'xxl' => 1920,
],
'presets' => [
'default' => [
'mode' => Picture::MODE_ORIGINAL,
'resolutions' => ['1x', '2x'],
],
'banner' => [
'mode' => Picture::MODE_LANDSCAPE,
'resolutions' => ['1x', '2x'],
'size' => [1920, 600],
// Customize config per breakpoint:
'breakpoints' => [
'md' => [
'mode' => Picture::MODE_FIT,
'resolutions' => ['1x'].
],
'lg' => 'md', // Aliasing 'lg' breakpoint to 'md'
]
],
],
];
use Netflex\Pages\Page;
$page = Page::find(10000);
$slug = 'top-10-tricks-for-working-with-netflex';
$pageForUrl = Page::resolve($slug);
$firstPage = Page::first();
$lastPage = Page::last();
$newestPage = Page::orderBy('updated', 'desc')->first();
$freshPage = new Page([
'name' => 'Fresh new article',
'author' => 'John Doe',
'content' => '<h1>Hello world!</h1>'
]);
$freshPage->save();
bash
php artisan vendor:publish --tag=config