本文整理汇总了PHP中Module::t方法的典型用法代码示例。如果您正苦于以下问题:PHP Module::t方法的具体用法?PHP Module::t怎么用?PHP Module::t使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Module
的用法示例。
在下文中一共展示了Module::t方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run($id)
{
$model = $this->findModel($id);
if ($this->checkAccess) {
call_user_func($this->checkAccess, $this->id, $model);
}
$model->scenario = $this->scenario;
/* @var $modelClass ActiveRecordInterface */
$modelClass = $this->modelClass;
$statusArray = $modelClass::statusLabels();
if ($model->load(Yii::$app->request->post())) {
if ($model->validate()) {
if ($model->save(false)) {
return $this->refresh();
} else {
Yii::$app->session->setFlash('danger', Module::t('admin', 'BACKEND_FLASH_FAIL_ADMIN_UPDATE'));
return $this->refresh();
}
} elseif (Yii::$app->request->isAjax) {
Yii::$app->response->format = Response::FORMAT_JSON;
return ActiveForm::validate($model);
}
}
return $this->render('update', ['model' => $model, 'statusArray' => $statusArray]);
}
示例2: actionUpdate
/**
* Update comment page.
*
* @param integer $id Comment ID
*
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
$model->setScenario('admin-update');
$statusArray = Comment::getStatusArray();
if ($model->load(Yii::$app->request->post())) {
if ($model->validate()) {
if ($model->save(false)) {
return $this->refresh();
} else {
Yii::$app->session->setFlash('danger', Module::t('comments', 'BACKEND_FLASH_FAIL_ADMIN_UPDATE'));
return $this->refresh();
}
} elseif (Yii::$app->request->isAjax) {
Yii::$app->response->format = Response::FORMAT_JSON;
return ActiveForm::validate($model);
}
}
return $this->render('update', ['model' => $model, 'statusArray' => $statusArray]);
}
示例3:
<?php
use yii\helpers\Html;
use simplator\medialib\FilemanagerAsset;
/* @var $this yii\web\View */
/* @var $model simplator\medialib\models\Picture */
$fm = FilemanagerAsset::register($this);
$this->params['breadcrumbs'][] = ['label' => Module::t('app', 'Medialib'), 'url' => ['index']];
echo Html::a(Module::t('app', 'Pictures'), ['/medialib/picture'], ['class' => 'btn btn-primary']);
?>
<div class="medialib-default-index">
<h1><?php
echo $this->context->action->uniqueId;
?>
</h1>
<div><iframe width="100%" height="500px" src="<?php
echo $fm->baseUrl;
?>
/index.html"></iframe></div>
</div>
示例4:
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model simplator\medialib\models\Config */
$this->title = Module::t('app', 'Create {modelClass}', ['modelClass' => 'Config']);
$this->params['breadcrumbs'][] = ['label' => Module::t('app', 'Configs'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="config-create">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
echo $this->render('_form', ['model' => $model]);
?>
</div>
示例5:
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'model')->dropDownList(['picture' => 'Picture', 'video' => 'Video'], ['prompt' => '']);
?>
<?php
echo $form->field($model, 'item')->textInput(['maxlength' => 25]);
?>
<?php
echo $form->field($model, 'variant')->textInput(['maxlength' => 25]);
?>
<?php
echo $form->field($model, 'value')->textInput();
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? Module::t('app', 'Create') : Module::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
示例6: function
*/
use yii\helpers\Html;
use kartik\grid\GridView;
use yii\widgets\Pjax;
/** @var IdentityInterface|ActiveRecord $identity */
$identity = Yii::$app->getUser()->identityClass;
$this->title = Module::t('Requests');
echo Breadcrumbs::widget(['links' => [$this->title]]);
?>
<div class="request-log-default-index">
<h3><?php
echo Html::encode($this->title);
?>
</h3>
<?php
Pjax::begin();
echo GridView::widget(['filterModel' => $searchModel, 'dataProvider' => $dataProvider, 'columns' => [['attribute' => 'id', 'value' => function ($model, $index, $dataColumn) {
/** @var RequestLog $model */
return $model->id;
}, 'filter' => false], 'app_id', 'route', 'params', ['attribute' => 'user_id', 'value' => function ($model, $index, $dataColumn) {
return $model->user ? $model->user->{Module::getInstance()->usernameAttribute} : Module::t('Guest');
}, 'filter' => ArrayHelper::map($identity::find()->all(), 'id', Module::getInstance()->usernameAttribute)], 'ip', ['attribute' => 'datetime', 'value' => function ($model, $index, $dataColumn) {
return $model->datetime;
}, 'filter' => false], ['attribute' => 'user_agent', 'value' => function ($model, $index, $dataColumn) {
return $model->user_agent;
}, 'filter' => false]]]);
Pjax::end();
?>
</div>
示例7: attributeLabels
/**
* @inheritdoc
*/
public function attributeLabels()
{
return ['id' => Module::t('app', 'ID'), 'folder' => Module::t('app', 'Folder'), 'name' => Module::t('app', 'Name'), 'filetype' => Module::t('app', 'Filetype'), 'sizex' => Module::t('app', 'Sizex'), 'sizey' => Module::t('app', 'Sizey'), 'createtime' => Module::t('app', 'Createtime'), 'updatetime' => Module::t('app', 'Updatetime'), 'comment' => Module::t('app', 'Comment')];
}
示例8: adminMenu
public function adminMenu($route, $module)
{
return [['label' => isset($module['title']) ? $module['title'] : Module::t('articles', 'Articles'), 'url' => ['/' . $route], 'items' => [['label' => Module::t('articles', 'Summary'), 'url' => ['/' . $route . '/summary']], ['label' => Module::t('articles', 'Categories'), 'url' => ['/' . $route . '/category']], ['label' => Module::t('articles', 'Articles'), 'url' => ['/' . $route . '/article']]]]];
}
示例9: actionCreate2
public function actionCreate2()
{
$model = new \vova07\comments\models\frontend\Comment(['scenario' => 'create']);
Yii::$app->response->format = Response::FORMAT_JSON;
if ($model->load(Yii::$app->request->post())) {
if ($model->validate()) {
if ($model->save(false)) {
return $this->tree($model);
} else {
Yii::$app->response->setStatusCode(500);
return Module::t('comments', 'FRONTEND_FLASH_FAIL_CREATE');
}
} elseif (Yii::$app->request->isAjax) {
Yii::$app->response->setStatusCode(400);
return ActiveForm::validate($model);
}
}
}
示例10:
<ul class="dropdown-menu dropdown-menu-default">
<li>
<a href="<?php
echo Url::toRoute('/admin/user/profile');
?>
">
<i class="icon-user"></i><?php
echo Module::t('user.info');
?>
</a>
</li>
<li>
<a href="<?php
echo Url::toRoute('/admin/default/logout');
?>
">
<i class="icon-key"></i><?php
echo Module::t('user.logout');
?>
</a>
</li>
</ul>
</li>
<!-- END USER LOGIN DROPDOWN -->
</ul>
</div>
<!-- END TOP NAVIGATION MENU -->
</div>
<!-- END HEADER INNER -->
</div>
<!-- END HEADER -->
示例11: attributeLabels
/**
* @inheritdoc
*/
public function attributeLabels()
{
return ['id' => Module::t('labels', 'ID'), 'accountId' => Module::t('labels', 'Account ID'), 'type' => Module::t('labels', 'Type'), 'token' => Module::t('labels', 'Token'), 'createdAt' => Module::t('labels', 'Created At'), 'status' => Module::t('labels', 'Status')];
}
示例12: fatalError
/**
* @param string $message error message.
* @throws HttpException when called.
*/
public function fatalError($message = null)
{
throw new ServerErrorHttpException($message === null ? Module::t('errors', 'Something went wrong.') : $message);
}
示例13:
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Module::t('app', 'Pictures');
$this->params['breadcrumbs'][] = ['label' => Module::t('app', 'MediaLib'), 'url' => ['/medialib']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="picture-index">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a(Module::t('app', 'Create {modelClass}', ['modelClass' => 'Picture']), ['create'], ['class' => 'btn btn-success']);
?>
</p>
<?php
// Ajax uploads with drag and drop feature. Enable AJAX uploads by setting the `uploadUrl` property
// in pluginOptions. You can also pass extra data to your upload URL via `uploadExtraData`. Refer
// [plugin documentation and demos](http://plugins.krajee.com/file-input/demo) for more details
// and options on using AJAX uploads.
echo \kartik\file\FileInput::widget(['name' => 'Picture[file]', 'options' => ['multiple' => true], 'pluginOptions' => ['uploadUrl' => \yii\helpers\Url::to(['/medialib/picture/upload']), 'uploadExtraData' => ['album_id' => 20, 'cat_id' => 'Nature'], 'maxFileCount' => 100]]);
?>
<div class="mlpicture">
<?php
echo ListView::widget(['dataProvider' => $dataProvider, 'itemView' => '_preview']);
?>
</div>
示例14:
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model simplator\medialib\models\Picture */
$this->title = Module::t('app', 'Update {modelClass}: ', ['modelClass' => 'Picture']) . ' ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => Module::t('app', 'Pictures'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Module::t('app', 'Update');
?>
<div class="picture-update">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
echo $this->render('_form', ['model' => $model]);
?>
</div>
示例15:
$this->params['breadcrumbs'][] = ['label' => Module::t('app', 'MediaLib'), 'url' => ['/medialib']];
$this->params['breadcrumbs'][] = ['label' => Module::t('app', 'Pictures'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="picture-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a(Html::img(File::picture($model->id, 'preview')), File::picture($model->id, 'full'), ['class' => 'box']);
?>
</p>
<p>
<?php
echo Html::a(Module::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a(Module::t('app', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Module::t('app', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
</p>
<?php
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'folder', 'name', 'type', 'sizex', 'sizey', 'createtime:datetime', 'updatetime:datetime', 'comment']]);
?>
</div>