当前位置: 首页>>代码示例>>PHP>>正文


PHP F::t方法代码示例

本文整理汇总了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;
         }
     }
 }
开发者ID:jackycgq,项目名称:advanced,代码行数:38,代码来源:LoginForm.php

示例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);
 }
开发者ID:rainsongsky,项目名称:yincart,代码行数:8,代码来源:MenuController.php

示例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);
 }
开发者ID:rainsongsky,项目名称:yincart,代码行数:9,代码来源:CustomerServiceController.php

示例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);
 }
开发者ID:yinhe,项目名称:yincart,代码行数:9,代码来源:ItemPropController.php

示例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 .= '&nbsp;&nbsp;&nbsp;&nbsp;';
     }
     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;
 }
开发者ID:zhaoyan158567,项目名称:galaxy,代码行数:32,代码来源:TreeHelper.php

示例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) {
        ?>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;管理员回复:
                    <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>
开发者ID:yinhe,项目名称:yincart,代码行数:31,代码来源:index.php

示例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));
开发者ID:jackycgq,项目名称:advanced,代码行数:26,代码来源:mainMenu.php

示例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'))));
}
开发者ID:rainsongsky,项目名称:yincart,代码行数:31,代码来源:_form.php

示例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');
?>
开发者ID:yinhe,项目名称:yincart,代码行数:31,代码来源:view.php

示例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>
开发者ID:yinhe,项目名称:yincart,代码行数:31,代码来源:catalog.php

示例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>    
开发者ID:zwq,项目名称:unpei,代码行数:31,代码来源:sidebarHelpCenter.php

示例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');
 }
开发者ID:rainsongsky,项目名称:yincart,代码行数:7,代码来源:Comment.php

示例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 
}
开发者ID:jackycgq,项目名称:advanced,代码行数:31,代码来源:mainMenu.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;
 }
开发者ID:yinhe,项目名称:yincart,代码行数:9,代码来源:Menu.php

示例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>
开发者ID:zwq,项目名称:unpei,代码行数:31,代码来源:sidebarMenu.php


注:本文中的F::t方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。