本文整理汇总了PHP中Nette\Forms\Form::addImageSelectBox方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::addImageSelectBox方法的具体用法?PHP Form::addImageSelectBox怎么用?PHP Form::addImageSelectBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Forms\Form
的用法示例。
在下文中一共展示了Form::addImageSelectBox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
* @package RadekDostal\NetteComponents\ImageSelectBox
* @example https://componette.com/radekdostal/nette-imageselectbox/
* @author Ing. Radek Dostál, Ph.D. <radek.dostal@gmail.com>
* @copyright Copyright (c) 2011 - 2016 Radek Dostál
* @license GNU Lesser General Public License
* @link http://www.radekdostal.cz
*/
use Nette\Forms\Form;
use Tracy\Debugger;
require '../vendor/autoload.php';
Debugger::$strictMode = TRUE;
Debugger::enable();
RadekDostal\NetteComponents\ImageSelectBox::register();
$items = array('calendar' => array('Calendar', 'img/icon_calendar.gif'), 'shopping_cart' => array('Shopping Cart', 'img/icon_cart.gif'), 'cd' => array('CD', 'img/icon_cd.gif'), 'email' => array('E-mail', 'img/icon_email.gif'), 'faq' => array('FAQ', 'img/icon_faq.gif'), 'games' => array('Games', 'img/icon_games.gif'), 'music' => array('Music', 'img/icon_music.gif'), 'phone' => array('Phone', 'img/icon_phone.gif'), 'graph' => array('Graph', 'img/icon_sales.gif'), 'secured' => array('Secured', 'img/icon_secure.gif'), 'video' => array('Video', 'img/icon_video.gif'));
$form = new Form();
$form->addImageSelectBox('item', 'Item:', $items)->setPrompt('— select any item —')->setRequired();
$form->addSubmit('submit', 'Send');
if ($form->isSuccess()) {
echo '<h2>Form was submitted and successfully validated</h2>';
dump($form->getValues());
exit;
}
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="author" content="Radek Dostál">
<title>RadekDostal\NetteComponents\ImageSelectBox with jQuery and jQuery msDropDown plugin example</title>
<link rel="stylesheet" type="text/css" href="js/jquery/plugins/msdropdown/css/dd.css">
<script type="text/javascript" src="//code.jquery.com/jquery-3.1.0.min.js"></script>