Skip to content

WIP [ticket/12066] Symfony Forms#1922

Closed
EXreaction wants to merge 22 commits intophpbb:developfrom
EXreaction:ticket/12066
Closed

WIP [ticket/12066] Symfony Forms#1922
EXreaction wants to merge 22 commits intophpbb:developfrom
EXreaction:ticket/12066

Conversation

@EXreaction
Copy link
Copy Markdown
Contributor

http://tracker.phpbb.com/browse/PHPBB3-12066

Example Form:

$form = $phpbb_container->get('form')
    ->get_builder()
    ->setAction(append_sid($phpbb_root_path . 'test.' . $phpEx))
    ->add('author', 'text', array(
        'label'  => 'AUTHOR',
    ))
    ->add('email', 'email', array(
        'label'  => 'EMAIL_ADDRESS',
    ))
    ->add('number', 'number', array(
        'max_length' => 4
    ))
    ->add('dueDate', 'date', array(
        'widget' => 'single_text',
        'label'  => 'Due Date',
    ))
    ->add('submit', 'submit')
    ->getForm()
;

$phpbb_container->get('form')->handle_request($form, $request, $symfony_request);

if ($form->isValid())
{
    echo 'valid';
}

$template->set_filenames(array('test' => 'test.html'));

$template->assign_var('testform', $form->createView());

$template->display('test');

Template:

{{form(testform)}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is identical to trans() except the $count parameter. If the function is required by Symfony to exist we should probably at least reduce code duplication by just wrapping trans() like so:
return trans($message, $arguments, $domain, $locale);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I wasn't yet exactly sure if these work this way or have some differences yet.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2013

@michaelcullum
Copy link
Copy Markdown
Contributor

https://github.com/symfony/symfony-marketing/blob/master/projects/phpbb.yml needs updating upon merging of this PR to include the new 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants