GithubHelp home page GithubHelp logo

Type error: Too few arguments to function Scheb\TwoFactorBundle\Controller\FormController::__construct(), 0 passed about two-factor-bundle HOT 2 CLOSED

herrieb avatar herrieb commented on June 3, 2024
Type error: Too few arguments to function Scheb\TwoFactorBundle\Controller\FormController::__construct(), 0 passed

from two-factor-bundle.

Comments (2)

scheb avatar scheb commented on June 3, 2024

scheb_two_factor.form_controller:form should work, the scheb_two_factor.form_controller part is the name of the service definition, which is provided by the bundle, see here: https://github.com/scheb/two-factor-bundle/blob/master/Resources/config/two_factor.xml#L54-L60

Your workaround, using SchebTwoFactorBundle:form:form instead, cannot work. The application is missing information what services to inject into the constructor, therefore it doesn't pass any services and fails with the Too few arguments error message.

Using service names in routes is definitely a Symfony 3.4 feature, as it's described in the documentation.

In addition to using the logical name or the fully-qualified class name, Symfony supports a third way of referring to a controller. This method uses just one colon separator (e.g. service_name:indexAction) and refers to the controller as a service (see How to Define Controllers as Services).

So when you're saying "this doesnt work", what exactly doesn't work? Did you even try it?

from two-factor-bundle.

herrieb avatar herrieb commented on June 3, 2024

i really did try this before, but it did not work at the time.

I now copied and pasted it from your message, and voila it works.

keep up the great work!

vielen dank!

from two-factor-bundle.

Related Issues (20)

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.