Welcome to the Cookbook

loading...

7.3.5.18 submit

submit(string $caption, array $options)

Creates a submit button with caption $caption. If the supplied $caption is a URL to an image (it contains a ‘.’ character), the submit button will be rendered as an image.

It is enclosed between div tags by default; you can avoid this by declaring $options['div'] = false.

<?php
echo $form->submit();
?>
  1. <?php
  2. echo $form->submit();
  3. ?>

Will output:

<div class="submit"><input value="Submit" type="submit"></div>

You can also pass a relative or absolute url to an image for the caption parameter instead of caption text.

<?php
echo $form->submit('ok.png');
?>
  1. <?php
  2. echo $form->submit('ok.png');
  3. ?>

Will output:

<div class="submit"><input type="image" src="/img/ok.png"></div>