PHP code example of derekderaps / twigshim

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

    

derekderaps / twigshim example snippets


/**
 * Implements hook_block_view().
 */
function mymodule_block_view($delta = '') {
  switch ($delta) {

    // Render the header block.
    case 'myblock':
      return twigshim_render('chrome/header.twig', array(
        'campaign'  => variable_get('mysite_current_campaign', 'Donate now!'),
        'hidePopup' => !user_is_anonymous(),
      ));
      break;
  }
}