本文整理汇总了PHP中assign_value函数的典型用法代码示例。如果您正苦于以下问题:PHP assign_value函数的具体用法?PHP assign_value怎么用?PHP assign_value使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了assign_value函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lang
<label for="subject"><?php
echo lang('label_canned_subject');
?>
</label>
<?php
echo form_input(['name' => 'subject', 'class' => 'form-control', 'value' => assign_value('subject', $subject)]);
?>
</div>
<div class="form-group">
<label for="description"><?php
echo lang('label_canned_description');
?>
</label>
<?php
echo form_textarea(['name' => 'content', 'class' => 'redactor', 'value' => assign_value('content', $content)]);
?>
</div>
<input class="btn btn-primary" type="submit" value="<?php
echo lang('save');
?>
"/>
</form>
<script type="text/javascript">
$('form').submit(function() {
$('input[type="submit"]').attr('disabled', true).addClass('disabled');
});
</script>
示例2: lang
<label for="account_email"><?php
echo lang('account_email');
?>
</label>
<?php
echo form_input(['name' => 'email', 'value' => assign_value('email', $customer['email'])]);
?>
</div>
<div class="col" data-cols="1/2">
<label for="account_phone"><?php
echo lang('account_phone');
?>
</label>
<?php
echo form_input(['name' => 'phone', 'value' => assign_value('phone', $customer['phone'])]);
?>
</div>
</div>
<label class="checklist">
<input type="checkbox" name="email_subscribe" value="1" <?php
if ((bool) $customer['email_subscribe']) {
?>
checked="checked" <?php
}
?>
/> <?php
echo lang('account_newsletter_subscribe');
?>
</label>
示例3: form_input
?>
<tr>
<td><?php
echo $product->sku;
?>
</td>
<td><?php
echo $product->name;
?>
</td>
<td>
<?php
if ((bool) $product->track_stock) {
?>
<?php
echo form_input(['name' => 'product[' . $product->id . '][quantity]', 'value' => assign_value('quantity', $product->quantity), 'class' => 'form-control tableInput']);
?>
<?php
}
?>
</td>
<?php
foreach ($groups as $group) {
?>
<td><?php
echo $product->{'enabled_' . $group->id} == '1' ? lang('enabled') : lang('disabled');
?>
</td>
<?php
}
?>
示例4: lang
<div class="col-md-6">
<label for="price"><?php
echo lang('price');
?>
</label>
<?php
echo form_input(['name' => 'price_' . $group->id, 'value' => assign_value('price_' . $group->id, ${'price_' . $group->id}), 'class' => 'form-control']);
?>
</div>
<div class="col-md-6">
<label for="saleprice"><?php
echo lang('saleprice');
?>
</label>
<?php
echo form_input(['name' => 'saleprice_' . $group->id, 'value' => assign_value('saleprice_' . $group->id, ${'saleprice_' . $group->id}), 'class' => 'form-control']);
?>
</div>
</div>
</fieldset>
<?php
}
?>
</div>
</div>
</form>
<script type="text/template" id="relatedItemsTemplate">
<tr id="related_product_{{id}}">
<td>
<input type="hidden" name="related_products[]" value="{{id}}"/>
示例5: lang
echo lang('email');
?>
</label>
<?php
echo form_input(['name' => 'email', 'class' => 'form-control', 'value' => assign_value('email', $email)]);
?>
</div>
<div class="form-group">
<label><?php
echo lang('access');
?>
</label>
<?php
$options = ['Admin' => lang('admin'), 'Orders' => lang('orders')];
echo form_dropdown('access', $options, assign_value('phone', $access), 'class="form-control"');
?>
</div>
<div class="form-group">
<label><?php
echo lang('password');
?>
</label>
<?php
echo form_password(['name' => 'password', 'class' => 'form-control']);
?>
</div>
<div class="form-group">
<label><?php
示例6: form_input
<?php
echo form_input(['name' => 'disable_date', 'data-value' => assign_value('disable_date', $disable_date), 'class' => 'datepicker form-control']);
?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="link"><?php
echo lang('link');
?>
</label>
<?php
echo form_input(['name' => 'link', 'value' => assign_value('link', $link), 'class' => 'form-control']);
?>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label> </label>
<div class="checkbox">
<label>
<?php
echo form_checkbox(['name' => 'new_window', 'value' => 1, 'checked' => set_checkbox('new_window', 1, $new_window)]);
?>
<?php
echo lang('new_window');
?>
</label>
示例7: form_dropdown
?>
</label>
<div class="col-sm-7">
<?php
echo form_dropdown('zone_id', $zones_menu, assign_value('zone_id', $zone_id), 'id="zone_id" class="form-control"');
?>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label text-orange required"><?php
echo lang('address_zip');
?>
</label>
<div class="col-sm-7">
<?php
echo form_input(['class' => 'form-control', 'maxlength' => '10', 'name' => 'zip', 'value' => assign_value('zip', $zip)]);
?>
</div>
</div>
<button class="btn btn-primary btn-lg round pull-right" type="submit"><?php
echo lang('save_address');
?>
</button>
</form>
<script>
$(function(){
$('#country_id').change(function(){
$('#zone_id').load('<?php
示例8: lang
<label for="title"><?php
echo lang('title');
?>
</label>
<?php
echo form_input(['name' => 'title', 'value' => assign_value('title', $title), 'class' => 'form-control']);
?>
</div>
<div class="form-group">
<label for="title"><?php
echo lang('max_downloads');
?>
</label>
<?php
echo form_input(['name' => 'max_downloads', 'value' => assign_value('max_downloads', $max_downloads), 'class' => 'form-control']);
?>
<span class="help-inline"><?php
echo lang('max_downloads_note');
?>
</span>
</div>
</div>
<div class="col-md-5">
<div class="well">
<?php
echo sprintf(lang('file_size_warning'), ini_get('post_max_size'), ini_get('upload_max_filesize'));
?>
</div>
</div>
示例9: form_dropdown
echo form_dropdown('reduction_type', ['percent' => lang('percentage'), 'fixed' => lang('fixed')], $reduction_type, 'class="form-control"');
?>
</div>
<div class="col-md-6">
<?php
echo form_input(['name' => 'reduction_amount', 'value' => assign_value('reduction_amount', $reduction_amount), 'class' => 'form-control']);
?>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-md-offset-1 well pull-right">
<?php
$options = ['1' => lang('apply_to_whole_order'), '0' => lang('apply_to_select_items')];
echo form_dropdown('whole_order_coupon', $options, assign_value(0, $whole_order_coupon), 'id="gc_coupon_appliesto_fields" class="form-control"');
?>
<div id="gc_coupon_products">
<table class="table" width="100%" border="0" style="margin-top:10px;" cellspacing="5" cellpadding="0">
<tbody id="product_items_container"></tbody>
</table>
<div class="form-group">
<input class="form-control" type="text" id="product_search" placeholder="Product search" />
</div>
<div class="form-group">
<select class="form-control" id="product_list" size="5" style="margin:0px;"></select>
</div>
<div class="form-group">
<a href="#" onclick="add_product();return false;" class="btn btn-primary" title="Add Product">Add Product</a>
</div>
</div>
示例10: form_dropdown
</div>
<div class="col-md-3">
<div class="form-group">
<?php
echo form_dropdown('taxable', [0 => lang('not_taxable'), 1 => lang('taxable')], assign_value('taxable', $taxable), 'class="form-control"');
?>
</div>
<div class="form-group">
<label for="sku"><?php
echo lang('sku');
?>
</label>
<?php
echo form_input(['name' => 'sku', 'value' => assign_value('sku', $sku), 'class' => 'form-control']);
?>
</div>
<?php
foreach ($groups as $group) {
?>
<fieldset>
<legend>
<?php
echo $group->name;
?>
<div class="checkbox pull-right" style="font-size:16px; margin-top:5px;">
<label>
<?php
echo form_checkbox('enabled_' . $group->id, 1, ${'enabled_' . $group->id});
示例11: array
</label>
<?php
$data = array('name' => 'code', 'value' => assign_value('code', $code), 'class' => 'form-control');
echo form_input($data);
?>
</div>
<div class="form-group">
<label for="code"><?php
echo lang('tax');
?>
</label>
<div class="input-group">
<span class="input-group-addon">%</span>
<?php
$data = array('name' => 'tax', 'class' => 'form-control', 'maxlength' => '10', 'value' => assign_value('tax', $tax));
echo form_input($data);
?>
</div>
</div>
<button type="submit" class="btn btn-primary"><?php
echo lang('save');
?>
</button>
</form>
<script type="text/javascript">
$('form').submit(function() {
示例12: pageHeader
<?php
pageHeader(lang('customer_group_form'));
?>
<?php
echo form_open('admin/customers/group_form/' . $id);
?>
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label><?php
echo lang('group_name');
?>
</label>
<?php
echo form_input('name', assign_value('name', $name), 'class="form-control"');
?>
</div>
</div>
</div>
<input class="btn btn-primary" type="submit" value="<?php
echo lang('save');
?>
"/>
</form>
示例13: page_loop
if ($id != $page->id) {
$options[$page->id] = $dash . ' ' . $page->title;
$options = $options + page_loop($page->children, $dash . '-', $id);
}
}
return $options;
}
$options = $options + page_loop($pages, '', $id);
echo form_dropdown('parent_id', $options, assign_value('parent_id', $parent_id), 'class="form-control"');
?>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="sequence"><?php
echo lang('sequence');
?>
</label>
<?php
echo form_input(['name' => 'sequence', 'value' => assign_value('sequence', $sequence), 'class' => 'form-control']);
?>
</div>
</div>
</div>
<input class="btn btn-primary" type="submit" value="<?php
echo lang('save');
?>
"/>
</form>
示例14: form
public function form($id = 0)
{
$data['addressCount'] = \CI::Customers()->count_addresses($this->customer->id);
$customer = \CI::Login()->customer();
//grab the address if it's available
$data['id'] = false;
$data['firstname'] = $customer->firstname;
$data['lastname'] = $customer->lastname;
$data['email'] = $customer->email;
$data['phone'] = $customer->phone;
$data['address1'] = '';
$data['address2'] = '';
$data['city'] = '';
$data['country_id'] = '';
$data['zone_id'] = '';
$data['zip'] = '';
if ($id != 0) {
$a = \CI::Customers()->get_address($id);
if ($a['customer_id'] != $this->customer->id) {
redirect('addresses/form');
// don't allow cross-customer editing
}
$data = array_merge($data, $a);
$data['zones_menu'] = \CI::Locations()->get_zones_menu($data['country_id']);
}
//get the countries list for the dropdown
$data['countries_menu'] = \CI::Locations()->get_countries_menu();
if ($id == 0) {
//if there is no set ID, the get the zones of the first country in the countries menu
$data['zones_menu'] = \CI::Locations()->get_zones_menu(array_shift(array_keys($data['countries_menu'])));
} else {
$data['zones_menu'] = \CI::Locations()->get_zones_menu($data['country_id']);
}
\CI::load()->library('form_validation');
// \CI::form_validation()->set_rules('company', 'lang:address_company', 'trim|max_length[128]');
\CI::form_validation()->set_rules('firstname', 'lang:address_firstname', 'trim|required|max_length[32]');
\CI::form_validation()->set_rules('lastname', 'lang:address_lastname', 'trim|required|max_length[32]');
\CI::form_validation()->set_rules('email', 'lang:address_email', 'trim|required|valid_email|max_length[128]');
\CI::form_validation()->set_rules('phone', 'lang:address_phone', 'trim|required|max_length[32]');
\CI::form_validation()->set_rules('address1', 'lang:address', 'trim|required|max_length[128]');
\CI::form_validation()->set_rules('address2', 'lang:address2', 'trim|max_length[128]');
\CI::form_validation()->set_rules('city', 'lang:address_city', 'trim|required|max_length[32]');
\CI::form_validation()->set_rules('country_id', 'lang:address_country', 'trim|required|numeric');
\CI::form_validation()->set_rules('zone_id', 'lang:address_state', 'trim|required|numeric');
\CI::form_validation()->set_rules('zip', 'lang:address_zip', 'trim|required|max_length[32]');
if (\CI::form_validation()->run() == FALSE) {
$this->partial('address_form', $data);
} else {
$a = [];
$a['id'] = $id == 0 ? '' : $id;
$a['customer_id'] = $this->customer->id;
$a['firstname'] = \CI::input()->post('firstname');
$a['lastname'] = \CI::input()->post('lastname');
$a['email'] = \CI::input()->post('email');
$a['phone'] = \CI::input()->post('phone');
$a['address1'] = \CI::input()->post('address1');
$a['address2'] = \CI::input()->post('address2');
$a['city'] = \CI::input()->post('city');
$a['zip'] = \CI::input()->post('zip');
// get zone / country data using the zone id submitted as state
$country = \CI::Locations()->get_country(assign_value('country_id'));
$zone = \CI::Locations()->get_zone(assign_value('zone_id'));
if (!empty($country)) {
$a['zone'] = $zone->code;
// save the state for output formatted addresses
$a['country'] = $country->name;
// some shipping libraries require country name
$a['country_code'] = $country->iso_code_2;
// some shipping libraries require the code
$a['country_id'] = \CI::input()->post('country_id');
$a['zone_id'] = \CI::input()->post('zone_id');
}
\CI::Customers()->save_address($a);
echo 1;
}
}
示例15: lang
</legend>
<div class="form-group">
<label><?php
echo lang('tax_address');
?>
</label>
<?php
echo form_dropdown('tax_address', ['ship' => lang('shipping_address'), 'bill' => lang('billing_address')], assign_value('tax_address', $tax_address), 'class="form-control"');
?>
</div>
<div class="checkbox">
<label>
<?php
echo form_checkbox('tax_shipping', '1', assign_value('tax_shipping', $tax_shipping));
?>
<?php
echo lang('tax_shipping');
?>
</label>
</div>
</fieldset>
<input type="submit" class="btn btn-primary" value="<?php
echo lang('save');
?>
" />
</form>