PHP code example of ob / cms-bundle

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

    

ob / cms-bundle example snippets



...
public function registerBundles()
{
    $bundles = array(
        ...
        new Ob\CmsBundle\ObCmsBundle(),
        new Mopa\Bundle\BootstrapBundle\MopaBootstrapBundle(),
        new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
        new Liuggio\ExcelBundle\LiuggioExcelBundle(),
        ...
    );
...



namespace Ob\CmsDemoBundle\Admin;

use Ob\CmsBundle\Admin\AbstractAdmin as Admin;

class GuitarAdmin extends Admin
{
    public function __construct()
    {
        $this->class = 'Ob\CmsDemoBundle\Entity\Guitar';
    }

    public function listDisplay()
    {
        return array('name', 'brand', 'strings', 'price', 'online');
    }

    public function formDisplay()
    {
        return array('name', 'brand', 'strings', 'price', 'online');
    }
}
yaml
# Ob/CmsDemoBundle/Resources/services.yml
services:
    ob_cms_demo.guitar.admin:
        class: Ob\CmsDemoBundle\Admin\GuitarAdmin
        tags:
            -  { name: ob.cms.admin, alias: guitar }