PHP code example of aiphee / related-content

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

    

aiphee / related-content example snippets


Plugin::load('RelatedContent', ['routes' => true]);

$this->addBehavior('RelatedContent.InRelatedIndex');

$this->addBehavior('RelatedContent.HasRelated', isset($config['options']) ? $config['options'] : []);

<?= $this->element('RelatedContent.managingRelated', ['tables_to_get' => ['ContentNews', 'ContentPages']]) 

$entity = $this->ContentPages->get($id, [
				'getRelated' => true
			]);

<?= $this->element('RelatedContent.foreignTableSearch')