本文整理汇总了PHP中Shop::t方法的典型用法代码示例。如果您正苦于以下问题:PHP Shop::t方法的具体用法?PHP Shop::t怎么用?PHP Shop::t使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shop
的用法示例。
在下文中一共展示了Shop::t方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionCreate
public function actionCreate()
{
if (!is_numeric($_POST['amount']) || $_POST['amount'] <= 0) {
Shop::setFlash(Shop::t('Illegal amount given'));
$this->redirect(array('//shop/products/view', 'id' => $_POST['product_id']));
}
if (isset($_POST['Variations'])) {
foreach ($_POST['Variations'] as $key => $variation) {
$specification = ProductSpecification::model()->findByPk($key);
if ($specification->required && $variation[0] == '') {
Shop::setFlash(Shop::t('Please select a {specification}', array('{specification}' => $specification->title)));
$this->redirect(array('//shop/products/view', 'id' => $_POST['product_id']));
}
}
}
$cart = Shop::getCartContent();
// remove potential clutter
if (isset($_POST['yt0'])) {
unset($_POST['yt0']);
}
if (isset($_POST['yt1'])) {
unset($_POST['yt1']);
}
$cart[] = $_POST;
Shop::setCartcontent($cart);
Shop::setFlash(Shop::t('The product has been added to the shopping cart'));
$this->redirect(array('//shop/products/index'));
}
示例2: getSpecifications
function getSpecifications($position)
{
$string = '<table class="specifications">';
foreach ($position->getSpecifications() as $key => $specification) {
if ($model = ProductSpecification::model()->findByPk($key)) {
if ($model->input_type == 'textfield') {
$title = $model->title;
$value = $specification[0];
} else {
$title = $model->title;
$productvariation = ProductVariation::model()->findByPk($specification[0]);
if ($productvariation) {
$value = $productvariation->title;
} else {
$value = '';
}
}
} else {
if ($key == 'image') {
$title = Shop::t('Filename');
$value = $specification;
}
}
$string .= sprintf('<tr><td>%s</td><td>%s</td></tr>', @$title, @$value);
}
$string .= '</table>';
return $string;
}
示例3: init
public function init()
{
if ($this->products === null) {
throw new CException(Shop::t('Please provide a product that can be bought with the ImageUploadWidget'));
}
return parent::init();
}
示例4: actionCreate
public function actionCreate()
{
// if some data has been entered before or the user is already logged in,
// take the already existing data and prefill the input form
if ($model = Shop::getCustomer()) {
$address = $model->address;
} else {
$model = new Customer();
}
if (isset($_POST['Customer'])) {
$model->attributes = $_POST['Customer'];
if (isset($_POST['Address'])) {
$address = new Address();
$address->attributes = $_POST['Address'];
if ($address->save()) {
$model->address_id = $address->id;
}
}
if (!Yii::app()->user->isGuest) {
$model->user_id = Yii::app()->user->id;
}
$model->validate();
if (Shop::module()->useWithYum && isset($_POST['register']) && ($_POST['register'] = true)) {
if (isset($_POST['Customer']['password']) && isset($_POST['Customer']['passwordRepeat'])) {
if ($_POST['Customer']['password'] != $_POST['Customer']['passwordRepeat']) {
$model->addError('password', Shop::t('Passwords do not match'));
} else {
if ($_POST['Customer']['password'] == '') {
$model->addError('password', Shop::t('Password is empty'));
} else {
$user = new YumUser();
$profile = new YumProfile();
$profile->attributes = $_POST['Customer'];
$profile->attributes = $_POST['Address'];
if ($user->register(strtr($model->email, array('@' => '_', '.' => '_')), $_POST['Customer']['password'], $profile)) {
$user->status = YumUser::STATUS_ACTIVE;
$user->save(false, array('status'));
$model->user_id = $user->id;
Shop::setFlash(Shop::t('Successfully registered user'));
} else {
$model->addErrors($user->getErrors());
$model->addErrors($profile->getErrors());
Shop::setFlash(Shop::t('Error while registering user'));
}
}
}
}
}
if (!$model->hasErrors()) {
if ($model->save()) {
Yii::app()->user->setState('customer_id', $model->customer_id);
$this->redirect(array('//shop/order/create', 'customer' => $model->customer_id));
}
}
}
$this->render('create', array('customer' => $model, 'address' => isset($address) ? $address : new Address()));
}
示例5: actionInstall
public function actionInstall()
{
if ($this->module->debug) {
if (Yii::app()->request->isPostRequest) {
if ($db = Yii::app()->db) {
} else {
throw new CException(Yii::t('shop', 'Database Connection is not working'));
}
} else {
$this->render('install');
}
} else {
throw new CException(Shop::t('Webshop is not in Debug Mode'));
}
}
示例6:
</tr>
<?php
}
?>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td nowrap> <table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td nowrap width="100%" style="border-right: 2px solid; border-bottom: 2px solid; border-color: #ffffff;"><div align="right"><font size="1" face="Arial, Helvetica, sans-serif"><?php
echo Shop::t('Total value');
?>
<?php
echo Shop::priceFormat($model->getTotalPrice());
?>
</font></div></td>
</tr>
</table></td>
</tr>
</table>
<br />
<br />
<br />
<?php
$this->renderPartial(Shop::module()->footerView);
示例7: array
$this->renderPartial('position', array('position' => $position));
}
}
die("jo");
?>
<div style="clear:both;"> </div>
<ul class="buttons">
<li> <?php
echo CHtml::link(Shop::t('Update order status'), array('//shop/order/update', 'id' => $model->order_id));
?>
</li>
<li> <?php
echo CHtml::link(Shop::t('Delivery slip'), array('//shop/order/slip', 'id' => $model->order_id));
?>
</li>
<li> <?php
echo CHtml::link(Shop::t('Invoice'), array('//shop/order/invoice', 'id' => $model->order_id));
?>
</li>
<li> <?php
echo CHtml::link(Shop::t('Back to Orders'), array('//shop/order/admin'));
?>
</li>
</ul>
示例8: array
echo ' <span class="required">*</span>';
}
echo '<br />';
if ($variation[0]->specification->input_type == 'textfield') {
echo CHtml::textField($field);
} else {
if ($variation[0]->specification->input_type == 'select') {
// If the specification is required, preselect the first field. Otherwise
// let the customer choose which one to pick
echo CHtml::radioButtonList($field, $variation[0]->specification->required ? $variation[0]->id : null, ProductVariation::listData($variation));
} else {
if ($variation[0]->specification->input_type == 'image') {
echo CHtml::fileField($field);
}
}
}
echo '</div>';
if ($i % 2 == 0) {
echo '<div style="clear: both;"></div>';
}
}
}
echo '<div style="clear: both;"></div>';
echo '<br />';
echo CHtml::hiddenField('product_id', $model->product_id);
echo CHtml::label(Shop::t('Amount'), 'ShoppingCart_amount');
echo ': ';
echo CHtml::textField('amount', 1, array('size' => 3));
echo '<br />';
echo CHtml::submitButton(Shop::t('Add to shopping Cart'), array('class' => 'btn-add-cart'));
echo CHtml::endForm();
示例9: array
<?php
$this->breadcrumbs = array(Shop::t('Payment Methods') => array('index'), $model->title => array('view', 'id' => $model->id), Shop::t('Update'));
$this->menu = array(array('label' => 'Create PaymentMethod', 'url' => array('create')), array('label' => 'View PaymentMethod', 'url' => array('view', 'id' => $model->id)), array('label' => 'Manage PaymentMethod', 'url' => array('admin')));
?>
<h2><?php
echo $model->title;
?>
</h2>
<?php
echo $this->renderPartial('_form', array('model' => $model));
示例10: init
public function init()
{
$this->title = Shop::t('Product Categories');
return parent::init();
}
示例11: array
<?php
$this->breadcrumbs = array(Shop::t('Products') => array('index'), $model->title => array('view', 'id' => $model->product_id), Shop::t('Update'));
?>
<h2> <?php
echo $model->title;
?>
</h2>
<?php
echo $this->renderPartial('_form', array('model' => $model));
?>
示例12: array
$this->breadcrumbs = array(Shop::t('Product Specifications') => array('admin'), $model->title);
$this->menu = array(array('label' => Shop::t('Create Product specification'), 'url' => array('create')), array('label' => Shop::t('Update Product specification'), 'url' => array('update', 'id' => $model->id)), array('label' => Shop::t('Delete Product specification'), 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => Shop::t('Are you sure you want to delete this product specification?'))), array('label' => Shop::t('Manage Product specifications'), 'url' => array('admin')));
?>
<h2> <?php
echo Shop::t('Product specification');
?>
<?php
echo $model->title;
?>
</h2>
<?php
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('id', 'title', 'input_type', 'required')));
?>
<h2> <?php
echo Shop::t('Variations of this specification');
?>
</h2>
<?php
if ($model->variations) {
echo '<ul>';
foreach ($model->variations as $variation) {
printf('<li>%s: %s</li>', CHtml::link($variation->product->title, array('//shop/products/view', 'id' => $variation->product_id)), $variation->title);
}
echo '</ul>';
} else {
echo Shop::t('This specification is not used in any product variation yet');
}
示例13: attributeLabels
public function attributeLabels()
{
return array('order_id' => Shop::t('Order number'), 'customer_id' => Shop::t('Customer number'), 'ordering_date' => Shop::t('Ordering Date'), 'ordering_done' => Shop::t('Ordering Done'), 'ordering_confirmed' => Shop::t('Ordering Confirmed'));
}
示例14: attributeLabels
/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
return array('id' => 'ID', 'firstname' => Yii::t('ShopModule.shop', 'Firstname'), 'lastname' => Yii::t('ShopModule.shop', 'Lastname'), 'street' => Shop::t('Street'), 'zipcode' => Shop::t('Zipcode'), 'city' => Shop::t('City'), 'country' => Shop::t('Country'));
}
示例15: array
<?php
$points = array(Shop::t('Customer information'), Shop::t('Shipping'), Shop::t('Payment'), Shop::t('Confirm'), Shop::t('Success'));
$links = array(array('//shop/customer/create'), array('//shop/shippingMethod/choose'), array('//shop/paymentMethod/choose'), array('//shop/order/create'));
echo '<div id="waypointarea" class="waypointarea">';
printf('<span class="waypoint %s">%s</span>', $point == 0 ? 'active' : '', CHtml::link(Shop::t('Shopping Cart'), array('//shop/shoppingCart/view')));
foreach ($points as $p => $pointText) {
printf('<span class="waypoint%s">%s</span>', $point == ++$p ? ' active' : '', $point < ++$p ? $pointText : CHtml::link($pointText, @$links[$p - 2]));
}
echo '</div>';