Exemplo n.º 1
0
 public function getButton()
 {
     $this->setExtra('class="link-button"', true);
     return parent::getButton();
 }
 /**
  * FormHandler::cancelButton()
  *
  * Create a cancelButton on the form
  *
  * @param string $caption The caption of the button
  * @param string $url The URL to go to when the button is clicked
  * @param string $name The name of the button
  * @param string $extra CSS, Javascript or other which are inserted into the HTML tag
  * @return \FormHandler\Button\Cancel
  * @author Teye Heimans
  * @deprecated Use \FormHandler\Button\Cancel::set() instead
  */
 public function cancelButton($caption = null, $url = null, $name = null, $extra = null)
 {
     return \FormHandler\Button\Cancel::set($this, $caption, $name)->setUrl($url)->setExtra($extra);
 }
Exemplo n.º 3
0
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301  USA
 *
 * @author Ruben de Vos
 */
include '../src/Loader.php';
use FormHandler\FormHandler;
use FormHandler\Field;
use FormHandler\Button;
use FormHandler\Validator;
\FormHandler\Configuration::set('fhtml_dir', '../src/FHTML/');
$form = new FormHandler();
Button\Button::set($form, 'Disable Button')->setDisabled();
Button\Button::set($form, 'Disable and enable Button')->setDisabled()->setDisabled(false);
Button\Cancel::set($form, 'Disable CancelButton')->setDisabled();
Button\Reset::set($form, 'Disable ResetButton')->setDisabled();
//process all form results, needs to be done before any output has been done
$form_html = $form->flush();
//below is code to show the form
echo 'Test for button confirmation<hr>';
echo $form_html;