Giter Club home page Giter Club logo

Comments (7)

hamzarebaichkaw avatar hamzarebaichkaw commented on June 23, 2024

"exception" => Twig_Error_Runtime {#1601 ▼
-lineno: 3
-name: "StarRatingBundle:Display:ratingDisplay.html.twig"
-rawMessage: "An exception has been thrown during the rendering of a template ("Notice: Object of class Symfony\Component\Form\FormView could not be converted to int")."
-sourcePath: "/var/www/html/MMSS/vendor/blackknight467/star-rating-bundle/blackknight467/StarRatingBundle/Resources/views/Display/ratingDisplay.html.twig"
-sourceCode: """

\n
{% for i in 1..max %}\n
\n
{% endfor %}\n

"""
#message: "An exception has been thrown during the rendering of a template ("Notice: Object of class Symfony\Component\Form\FormView could not be converted to int")."
#code: 0
#file: "/var/www/html/MMSS/vendor/blackknight467/star-rating-bundle/blackknight467/StarRatingBundle/Resources/views/Display/ratingDisplay.html.twig"
#line: 3

from starratingbundle.

blackknight467 avatar blackknight467 commented on June 23, 2024

@hamzarebaichkaw
can you post the twig you're using and the value of the variable you're passing to the rating filter?

from starratingbundle.

hamzarebaichkaw avatar hamzarebaichkaw commented on June 23, 2024

{{ form_start(commentaire, {'action': path('AjoutCommentaire') , 'method': 'POST','class':'comment-form'}) }}

{{ form_widget(commentaire.comment, { 'attr': {'class': 'form-control','cols':'45','rows':'8', 'placeholder': 'Write your comment here...'} }) }}

{{ form_widget(commentaire.rating|rating(5,"fa-3x") ) }}
</p>

Publish

{{ form_end(commentaire) }}

from starratingbundle.

blackknight467 avatar blackknight467 commented on June 23, 2024

@hamzarebaichkaw
is "commentaire.rating" a string or an int?

from starratingbundle.

hamzarebaichkaw avatar hamzarebaichkaw commented on June 23, 2024

int

from starratingbundle.

blackknight467 avatar blackknight467 commented on June 23, 2024

@hamzarebaichkaw
oh, you're trying to use a filter in your form. Just remove the rating filter and you should be fine.

{{ form_widget(commentaire.rating) }}

from starratingbundle.

hamzarebaichkaw avatar hamzarebaichkaw commented on June 23, 2024

@blackknight467
thank you it worked

from starratingbundle.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.