本文整理汇总了PHP中Forms::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Forms::select方法的具体用法?PHP Forms::select怎么用?PHP Forms::select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Forms
的用法示例。
在下文中一共展示了Forms::select方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Forms
if (!$skip) {
$db->insert('products', 'user_id,last_edited,collection_id,name,sku', $_SESSION['userid'] . "||" . $_SESSION['userid'] . "||" . $_POST['collections'] . "||{$name}||{$sku}");
}
$num++;
}
}
$form = new Forms();
echo '<div class="row"><div class="col-md-6">';
$html->title('Data Merge Products', null, 'left');
echo '</div><div class="col-md-6 text-right">';
$form->button('Create Products', 'md', 'mass_products');
echo '</div></div>';
echo '<hr />';
$form->start('mass.php', false, 'mass_products');
echo '<div class="row"><div class="col-md-6 col-md-offset-3">';
$form->select('start', 'Lists', 'lists');
$lists = $db->select('lists');
foreach ($lists as $list) {
$form->select('option', $list['list_name'], $list['id']);
}
$form->select('end');
$form->select('start', 'Collections', 'collections');
$collections = $db->select('collections');
foreach ($collections as $collection) {
$form->select('option', $collection['name'], $collection['id']);
}
$form->select('end');
$form->input('Name', 'name');
$form->input('Sku Prefix', 'sku');
echo '</div></div>';
$form->end();
示例2: isset
echo '</div>';
echo '</div>';
$form->input('email');
$form->input('telephone');
echo '</div>';
echo '<div class="col-md-4">';
$form->input('company');
$form->input('street *', 'street', 'text', isset($_POST['street']) ? $_POST['street'] : '', null, null, isset($fieldErrors['street']));
$form->input('city *', 'city', 'text', isset($_POST['city']) ? $_POST['city'] : '', null, null, isset($fieldErrors['city']));
$form->input('region *', 'region', 'text', isset($_POST['region']) ? $_POST['region'] : '', null, null, isset($fieldErrors['region']));
$form->input('postcode *', 'postcode', 'text', isset($_POST['postcode']) ? $_POST['postcode'] : '', null, null, isset($fieldErrors['postcode']));
echo '</div>';
echo '<div class="col-md-4">';
$form->selectLive('country *', 'country_id');
foreach ($api->ISOCodes as $key => $ISOCode) {
$form->select('option', $ISOCode, $key, isset($_POST['country_id']) ? $key == $_POST['country_id'] : 'GB');
}
$form->select('end', 'country');
$form->select('start', 'Format *', 'postType');
foreach ($postTypes as $key => $postType) {
$form->select('option', $postType, $key, isset($_POST['postType']) ? $key == $_POST['postType'] : null);
}
$form->select('end', 'Format');
$form->select('start', 'Services *', 'shipping_description');
foreach ($services as $key => $service) {
$form->select('option', $service, $key, isset($_POST['shipping_description']) ? $key == $_POST['shipping_description'] : '2nd');
}
$form->select('end', 'Services');
echo '</div>';
echo '</div>';
$form->end();
示例3:
// valeur Champs
$arrayInputs = ['Nom', 'Prénom', 'Age', 'ville', 'Nationalité', 'Pays', 'Job', 'CP', 'Niveau d\'étude', 'others'];
$size = ['1', '2', '3'];
$freetime = ['sport', 'lecture', 'other ...'];
$sexe = ['M', 'F'];
$arrayTextareas = ['description', 'Je ne sais pas'];
$arrayCheckbox = ['1', '2', '3', '4', '5'];
$arrayRadio = ['Truc1', 'Truc2', 'Truc3', 'Truc4', 'Truc5'];
// initiation du Form
echo $form->initForm();
// Input
foreach ($arrayInputs as $arrayInput) {
echo $form->input($arrayInput);
}
// select
echo $form->select('loisirs', $freetime);
echo $form->select('taille', $size);
echo $form->select('Sexe', $sexe);
// checkbox
echo $form->checkbox('Les Trucs', $arrayCheckbox);
echo $form->bpRadio('Un Truc', $arrayRadio);
// Textarea
foreach ($arrayTextareas as $arrayTextarea) {
echo $form->textarea($arrayTextarea);
}
// button
echo $form->buttons('resset');
echo $form->buttons('submit');
// fin du formulaire
$form->endForm();
?>
示例4: collection
public function collection()
{
global $db;
$results = $db->select("settings", null, "barcodes", 1);
$settings['site']['barcodes'] = $results['barcodes'];
$results = $db->select("collections", null, "id,name,barcodes", null, "name");
$form = new Forms();
$form->start("import.php?step=3", false, "step-3");
echo "<div class='row'>";
echo "<div class='col-xs-12 col-sm-10'>";
$form->selectLive("collections");
foreach ($results as $key => $collection) {
$bc = null;
if ($collection['barcodes'] and $settings['site']['barcodes']) {
$bc = " (Expects Barcodes)";
}
$form->select("option", $collection['name'] . $bc, $collection['id']);
}
$form->select("end");
echo "</div>";
echo "<div class='col-xs-12 col-sm-2'>";
$form->input("barcode overide", "bco", "toggle", 0);
echo "</div>";
echo "</div>";
$form->end();
}
示例5: form
public function form()
{
global $db, $html, $settings;
$form = new Forms();
if ($_GET['p'] != "add") {
$modal = new Modal();
$modal->start("delete", $this->name);
echo "Are you sure you want to delete this product?";
$modal->end("delete", "products.php?c={$this->collection_id}&d={$this->product_id}" . (isset($_GET['f']) ? "&f=" . $_GET['f'] : ''));
$modal->form = true;
$modal->start("move", $this->name, "products.php?c={$this->collection_id}&move={$this->product_id}");
$collections = $db->select("collections", null, "id,name,barcodes", null, "name");
$form->select("start", "collection_id");
foreach ($collections as $key => $collection) {
if ($collection['id'] != $_GET['c']) {
$form->select("option", $collection['name'], $collection['id']);
}
}
$form->select("end");
$modal->end("move", "products.php?c={$this->collection_id}&move={$this->product_id}");
}
$form->start("products.php?c={$this->collection_id}&p={$this->product_id}" . (isset($_GET['f']) ? "&f=" . $_GET['f'] : ''));
echo "<div class='col-xs-12 col-md-6 text-right'>";
$html->button("products.php?c={$this->collection_id}" . (isset($_GET['f']) ? "&f=" . $_GET['f'] : ''), "back", "default");
$html->button("products.php?c={$this->collection_id}&p={$this->product_id}" . (isset($_GET['f']) ? "&f=" . $_GET['f'] : ''), "reset", "warning");
if ($db->is_admin() and $settings['collection']['variation_ids'] == null) {
$html->button("barcodes.php?p={$this->product_id}", "new barcode", "warning");
}
if ($_GET['p'] != "add") {
$modal->button("delete");
$modal->button("move");
}
$form->button("save");
echo "</div>";
echo "</div>";
echo "<hr />";
$collection = $db->select("collections", "id={$this->collection_id}", "*", 1);
switch ($_GET['p']) {
case 'add':
$form->input("user_id", null, "text", $_SESSION['userid'], true);
break;
default:
$form->input("id", null, "text", $this->product_id, true);
$form->input("user_id", null, "text", $this->owner_id, true);
break;
}
$form->input("barcode", null, "text", isset($this->barcode) ? $this->barcode : '', true);
$form->input("name", null, "text", $this->name, null, null, null, true, true);
echo "<div class='row'>";
echo "<div class='col-xs-12 col-sm-4'>";
$form->input("sku", null, "text", $this->sku);
echo "</div>";
echo "<div class='col-xs-12 col-sm-4'>";
$form->input("price", null, "currency", $this->price, $collection['price_overide_toggle']);
echo "</div>";
echo "<div class='col-xs-12 col-sm-4'>";
$form->input("asin", null, "text", $this->asin);
echo "</div>";
echo "</div>";
echo "<div class='row'>";
echo "<div class='col-xs-12 col-sm-6'>";
$form->input("bullet 1", "amz_bullet_1", "text", $this->amz_bullet_1, $collection['amz_toggle_1']);
$form->input("bullet 2", "amz_bullet_2", "text", $this->amz_bullet_2, $collection['amz_toggle_2']);
$form->input("bullet 3", "amz_bullet_3", "text", $this->amz_bullet_3, $collection['amz_toggle_3']);
$form->input("bullet 4", "amz_bullet_4", "text", $this->amz_bullet_4, $collection['amz_toggle_4']);
$form->input("bullet 5", "amz_bullet_5", "text", $this->amz_bullet_5, $collection['amz_toggle_5']);
echo "</div>";
echo "<div class='col-xs-12 col-sm-6'>";
$form->input("search 1", "amz_search_1", "text", $this->amz_search_1, $collection['amz_stoggle_1']);
$form->input("search 2", "amz_search_2", "text", $this->amz_search_2, $collection['amz_stoggle_2']);
$form->input("search 3", "amz_search_3", "text", $this->amz_search_3, $collection['amz_stoggle_3']);
$form->input("search 4", "amz_search_4", "text", $this->amz_search_4, $collection['amz_stoggle_4']);
$form->input("search 5", "amz_search_5", "text", $this->amz_search_5, $collection['amz_stoggle_5']);
echo "</div>";
echo "</div>";
echo "<div class='row'>";
echo "<div class='col-xs-12'>";
$form->input("description", "description", "textarea", isset($this->description) ? $this->description : null, null, 5);
echo "</div>";
echo "</div>";
$form->end();
}
示例6: form
public function form($id)
{
$form = new Forms();
$form->start("collections.php?c={$id}", false, "collection_form");
echo "<div class='row'>";
echo "<div class='col-xs-12 col-sm-6'>";
$form->input("id", null, "text", $this->collection_id, true);
$form->input("user_id", null, "text", $this->owner_id, true);
$form->input("name", null, "text", $this->name);
$form->input("category", null, "text", $this->category);
if ($_SESSION['settings']['filenames']) {
$form->input("filename prefix", "filename_prefix", "text", $this->filename_prefix);
$form->input("file directory", "file_directory", "text", $this->file_directory);
} else {
$form->input("filename prefix", "filename_prefix", "text", $this->filename_prefix, true);
$form->input("file directory", "file_directory", "text", $this->file_directory, true);
$form->input("attribute set", "attribute_set", "text", $this->attribute_set);
}
echo "</div>";
echo "<div class='col-xs-12 col-sm-6'>";
echo "<div class='row'>";
if ($_SESSION['settings']['shipping_api']) {
echo "<div class='col-xs-5'>";
$form->select('start', 'postage', 'postage', $this->postage);
$form->select('option', 'Letter', '1', $this->postage);
$form->select('option', 'Large Letter', '2', $this->postage);
$form->select('option', 'Package', '3', $this->postage);
$form->select('end');
echo "</div>";
echo "<div class='col-xs-5'>";
} else {
echo "<div class='col-xs-10'>";
}
$form->input("price", null, "currency", $this->price);
echo "</div>";
echo "<div class='col-xs-2 col-sm-2 col-md-2 col-lg-2'>";
$form->input("override", "price_overide_toggle", "toggle", $this->price_toggle);
echo "</div>";
echo "</div>";
$form->input("weight", null, "text", $this->weight);
$form->input("product suffix", "product_suffix", "text", $this->product_suffix);
if ($_SESSION['settings']['filenames']) {
$form->input("attribute set", "attribute_set", "text", $this->attribute_set);
}
echo "</div>";
echo "</div>";
echo "<div class='row'>";
if ($_SESSION['settings']['flux']) {
echo "<div class='col-xs-12 col-sm-2'>";
$form->input("flux products", "flux", "toggle", $this->flux);
echo "</div>";
}
if ($_SESSION['settings']['barcodes']) {
echo "<div class='col-xs-12 col-sm-2'>";
$form->input("add barcodes", "barcodes", "toggle", $this->barcodes);
echo "</div>";
}
echo "</div>";
echo "<div class='row'>";
echo "<div class='col-xs-12 col-sm-6'>";
$form->input("website description", "web_desc", "textarea", $this->web_desc, $_SESSION['settings']['new_descriptions'] ? null : true, 4);
$form->input("amazon description", "amz_desc", "textarea", $this->amz_desc, null, $_SESSION['settings']['new_descriptions'] ? 5 : 12);
echo "</div>";
echo "<div class='col-xs-12 col-sm-6'>";
$form->input("ebay description", "ebay_desc", "textarea", $this->ebay_desc, null, 12);
echo "</div>";
echo "</div>";
echo "<div class='row'>";
echo "<div class='col-xs-12 col-sm-6'>";
echo "<div class='row'>";
echo "<div class='col-xs-10 col-sm-10 col-md-10 col-lg-10'>";
$form->input("bullet point 1", "amz_bullet_1", "text", $this->amz_bullet_1);
echo "</div>";
echo "<div class='col-xs-2 col-sm-2 col-md-2 col-lg-2'>";
$form->input("override", "amz_toggle_1", "toggle", $this->amz_toggle_1);
echo "</div>";
echo "</div>";
echo "<div class='row'>";
echo "<div class='col-xs-10 col-sm-10 col-md-10 col-lg-10'>";
$form->input("bullet point 2", "amz_bullet_2", "text", $this->amz_bullet_2);
echo "</div>";
echo "<div class='col-xs-2 col-sm-2 col-md-2 col-lg-2'>";
$form->input("override", "amz_toggle_2", "toggle", $this->amz_toggle_2);
echo "</div>";
echo "</div>";
echo "<div class='row'>";
echo "<div class='col-xs-10 col-sm-10 col-md-10 col-lg-10'>";
$form->input("bullet point 3", "amz_bullet_3", "text", $this->amz_bullet_3);
echo "</div>";
echo "<div class='col-xs-2 col-sm-2 col-md-2 col-lg-2'>";
$form->input("override", "amz_toggle_3", "toggle", $this->amz_toggle_3);
echo "</div>";
echo "</div>";
echo "<div class='row'>";
echo "<div class='col-xs-10 col-sm-10 col-md-10 col-lg-10'>";
$form->input("bullet point 4", "amz_bullet_4", "text", $this->amz_bullet_4);
echo "</div>";
echo "<div class='col-xs-2 col-sm-2 col-md-2 col-lg-2'>";
$form->input("override", "amz_toggle_4", "toggle", $this->amz_toggle_4);
echo "</div>";
//.........这里部分代码省略.........