What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello All, I am trying to add a newsletter type form in my Yves, followed the below document but am

U028VTHNMF1
U028VTHNMF1 Posts: 64 🧑🏻‍🚀 - Cadet

Hello All,
I am trying to add a newsletter type form in my Yves, followed the below document but am getting called to an undefined method error. Can anybody say how to reslve this?

Comments

  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer

    Have a look at the \Spryker\Yves\Checkout\CheckoutFactory , this will solve your issue 😉

  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer

    Longer explanation:

    The Symfony form factory needs to be retrieved from the global dependency via

    $this->getProvidedDependency(<YourDependencyProvider>::FORM_FACTORY);
    

    therefore your dependency provider needs to have the right constant:

        /**
         * @see \Spryker\Shared\Application\ApplicationConstants::FORM_FACTORY
         *
         * @var string
         */
        public const FORM_FACTORY = 'FORM_FACTORY';
    
  • U028VTHNMF1
    U028VTHNMF1 Posts: 64 🧑🏻‍🚀 - Cadet
    edited October 2021

    @UL6DGRULR actually I am referring to the official document, which doesn't have a dependency provider implemented, can we create a form in Yves in that approach. Attaching that document link for your reference.
    https://documentation.spryker.com/docs/t-working-forms

  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer

    That seems wrong in the documentation, the createFormFactory method used there from the AbstractFactory is gone since 2017 (v3.0.0 of spryker/kernel: https://github.com/spryker/kernel/releases/tag/3.0.0).