PHP code example of getpop / application

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

    

getpop / application example snippets


function initModelProps($component, &$props) 
{
  switch ($component->name) {
    case self::COMPONENT_AUTHORARTICLES:

      // Set the content lazy
      $this->setProp($component, $props, 'lazy-load', true);
      break;
  }

  parent::initModelProps($component, $props);
}

function initModelProps($component, &$props) 
{
  switch ($component->name) {
    case self::COMPONENT_AUTHORARTICLESWRAPPER:

      // Set the content lazy
      $this->setProp([COMPONENT_AUTHORARTICLES], $props, 'lazy-load', true);
      break;
  }

  parent::initModelProps($component, $props);
}

function initModelProps($component, &$props) {
    
  switch ($component->name) {
    case self::COMPONENT_SOMENAME:

      $this->setProp(
        $component, 
        $props, 
        'dataload-multidomain-sources', 
        'https://anotherdomain.com'
      );
      break;
  }

  parent::initModelProps($component, $props);
}

function initModelProps($component, &$props) {
    
  switch ($component->name) {
    case self::COMPONENT_SOMENAME:

      $this->setProp(
        $component, 
        $props, 
        'dataload-multidomain-sources', 
        array(
          'https://anotherdomain1.com',
          'https://subdomain.anotherdomain2.com',
          'https://www.anotherdomain3.com',
        );
      break;
  }

  parent::initModelProps($component, $props);
}
 php
\PoP\Root\App::stockAndInitializeModuleClasses([([
    \PoP\Application\Module::class,
]);
 bash
composer analyse