PHP code example of n2ref / coreui-layout

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

    

n2ref / coreui-layout example snippets


    $layout = new \CoreUI\Layout('layout-id');
    
    $layout->justify($layout::JASTIFY_START)
        ->align($layout::ALIGN_START)
        ->direction($layout::DIRECTION_ROW)
        ->wrap($layout::WRAP_WRAP)
        ->overflow($layout::OVERFLOW_AUTO)
        ->overflowX($layout::OVERFLOW_AUTO)
        ->overflowY($layout::OVERFLOW_AUTO)
        ->width(500)
        ->minWidth(400)
        ->maxWidth(600)
        ->height(200)
        ->minHeight(100)
        ->maxHeight(300)
        ->gap(15);
        
    $layout->addSize($layout::SIZE_SM)
        ->direction($layout::DIRECTION_ROW)
        ->justify($layout::JASTIFY_START)
        ->align($layout::ALIGN_END)
        ->wrap($layout::WRAP_WRAP);
       
    
    $item1 = $layout->addItem('id-sidebar')->content('Left')->align($layout::ALIGN_START);
    $item2 = $layout->addItem('id-content')->content('Center')->fill(true);
    $item3 = $layout->addItem('id-right_bar')
        ->content('Right')
        ->align($layout::ALIGN_STRETCH)
        ->order($layout::ORDER_0)
        ->overflow($layout::OVERFLOW_AUTO)
        ->overflowX($layout::OVERFLOW_AUTO)
        ->overflowY($layout::OVERFLOW_AUTO);
        
    $item3->addSize($layout::SIZE_XXL)
        ->align($layout::ALIGN_END)
        ->fill(true)
        ->order($layout::ORDER_2);
    
    echo json_encode($layout->toArray());