PHP code example of vinou / site-builder

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

    

vinou / site-builder example snippets



namespace YourVendor\YourNamespace\Processors;

class YourProcessor extends \Vinou\SiteBuilder\Processors\AbstractProcessor {

  public function dataMagic ($data = NULL) {
    $formattedData = $data;
    // transform your data here or do other stuff
    return $formattedData;
  }

}


yaml
wines/{path_segment}:
  template: 'Wines/Detail.twig'
  pageTitle: 'wine detail page'
  public: true
  dataProcessing:
    wines: getWinesAll
    bundles: getBundlesAll
    items:
      processor: 'formatter'
      function: 'mergeData'
      useRouteData: FALSE
      useData:
        - wines
        - bundles
    wineries: getWineriesAll