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 Team, Hope all are doing well! As part of learning, I'm trying to add a new field(Mobile Numb
Hello Team,
Hope all are doing well!
As part of learning, I'm trying to add a new field(Mobile Number) on SignUp page. I have extended the registerForm class in src\Pyz\Yves\Form\RegisterForm.php and added the new field there.
I have also updated the page-layout-login.twig but the field is not coming on the store
Can you please guide to the correct way of doing this?
Thanks
Comments
-
giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐ง๐ปโ๐ - Cadet
Did u extended also the FormFactory that have to use your Pyz class instead of Spryker Class?
0 -
No I have not used FormFactory can you please help me where I have to do that
0 -
Should I extend it inside form?
0 -
public function getRegisterForm() { return $this->getFormFactory()->create(RegisterForm::class); }
Do I have to override this?
0 -
giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐ง๐ปโ๐ - Cadet
Yes.. just this one, and use the Pyz RegisterForm in use statement..
0 -
Thanks for the reply,
I have added this,public function getRegisterForm() { return $this->parent::getFormFactory()->create(SignUpForm::class); }
0 -
Can you please have a look is it correct?
0 -
รnd in the page-layout-login.twig I have added the new field, is it the correct way,
layout: { salutation: 'col col--sm-12 col--md-3', first_name: 'col col--sm-12 col--md-4', last_name: 'col col--sm-12 col--md-5', mobile_number: 'col col--sm-12 col--md-5', password: 'col col--sm-12 col--md-6', }
0 -
Hi @florian.scholz, can you please help here.
Thanks
0 -
Here is the code where I have extended the register class
use SprykerShop\Yves\CustomerPage\Form\RegisterForm; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; /** * @method \SprykerShop\Yves\CustomerPage\CustomerPageConfig getConfig() */ class SignUpForm extends RegisterForm { /** * @var string */ public const FIELD_MOBILE_NUMBER = 'mobile_number'; /** * @return string */ public function getBlockPrefix() { return static::BLOCK_PREFIX; } /** * @param \Symfony\Component\Form\FormBuilderInterface $builder * @param array $options * * @return void */ public function buildForm(FormBuilderInterface $builder, array $options) { parent::buildForm($builder, $options); $this->addMobileNumberField($builder); }
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 โ๏ธ - Guardians (admin)
Hey, please have a look at this brand new elearning: https://academy.spryker.com/learn/course/external/view/elearning/481/project-customization
In the hands-on task in the end of that session you will extend the ProfileForm and add another form field. The steps there should be the same as in your use-case. This should give you hopefully some more understanding
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K ๐ Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random