PHP code example of axllent / silverstripe-list-to-bootstrap-grid
1. Go to this page and download the library: Download axllent/silverstripe-list-to-bootstrap-grid 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/ */
axllent / silverstripe-list-to-bootstrap-grid example snippets
use Axllent\ListToBootstrapGrid\ListToBootstrapGrid;
class CategoryPageController extends PageController
{
public function getProductRows()
{
return ListToBootstrapGrid::create(
$this->Products(), // The list you wish to convert
$columns = 3, // Columns per row - must divide into 12!
$center = true // Center-align last row if < than $columns
);
}
}