herzult / herzultforumbundle Goto Github PK
View Code? Open in Web Editor NEWA simple Symfony forum bundle.
A simple Symfony forum bundle.
Documentation in regard with MongoDB installation is missing from Resources/doc
The bundle has a composer.json file but is not registered on packagist, making it harder to use it through composer. Technically, anybody could register it but it is considered a bad practice to register it when you are not the maintainer (as it means you would be the maintainer on packagist instead of the real maintainer). So please register it on packagist (it is simply a matter of creating an account (if you don't have one) and submit the url of the github repo
I get this error when trying to configure the forum in app/config/config.yml as per the README:
InvalidArgumentException: There is no extension able to load the configuration for "forum.config" (in /srv/http/neverside/Symfony/app/config/config.yml). Looked for namespace "forum.config", found "framework", "security", "twig", "monolog", "swiftmailer", "doctrine", "assetic", "sensio_framework_extra", "jms_security_extra", "acme_hello", "acme_test", "forum", "doctrine_mongodb", "acme_demo", "web_profiler", "sensio_distribution"
replacing "forum.config" with "forum" makes it not complain, but I'm still not sure if this is right.
Hi,
I'm trying to install and configure the forum bundle with my existing site. I followed the documentation's instructions but I get an error when I try to display the forum index : Class Site\ForumBundle\Model\Topic is not a valid entity or mapped super class.
Here is my config.yml :
herzult_forum:
db_driver: orm
class:
model:
category: Site\ForumBundle\Model\Category
topic: Site\ForumBundle\Model\Topic
post: Site\ForumBundle\Model\Post
blamer:
topic: Site\ForumBundle\Blamer\Blamer
post: Site\ForumBundle\Blamer\Blamer
Topic.php entity :
<?php
namespace Site\ForumBundle\Model;
use Herzult\Bundle\ForumBundle\Entity\Topic as BaseTopic;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="Herzult\Bundle\ForumBundle\Entity\TopicRepository")
*/
class Topic extends BaseTopic
{
/**
* @ORM\ManyToOne(targetEntity="Category")
*/
protected $category;
/**
* {@inheritDoc}
*/
public function getAuthorName()
{
return 'Anonyme';
}
/**
* @ORM\ReferenceOne(targetEntity="Site\UserBundle\Entity\User")
*/
private $author;
public function setAuthor( Site\UserBundle\Entity\User $user )
{
$this->author = $user;
}
public function getAuthor()
{
return $this->author;
}
}
Any ideas ?
Hello,
I am new in Symfony and I am trying to implement your bundle in a project. I feel very stupid because I have been working a whole day on a single issue and I cannot really pin it. Here is my (long) error message
Catchable Fatal Error: Argument 1 passed to Herzult\Bundle\ForumBundle\Model\Topic::setCategory() must be an instance of Herzult\Bundle\ForumBundle\Model\Category, string given, called in C:\Users\CrazyMum\wamp_with_symphony\wamp\www\Forum_Sf2_HerzultNew\vendor\symfony\src\Symfony\Component\Form\Util\PropertyPath.php on line 346 and defined in C:\Users\CrazyMum\wamp_with_symphony\wamp\www\Forum_Sf2_HerzultNew\vendor\bundles\Herzult\Bundle\ForumBundle\Model\Topic.php line 313
Apparently it does not recognize my category as an object instance of Category and I do not understand why since I have checked in many places and I can get its properties so it is indeed a Category instance. Can it be related with the way the topic, post and category are defined in the database? And, by the way, in the topic class, its category property is related to what? The id of category instance or its name or ?? Same question for the relation between post and topic. I am completely blocked and need your help, if possible.
Thank you in advance.
Domi
Hi,
I have installed the Herzult Fourm Bundle (https://github.com/Herzult/HerzultForumBundle) into my Symfony 2 application, added the calls in the app kernel and auto load and extended the base classes. The problem i am having is i have a site layout that is applied to every page in the application and i want to render the forum within this.
I am very new to Symfony and PHP, but i have tried a few ways to get this working. I have a controller method set up that will render the forum page correctly which is set through the normal routing configuration, i can also set it up so that is routes to the index method in the Forum controller in the Herzult forum bundle. However this renders the default styles for the forum index page and is not contained by the layout i require.
Can someone provide me with an example of how to implement the forum and integrate it into a site? A simple example would point me in the right direction.
Thanks
According to http://docs.symfony-reloaded.org/guides/bundles/best_practices.html, and because having the doc available locally after downloading the Bundle is useful. And it makes it easier to collaborate on it.
Talking about bundle best practices, the website also recommends using RST. I personnaly won't until a good RST PHP parser is available. Was a sidenote.
I used
forum:
resource: "@ForumBundle/Resources/config/routing/forum.xml"
prefix: /
but this gives the next error...
Cannot import resource "@ForumBundle/Resources/config/routing/forum.xml" from "/home/classic/domains/britishclassiccars.nl/app/config/routing.yml". Make sure the "ForumBundle" bundle is correctly registered and loaded in the application kernel class.
Omitting the doublequotes and the @ makes no sense, so i wonder what is wrong here.
and yes, the bundle is in my appkernel as the document states.
First it took me two days to get that PagerFanta installed, now i'm not able to get this bundle going.
Why it always needs to be that frigging difficult to get something installed in SF2 ?
An exception has been thrown during the rendering of a template
("Warning: class_parents(): Class Acme\Model\Topic does not exist
and could not be loaded in /srv/http/myapp/Symfony/vendor/doctrine/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php
line 223") in "HerzultForumBundle:Forum:index.html.twig" at line 10.
I get this error trying to view Forum:index. I installed per the new documentation w/ FOSUserBundle. I'm still new to Symfony so any help would be greatly appreciated!
Hello, is anybody here? I get the same issue, this is the link.
I look at the way he solved, but it doesn't work. Can you help me?
Hello, maybe I'm stupid I don't know... but I simply can't make it work... maybe a better documentation or more detailed would be great... I also have a related post here
Also ODM documentation is missing :/
An exception has been thrown during the rendering of a template ("The autoloader expected class "Rms\ForumBundle\Model\Topic" to be defined in file "/var/www/Symfony/app/../src/Rms/ForumBundle/Model/Topic.php". The file was found but the class was not in it, the class name or namespace probably has a typo.") in HerzultForumBundle:Forum:index.html.twig at line 10.
500 Internal Server Error - Twig_Error_Runtime
1 linked Exception:
RuntimeException
But I have written in config.yml :
herzult_forum:
db_driver: orm
class:
model:
category: Rms\ForumBundle\Model\Category
topic: Rms\ForumBundle\Model\Topic
post: Rms\ForumBundle\Model\Post
blamer:
topic: Rms\ForumBundle\Blamer\TopicBlamer
post: Rms\ForumBundle\Blamer\PostBlamer
And the Post.php :
<?php
namespace Rms\ForumBundle\Entity;
use Herzult\Bundle\ForumBundle\Entity\Topic as BaseTopic;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="Herzult\Bundle\ForumBundle\Entity\TopicRepository")
*/
class Topic extends BaseTopic
{
/**
* @ORM\ManyToOne(targetEntity="Category")
*/
protected $category;
/**
* @ORM\ReferenceOne(targetEntity="User")
*/
private $author;
public function setAuthor(User $user)
{
$this->author = $user;
}
public function getAuthor()
{
return $this->author;
}
public function getAuthorName()
{
return 'anonymous';
}
}
Hello, I'm newer in symfony, so I'm sorry if my question is obvious. I've installed your HerzultForumBundle following the installing instructions and it seems that it is working, but when I try to create a topic or a post, the answer is:
Expected argument of type "object, array or empty", "string" given in /MiServer/transf/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php at line 30
if (!is_array($data) && !is_object($data)) {
throw new UnexpectedTypeException($data, 'object, array or empty');
}
I've added to my routing file the next code:
forum:
resource: @HerzultForumBundle/Resources/config/routing/forum.xml
prefix: /forum
forum_category:
resource: @HerzultForumBundle/Resources/config/routing/category.xml
prefix: /forum
forum_topic:
resource: @HerzultForumBundle/Resources/config/routing/topic.xml
prefix: /forum
I'm not sure if I'm doing anything wrong. Do you know what could it be? I've wasted a lot of time trying to fix it. Thank you
Could you add this features ? Because edit messages, delete (for the admin), and subcategories are base features for a forum, isn't it ?
Installed via composer, and verified the bundle is there
Added
new Herzult\Bundle\ForumBundle\HerzultForumBundle()
to AppKernel
And now it breaks with
PHP Fatal error: Class 'Herzult\Bundle\ForumBundle\HerzultForumBundle' not found in /..../app/AppKernel.php on line 27
Symfony 2.2
For me it looks like your composer autoload is wrong
"autoload": {
"psr-0": { "Herzult\\HerzultForumBundle": "" }
},
"target-dir": "Herzult/HerzultForumBundle"
Maybe add a simple travis test to your bundle, and write a few tests, just to check if the bundle actually works :)
Hi,
Where can i see a demo for this bundle ?
Thanks,
Bye
Hello,
If I create subject "Test" and another one "Test" โ their slug would be identical, so do URL.
Hi all,
I'm starting with Symfony2 and I readed the documentation of the herzult/forumbundle.
I don't find how to add a new category in the CategoryController.php file.
If I'm right, we must add a new category and then add new topics...
So, I'm not sure that I musst rewrite thoses functions?
Can anyone help me?
Thanks!
An exception has been thrown during the rendering of a template ("Controller "Bundle\ForumBundle\Controller\TopicController::listAction()" requires that you provide a value for the "$category" argument (because there is no default value or because there is a non optional argument after this one).") in "ForumBundle:Forum:index.html.twig" at line 10.
After following the installation instructions in the README, I get this far when going to app_dev.php/forum/ . Do I need to create a category? How do I do that?
What's the point having forms as services?
$form = $this->get('forum.form.post');
Clear for Unit testing?
Thanks
The problem appears since this commit in the master branch (2.1-dev) :
symfony/symfony@789d5ad#src/Symfony/Bundle/FrameworkBundle/HttpKernel.php
In Category\show.html.twig
{% render 'HerzultForumBundle:Topic:list' with {'category': category, ... %}
Regards,
can you add a composer.json ?
thx :)
Hello, is anybody here? I get the same issue, this is the link.
I look at the way he solved, but it doesn't work. Can you help me?
Hello,
I started to implement nested categories based on Nested Tree behaviours (https://github.com/stof/StofDoctrineExtensionsBundle). It works well without big modification.
Is it a wanted feature? Or do you suggest to create an overloading bundle?
In addition, it seems template views are fixed (a view has to be in HerzultForumBundle). Right? Is there a reason?
Thanks & Regards,
The test has two references to the configLoad function call, but the DI class only has a load method now.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.