本文整理汇总了PHP中TbHtml::encode方法的典型用法代码示例。如果您正苦于以下问题:PHP TbHtml::encode方法的具体用法?PHP TbHtml::encode怎么用?PHP TbHtml::encode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TbHtml
的用法示例。
在下文中一共展示了TbHtml::encode方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
$this->beginWidget('yiiwheels.widgets.box.WhBox', array('title' => TbHtml::encode('Payment Transactions'), 'headerButtons' => array(TbHtml::buttonGroup(array(array('label' => 'Manage', 'url' => $this->createUrl('admin'), 'icon' => TbHtml::ICON_WRENCH, 'class' => 'ylink manage')), array('toggle' => TbHtml::BUTTON_TOGGLE_RADIO, 'color' => TbHtml::BUTTON_COLOR_PRIMARY)), ' ', TbHtml::buttonDropdown('Export', array(array('label' => 'Selected', 'url' => $this->createUrl('exportselected'), 'class' => 'exportSelected'), array('label' => 'All', 'url' => $this->createUrl('exportall'), 'class' => 'exportAll')), array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'icon' => TbHtml::ICON_DOWNLOAD_ALT, 'class' => 'exportDrop')), ' ', ' ')));
?>
<div id="aMessage"></div>
<div id="viewContent">
<?php
$this->renderPartial('_list', array('dataProvider' => $dataProvider));
?>
</div>
<div id="errorText" class="hide"><?php
echo Yii::t('info', 'An error has occurred');
?>
</div>
<div class="errorTextSort hide"><?php
echo Yii::t('info', 'An error has occurred during sorting');
?>
</div>
<?php
$this->endWidget();
示例2: array
<?php
echo $form->error($profile, $field->varname);
?>
</div>
<br/>
<?php
} else {
?>
<div class="row">
<strong><?php
echo TbHtml::encode(UserModule::t($field->title));
?>
:</strong>
<?php
echo TbHtml::encode($field->widgetView($model->profile) ? $field->widgetView($model->profile) : ($field->range ? Profile::range($field->range, $model->profile->getAttribute($field->varname)) : $model->profile->getAttribute($field->varname)));
?>
</div>
<br/>
<?php
}
}
}
?>
<div class="row buttons">
<?php
echo TbHtml::button(UserModule::t('Save'), array('color' => TbHtml::BUTTON_COLOR_SUCCESS, 'submit' => ''));
?>
<?php
echo TbHtml::linkButton(UserModule::t('Cancel'), array('color' => TbHtml::BUTTON_COLOR_DANGER, 'url' => Yii::app()->request->getUrlReferrer()));
?>
示例3: array
<?php
$this->widget('bootstrap.widgets.TbAlert');
?>
<?php
$this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'attributes' => array('id', 'product_name', 'product_quantity', 'product_colour', 'specification', 'comment', 'payment_code', 'firstname', 'lastname', 'email', 'telephone', array('name' => 'total', 'type' => 'raw', 'value' => UtilityHelper::formatPrice($model->total)), array('name' => 'order_status_id', 'type' => 'raw', 'value' => !empty($model->orderStatus) ? TbHtml::encode($model->orderStatus->getName()) : null), 'address_1', 'address_2', 'city', 'postal_code', array('name' => 'zone', 'label' => 'State', 'type' => 'raw', 'value' => $model->zone !== null ? TbHtml::encode($model->zone->name) : null), array('name' => 'country', 'type' => 'raw', 'value' => $model->country !== null ? TbHtml::encode($model->country->name) : null), 'ip', 'forwarded_ip', 'user_agent', 'date_added', 'date_modified')));
?>
<div class="hlinks hide">
<div class="uid"><?php
echo $model->id;
?>
</div>
</div>
示例4: encodeEx
/**
* Encodes special characters into HTML entities.
* #MethodTracker
* This method improves {@link CHtml::encode}, from version 1.1.7 (r3135). Changes:
* <ul>
* <li>This method supports encoding strings in arrays and selective encoding of keys and/or values.</li>
* </ul>
* @see CHtml::encode
* @param string|array $data Data to be encoded.
* @param boolean $encodeKeys Whether to encode array keys.
* @param boolean $encodeValues Whether to encode array values.
* @param boolean $recursive Whether to encode data in nested arrays.
* @return string|array The encoded data.
* @throws InvalidArgumentException If the argument "data" type is not string or array.
*/
public static function encodeEx($data, $encodeKeys = false, $encodeValues = false, $recursive = true)
{
if (is_array($data)) {
$encodedArray = array();
foreach ($data as $key => $value) {
$encodedKey = $encodeKeys && is_string($key) ? parent::encode($key) : $key;
if (is_array($value)) {
if ($recursive) {
$encodedValue = self::encodeEx($value, $encodeKeys, $encodeValues, $recursive);
} else {
$encodedValue = $value;
}
} else {
$encodedValue = $encodeValues && is_string($value) ? parent::encode($value) : $value;
}
$encodedArray[$encodedKey] = $encodedValue;
}
return $encodedArray;
} else {
if (is_string($data)) {
return parent::encode($data);
} else {
throw new InvalidArgumentException(Yii::t('giix.messages', 'The argument "data" must be of type string or array.'));
}
}
}
示例5:
echo CHtml::image($uri,'Produt Image');
}else {
//echo CHtml::image(Yii::app()->baseUrl . '/images/image.png','Product Image');
echo TbHtml::imagePolaroid('holder.js/105x117/acename/text:');
}
*
*/
?>
<!--<img alt="120x100" src=<?php
//echo Yii::app()->baseUrl . '/images/image.png';
?>
width="120px" height="100px" />-->
<div class="tags">
<span class="label-holder">
<span class="label label-info"><?php
echo TbHtml::encode($product->name);
?>
</span>
</span>
<span class="label-holder">
<span class="label label-success arrowed-in"><?php
echo number_format($product->unit_price, Yii::app()->shoppingCart->getDecimalPlace());
?>
</span>
</span>
</div>
</a>
</li>
<?php
}
?>
示例6:
<th class="label"><?php
echo TbHtml::encode($model->getAttributeLabel('create_at'));
?>
</th>
<td><?php
echo $model->create_at;
?>
</td>
</tr>
<tr>
<th class="label"><?php
echo TbHtml::encode($model->getAttributeLabel('lastvisit_at'));
?>
</th>
<td><?php
echo $model->lastvisit_at;
?>
</td>
</tr>
<tr>
<th class="label"><?php
echo TbHtml::encode($model->getAttributeLabel('status'));
?>
</th>
<td><?php
echo TbHtml::encode(User::itemAlias("UserStatus", $model->status));
?>
</td>
</tr>
</table>
示例7: function
<!--
<tr>
<td colspan="3" style='text-align:right'><?php
//echo Yii::t('app','Change Due in KHR');
?>
</td>
<td colspan="1" style='text-align:right'><?php
//echo Yii::app()->settings->get('site', 'altcurrencySymbol') . number_format($amount_change_khr_round,0, '.' , ',');
?>
</td>
</tr>
-->
</tbody>
</table>
<div id="sale_return_policy"> <?php
echo TbHtml::encode(Yii::t('app', Yii::app()->settings->get('site', 'returnPolicy')));
?>
</div>
</div>
</div>
<script>
$(window).bind("load", function() {
setTimeout(window.location.href='index',5000);
window.print();
return true;
});
</script>
示例8: array
<?php
$this->widget('bootstrap.widgets.TbAlert');
?>
<?php
$this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'attributes' => array('id', 'product_name', 'product_quantity', 'product_colour', 'specification', 'comment', 'firstname', 'lastname', 'email', 'telephone', 'address_1', 'address_2', 'city', 'postal_code', array('name' => 'zone', 'label' => 'State', 'type' => 'raw', 'value' => $model->zone !== null ? TbHtml::encode($model->zone->name) : null), array('name' => 'country', 'type' => 'raw', 'value' => $model->country !== null ? TbHtml::encode($model->country->name) : null))));
示例9: array
<?php
$this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'attributes' => array('id', 'firstname', 'lastname', 'company', 'tax_id', 'address_1', 'address_2', 'city', 'postal_code', array('name' => 'country', 'type' => 'raw', 'value' => $model->country !== null ? TbHtml::encode($model->country->name) : null), array('name' => 'zone', 'type' => 'raw', 'value' => $model->zone !== null ? TbHtml::encode($model->zone->name) : null))));
示例10: foreach
echo TbHtml::encode(number_format($total, Yii::app()->shoppingCart->getDecimalPlace(), '.', ','));
?>
<br>
<?php
foreach ($payments as $payment_id => $payment) {
?>
<?php
echo TbHtml::encode(number_format($payment['payment_amount'], Yii::app()->shoppingCart->getDecimalPlace(), '.', ','));
?>
<br>
<?php
}
?>
<?php
echo TbHtml::encode(number_format($amount_change, Yii::app()->shoppingCart->getDecimalPlace(), '.', ','));
?>
<br>
<p>
</div>
</div>
</div>
<script>
function printpage()
{
setTimeout(window.location.href='index',500);
window.print();
return true;
示例11: array
<?php
$this->widget('ext.modaldlg.EModalDlg');
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'client_selected_form', 'layout' => TbHtml::FORM_LAYOUT_HORIZONTAL, 'action' => Yii::app()->createUrl('saleItem/removeCustomer/')));
?>
<div class="clear">
<ul class="list-unstyled">
<li>
<strong>
<?php
echo TbHtml::link(ucwords($cust_fullname), $this->createUrl('Client/View/', array('id' => $customer_id)), array('class' => 'update-dialog-open-link', 'data-update-dialog-title' => Yii::t('app', 'Customer Information')));
?>
</strong>
<?php
echo TbHtml::encode(' ( Balance ' . number_format($acc_balance, Yii::app()->shoppingCart->getDecimalPlace()) . ' )');
?>
</li>
</ul>
</div>
<?php
echo TbHtml::linkButton(Yii::t('app', 'Edit'), array('color' => TbHtml::BUTTON_COLOR_SUCCESS, 'size' => TbHtml::BUTTON_SIZE_MINI, 'icon' => 'glyphicon-edit white', 'class' => 'btn btn-sm edit-customer', 'url' => Yii::app()->createUrl("client/Update/", array("id" => $customer_id, 'sale_mode' => 'Y'))));
?>
<?php
echo TbHtml::linkButton(Yii::t('app', 'Remove'), array('color' => TbHtml::BUTTON_COLOR_WARNING, 'size' => TbHtml::BUTTON_SIZE_MINI, 'icon' => 'glyphicon-remove white', 'class' => 'btn btn-sm detach-customer'));
?>
<?php
if (PriceTier::model()->checkExists() != 0) {
示例12:
<b><?php
echo TbHtml::encode($data->getAttributeLabel('field_size_min'));
?>
:</b>
<?php
echo TbHtml::encode($data->field_size_min);
?>
<br />
<b><?php
echo TbHtml::encode($data->getAttributeLabel('required'));
?>
:</b>
<?php
echo TbHtml::encode($data->required);
?>
<br />
<?php
/*
<b><?php echo TbHtml::encode($data->getAttributeLabel('match')); ?>:</b>
<?php echo TbHtml::encode($data->match); ?>
<br />
<b><?php echo TbHtml::encode($data->getAttributeLabel('range')); ?>:</b>
<?php echo TbHtml::encode($data->range); ?>
<br />
<b><?php echo TbHtml::encode($data->getAttributeLabel('error_message')); ?>:</b>
<?php echo TbHtml::encode($data->error_message); ?>
<br />
<b><?php echo TbHtml::encode($data->getAttributeLabel('other_validator')); ?>:</b>
示例13: printpage
echo TbHtml::encode(number_format($item['price'], Yii::app()->shoppingCart->getDecimalPlace()));
?>
</td>
<td class="center"><?php
echo TbHtml::encode($item['quantity']);
?>
</td>
<td class="<?php
echo Yii::app()->settings->get('sale', 'discount');
?>
"><?php
echo TbHtml::encode($item['discount']);
?>
</td>
<td class="text-right"><?php
echo TbHtml::encode($total_item);
?>
</tr>
<?php
}
?>
<!--/endforeach-->
</tbody>
</table>
</div>
<script>
function printpage()
{
setTimeout(window.location.href='index',500);