PHP code example of tsphethean / sculpin-related-posts-bundle

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

    

tsphethean / sculpin-related-posts-bundle example snippets


class SculpinKernel extends \Sculpin\Bundle\SculpinBundle\HttpKernel\AbstractKernel
{
    protected function getAdditionalSculpinBundles()
    {
        return array(
           'Tsphethean\Sculpin\Bundle\RelatedPostsBundle\SculpinRelatedPostsBundle'
        );
    }
}

{% if page.related %}
<ul>
  {% for relate in page.related %}
  <li><a href="{{ relate.source.url }}">{{ relate.title }}</a></li>
  {% endfor %}
</ul>
{% endif %}
app/SculpinKernel.php