本文整理汇总了PHP中F::t方法的典型用法代码示例。如果您正苦于以下问题:PHP F::t方法的具体用法?PHP F::t怎么用?PHP F::t使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类F
的用法示例。
在下文中一共展示了F::t方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: authenticate
/**
* Authenticates the password.
* This is the 'authenticate' validator as declared in rules().
*/
public function authenticate($attribute, $params)
{
if (!$this->hasErrors()) {
$identity = new UserIdentity($this->username, $this->password);
$identity->authenticate();
switch ($identity->errorCode) {
case UserIdentity::ERROR_NONE:
$duration = $this->rememberMe ? 2592000 : 0;
Yii::app()->user->login($identity, $duration);
break;
case UserIdentity::ERROR_EMAIL_INVALID:
$this->addError("username", F::t("Email is incorrect."));
break;
case UserIdentity::ERROR_USERNAME_INVALID:
$this->addError("username", F::t("Username is incorrect."));
break;
case UserIdentity::ERROR_STATUS_NOTACTIV:
$this->addError("status", F::t("You account is not activated."));
break;
case UserIdentity::ERROR_STATUS_BAN:
$this->addError("status", F::t("You account is blocked."));
break;
case UserIdentity::ERROR_PASSWORD_INVALID:
$this->addError("password", F::t("Password is incorrect."));
break;
case UserIdentity::ERROR_STATUS_NOTADMIN:
$this->addError("status", F::t("You account is not administrator."));
break;
case UserIdentity::ERROR_STATUS_NOTOWNER:
$this->addError("status", F::t("You account is not this store owner."));
break;
}
}
}
示例2: init
function init()
{
parent::init();
$data = Menu::model()->findAll(array('order' => 'sort_order asc, menu_id asc'));
$parent = CHtml::tag('option', array('value' => 0), F::t('Please Select'));
$model = new Menu();
$this->parent = $parent . F::toTree($data, $model->menu_id, 'menu_id', 'parent_id', 'name', 1);
}
示例3: init
function init()
{
parent::init();
//上一级 可支持无限级 分类
//上一级 可支持无限级 分类
$data = ContentCategory::model()->findAll(array('order' => 'sort_order asc, category_id asc'));
$parent = CHtml::tag('option', array('value' => 0), F::t('Please Select'));
$this->parent = $parent . F::toTree($data, $model->cate_id, 'category_id', 'parent_id', 'name', 1);
}
示例4: init
function init()
{
parent::init();
//上一级 可支持无限级 分类
//上一级 可支持无限级 分类
$data = ItemProp::model()->findAll(array('order' => 'sort_order asc, prop_id asc'));
$parent = CHtml::tag('option', array('value' => 0), F::t('Please Select'));
$this->parent = $parent . F::toTree($data, $model->prop_id, 'prop_id', 'parent_prop_id', 'prop_name', 1);
}
示例5: toTreeHelper
/**
* 辅助生成树
* @param $arr
* @param $selected
* @param $value
* @param $pid
* @param $id
* @param $name
* @param $span
* @return string
*/
public static function toTreeHelper($arr, $selected, $value, $pid, $id, $name, $span)
{
static $string;
static $str;
$array = array();
for ($i = 0; $i < $span; $i++) {
$string .= ' ';
}
foreach ($arr as $rs) {
if ($value == $rs->{$pid}) {
if ($selected == $rs->{$id}) {
$select = "selected='selected'";
}
$str .= "<option value='" . $rs->{$id} . "' {$select}>" . $string . F::t($rs->{$name}) . "</option>";
if (self::toTreeHelper($arr, $selected, $rs->{$id}, $pid, $id, $name, $span)) {
$str .= self::toTreeHelper($arr, $selected, $rs->{$id}, $pid, $id, $name, $span + 1);
}
}
}
return $str;
}
示例6: array
echo F::date($f->create_time);
?>
):
<?php
echo CHtml::link($f->content, array('/feedback/view', 'id' => $f->id));
?>
<p><?php
if ($f->reply) {
?>
管理员回复:
<span style="color:#cd0a0a"><?php
echo $f->reply;
?>
</span><?php
}
?>
</p></li>
</ul>
<?php
}
?>
<h4><?php
echo F::t('Create Feedback');
?>
</h4>
<ul>
<?php
echo $this->renderPartial('_form', array('model' => $model));
?>
</ul>
</div>
示例7: foreach
<?php
$menu = Menu::model()->findByPk(4);
$descendants = $menu->children()->findAll();
/*
* 单级菜单
*/
//foreach($descendants as $model){
//$items[] = array('label'=>strtoupper($model->name), 'url'=>$model->url ? Yii::app()->request->baseUrl.'/'.$model->url : '#');
//$items[] = array('label'=>'', 'url'=>'', 'itemOptions'=>array('class'=>'line7'));
//}
//$this->widget('zii.widgets.CMenu', array(
// 'items'=>$items
//));
/*
* 多级菜单
*/
foreach ($descendants as $model) {
if ($model->getChildCount() > 0) {
$items[] = array('label' => F::t($model->name), 'url' => $model->url ? Yii::app()->request->baseUrl . '/' . $model->url : '#', 'items' => $model->getChildMenu(), 'itemOptions' => array('class' => 'dropdown'), 'submenuOptions' => array('class' => 'dropdown'));
} else {
$items[] = array('label' => F::t($model->name), 'url' => $model->url ? Yii::app()->request->baseUrl . '/' . $model->url : '#');
}
}
//print_r($items);
$this->widget('zii.widgets.CMenu', array('htmlOptions' => array('class' => 'horizontal unstyled clearfix'), 'items' => $items));
示例8: array
if (!Yii::app()->user->isGuest) {
?>
<div class="form">
<?php
$form = $this->beginWidget('CActiveForm', array('id' => 'comment-form', 'enableAjaxValidation' => true));
?>
<div class="row">
<?php
echo $form->labelEx($model, 'content');
?>
<?php
//echo $form->textArea($model,'content',array('rows'=>6, 'cols'=>50));
$this->widget('ext.jmarkitup.JHtmlEditor', array('model' => $model, 'attribute' => 'content', 'theme' => 'simple', 'htmlOptions' => array('rows' => 15, 'cols' => 50, 'style' => 'width:420px'), 'options' => array()));
?>
<?php
echo $form->error($model, 'content');
?>
</div>
<div class="row buttons">
<?php
echo CHtml::submitButton($model->isNewRecord ? 'Submit' : 'Save');
?>
</div>
<?php
$this->endWidget();
?>
</div><!-- form -->
<?php
} else {
echo F::t("Please {login} to leave your comment", 'Default', array('{login}' => CHtml::link(F::t('login'), array('/user/login/ajaxLogin'), array('class' => 'login'))));
}
示例9:
// canonical URLs should always be absolute
?>
<script type="text/javascript">
$(function() {
$(".add-comment").click(function(event) {
$('#yw1').submit();
});
});
</script>
<div class="page-title">
<h1><?php
echo F::t($model->title);
?>
</h1>
</div>
<div class="std">
<p><?php
echo F::t('Post time:');
?>
<?php
echo F::date($model->create_time);
?>
</p>
<p>
<?php
echo $model->content;
?>
</p>
<p align="center"><a href="javascript:history.go(-1);"><?php
echo F::t('Back');
?>
示例10: array
<?php
$this->beginContent('//layouts/main');
?>
<div class="main-container col2-left-layout" style="">
<div class="main container show-bg" style="">
<?php
if (isset($this->breadcrumbs)) {
?>
<?php
$this->widget('zii.widgets.CBreadcrumbs', array('links' => $this->breadcrumbs, 'htmlOptions' => array('class' => 'grid-full breadcrumbs'), 'separator' => NULL, 'tagName' => 'div', 'activeLinkTemplate' => '<li><a href="{url}">{label}</a><span>/ </span></li>', 'inactiveLinkTemplate' => '<li class="category"><strong>{label}</strong></li></ul>', 'homeLink' => '<ul><li class="home"><a href="' . Yii::app()->homeUrl . '">' . F::t('Home') . '</a><span>/ </span></li>'));
?>
<!-- breadcrumbs -->
<?php
}
?>
<div class="preface grid-full in-col1"></div>
<div class="col-main grid12-9 grid-col2-main in-col2">
<?php
echo $content;
?>
</div>
<div class="col-left sidebar grid12-3 grid-col2-sidebar in-sidebar" style="">
<div class="block block-vertnav " style="">
<?php
$this->widget('widgets.ultimo.WCategory');
?>
</div>
<div class="block block-layered-nav">
<div class="block-title">
<strong><span>Shop By</span></strong>
示例11: CDbCriteria
$cri = new CDbCriteria(array('condition' => 'category_id = ' . $h->id));
$helpChilds = Page::model()->findAll($cri);
foreach ($helpChilds as $hc) {
?>
<?php
$activeclass = "";
if (!empty($hc->key) && stripos($cur_url, $hc->key) !== false) {
$activeclass = "active";
}
?>
<li class='f14 <?php
echo $activeclass;
?>
'>
<?php
echo CHtml::link(F::t($hc->title), array('/page/index', 'key' => $hc->key));
?>
</li>
<?php
}
?>
</ul>
</li>
<li class='divers'>
<p></p>
</li>
<?php
}
?>
</ul>
示例12: attributeLabels
/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
return array('id' => 'Id', 'content' => F::t('Comment'), 'status' => 'Status', 'create_time' => 'Create Time', 'author' => 'Name', 'email' => 'Email', 'url' => 'Website', 'target_id' => 'Target');
}
示例13: foreach
//}
//$this->widget('zii.widgets.CMenu', array(
// 'items'=>$items
//));
/*
* 多级菜单
*/
//foreach ($descendants as $model) {
//
// if ($model->getChildCount() > 0) {
// $items[] = array('label' => F::t($model->name), 'url' => $model->url ? Yii::app()->request->baseUrl . '/' . $model->url : '#',
// 'items' => $model->getChildMenu(),
// 'itemOptions' => array('class' => 'dropdown'), 'submenuOptions' => array('class' => 'dropdown'));
// } else {
// $items[] = array('label' => F::t($model->name), 'url' => $model->url ? Yii::app()->request->baseUrl . '/' . $model->url : '#');
// }
//}
////print_r($items);
//$this->widget('zii.widgets.CMenu', array(
// 'htmlOptions' => array('class' => 'nav'),
// 'items' => $items
//));
foreach ($descendants as $d) {
?>
<div class="btn btn-large background-color-hover-1">
<?php
echo CHtml::link(F::t($d->name), $d->url ? Yii::app()->request->baseUrl . '/' . $d->url : '#');
?>
</div>
<?php
}
示例14: getChildMenu
public function getChildMenu()
{
$menu = Menu::model()->findByPk($this->id);
$descendants = $menu->children()->findAll();
foreach ($descendants as $model) {
$items[] = array('label' => F::t($model->name), 'url' => $model->url ? Yii::app()->request->baseUrl . '/' . $model->url : '#');
}
return $items;
}
示例15: foreach
<h2 class='title title-green'>
<!-- 当前栏目样式 bg-green -->
<a href="#">
<?php
echo F::t($this->getMenuTitle());
?>
</a>
</h2>
<ul class='submenu'>
<?php
$cur_url = Yii::app()->request->getUrl();
$descendants = $this->getMenu();
foreach ($descendants as $model) {
$activeclass = "";
$htmlOptions = array();
if (!empty($model->url) && stripos(strtolower($cur_url), strtolower($model->url)) != false) {
$htmlOptions = array('class' => 'active');
$activeclass = "active";
}
echo "<li class='f14 " . $activeclass . "'>";
echo CHtml::link(F::t($model->name), $model->url ? Yii::app()->request->baseUrl . '/' . $model->url : '#', $htmlOptions);
echo '</li>';
}
?>
</ul>
</li>
<li class='divers'>
<p></p>
</li>
</ul>