ZF module which facilitates integration of Disqus widgets

4.0.0 2017-07-02 08:45 UTC

This package is auto-updated.

Last update: 2024-05-06 21:54:35 UTC


Build Status Code Quality Code Coverage Latest Version

ZF module which facilitates integration of Disqus widgets.


The preferred method of installation is via Composer. Run the following command to install the latest version of a package and add it to your project's composer.json:

composer require nikolaposa/zf-disqus

Provide your Disqus shortname through configuration:

return [
    'disqus' => [
        'shortname' => 'your_disqus_shortname'
        //any other Disqus config can be provided here
    // ...

Enable the module in your application.config.php:

return [
    'modules' => [
        // ...
    // ...


This module provides a Disqus view helper (ZfDisqus\View\Helper\Disqus) which is essentially a wrapper around the DisqusHelper. Refer to the DisqusHelper project documenation for more information about available widget methods.


Typical example would be in some application which uses layouts. Widgets should be rendered in specific templates, while Disqus assets will be rendered somewhere in the layout, most commonly within the head or tail sections:


<!-- post.phtml -->

    //Page-specific Disqus configuration
        'identifier' => 'article_' . $this->post->id
        'title' => $this->post->title,

    <h1><?php echo $this->escapeHtml($this->post->title); ?></h1>

    <?php echo $this->post->body; ?>

    <!-- Thread widget HTML -->
    <?php echo $this->disqus()->thread(); ?>


<!-- layout.phtml -->

        <?php echo $this->content; ?>

        <!-- Render Disqus JS code -->
        <?php echo $this->disqus(); ?>



Released under MIT License - see the License File for details.