FriendsOfSymfony/FOSCommentBundle

Nothing is appearing for me

DylanB85 opened this issue · 1 comments

Hi guys, nothing is appearing for me once I've finished following the installation guide. I've created both my comment and thread entity classes as far as I can notice.

`<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use FOS\CommentBundle\Entity\Comment as BaseComment;

/**

  • @ORM/Entity

  • @Orm\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
    /
    class Comment extends BaseComment
    {
    /
    *

    • @Orm\Id
    • @Orm\Column(type="integer")
    • @Orm\GeneratedValue(strategy="AUTO")
      */
      protected $id;

    /**

    • @var Thread
    • @Orm\ManyToOne(targetEntity="AppBundle\Entity\Thread")
      */
      protected $thread;
      }`

`<?php
namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use FOS\CommentBundle\Entity\Thread as BaseThread;

/**

  • @Orm\Entity
  • @Orm\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
    /
    class Thread extends BaseThread
    {
    /
    *
    • @var string $id
    • @Orm\Id
    • @Orm\Column(type="string")
      */
      protected $id;
      }`

I've also issued the command in the command line php bin/console doctrine:schema:update --force, but have not noticed any new tabled in my MySQL Workbench.

I've finally laid out my index.html.twig file like this
`{% extends 'base.html.twig' %}

{% block body %}
{% include '@FOSComment/Thread/async.html.twig' with {'id': 'foo'} %}
{% endblock %}

{% block javascripts %}
<script src="http://code.jquery.com/jquery-3.2.1.js"></script>
{% endblock %}
`

And yet, nothing appears at the end. Could someone with more knowledge on this bundle let me know where I potentially went wrong? If you need to see any more code I'd be more than happy to show you.

Also this is how the JavaScript code looks in the page's source code

`
// thread id

  | var fos_comment_thread_id = 'foo';
  | var fos_comment_thread_view = 'tree';
  |  
  | // api base url to use for initial requests
  | var fos_comment_thread_api_base_url = '/api/threads';
  |  
  | // Snippet for asynchronously loading the comments
  | (function() {
  | var fos_comment_script = document.createElement('script');
  | fos_comment_script.async = true;
  | fos_comment_script.src = '/bundles/foscomment/js/comments.js';
  |  
  | (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(fos_comment_script);
  | })();

`

Maybe you need to import first the jquery , and after import the template