This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Form/SubmitButton.php

52 lines
1.0 KiB
PHP
Raw Normal View History

2012-12-31 14:29:36 +00:00
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form;
/**
* A button that submits the form.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class SubmitButton extends Button implements ClickableInterface
{
/**
* @var Boolean
*/
private $clicked = false;
/**
* {@inheritdoc}
*/
public function isClicked()
{
return $this->clicked;
}
/**
* Submits data to the button.
2012-12-31 14:29:36 +00:00
*
* @param null|string $submittedData The data
*
* @return SubmitButton The button instance
*
* @throws Exception\AlreadySubmittedException If the form has already been submitted.
2012-12-31 14:29:36 +00:00
*/
public function submit($submittedData)
2012-12-31 14:29:36 +00:00
{
parent::submit($submittedData);
2012-12-31 14:29:36 +00:00
$this->clicked = null !== $submittedData;
return $this;
}
}