本文整理汇总了PHP中pavlinter\adm\Adm::t方法的典型用法代码示例。如果您正苦于以下问题:PHP Adm::t方法的具体用法?PHP Adm::t怎么用?PHP Adm::t使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pavlinter\adm\Adm
的用法示例。
在下文中一共展示了Adm::t方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Initializes the object.
* This method is invoked at the end of the constructor after the object is initialized with the
* given configuration.
*/
public function init()
{
parent::init();
$request = Yii::$app->getRequest();
$headers = $request->getHeaders();
//ajax
if (isset($headers['adm-nestable-ajax'])) {
$this->ajax();
} else {
$view = $this->getView();
if ($this->btn === null || $this->btn === false) {
$this->btn = Html::tag('button', '', ['class' => 'btn btn-primary btn-adm-nestable' . ($this->btn === false ? ' hide' : ''), 'data' => ['is-nestable' => Yii::$app->getRequest()->get('nestable', 0), 'gridview-text' => Adm::t('', 'Search', ['dot' => false]), 'nestable-text' => Adm::t('', 'Sort', ['dot' => false])]]);
}
$pagination = $this->grid->dataProvider->getPagination();
if (($params = $pagination->params) === null) {
$params = $request instanceof Request ? $request->getQueryParams() : [];
}
$params['nestable'] = 1;
$pagination->params = $params;
$models = $this->grid->dataProvider->getModels();
if (!$models) {
$view->registerJs('$(".btn-adm-nestable-view").hide();');
return null;
}
$keys = $this->grid->dataProvider->getKeys();
$this->registerAssets($view);
$output = strtr($this->template, ['{btn}' => $this->renderBtn(), '{nestableId}' => $this->id, '{items}' => $this->renderItems($models, $keys), '{pager}' => $this->renderPager()]);
echo $output;
unset($params['nestable']);
$pagination->params = $params;
}
}
示例2: actionIndex
/**
* @return string
*/
public function actionIndex()
{
$module = Module::getInstance();
/* @var $model \app\modules\admlivechat\models\SettingsForm */
$model = $module->manager->createSettingsForm();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if ($model->save()) {
Yii::$app->getSession()->setFlash('success', Adm::t('', 'Data successfully changed!'));
return Adm::redirect(['index']);
}
}
return $this->render('index', ['model' => $model]);
}
示例3: actionTest
/**
* @return \yii\web\Response
*/
public function actionTest()
{
$error = Module::getInstance()->manager->createEmailConfigQuery('eachEmail', function ($email) {
try {
Yii::$app->mailer->compose()->setTo($email)->setFrom(Yii::$app->params['adminEmailName'])->setSubject(Adm::t('adm_email_config', 'Test subject', ['dot' => false]))->setHtmlBody(Adm::t('adm_email_config', 'Test text', ['dot' => false]))->send();
} catch (\Exception $e) {
if ($e instanceof \Swift_RfcComplianceException) {
Yii::$app->getSession()->setFlash('error', Adm::t('adm_email_config', 'Maybe incorrect email address: {error}', ['error' => $e->getMessage(), 'dot' => true]));
} else {
Yii::$app->getSession()->setFlash('error', Adm::t('adm_email_config', 'Error: {error}', ['error' => $e->getMessage(), 'dot' => true]));
}
return true;
}
});
if ($error) {
Yii::$app->getSession()->removeFlash('success');
} else {
Yii::$app->getSession()->setFlash('success', Adm::t('adm_email_config', 'Email sent!', ['dot' => true]));
}
return Adm::redirect(['update']);
}
示例4:
}
?>
<div class="user-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a(Adm::t('user', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<?php
if (!Adm::getInstance()->user->can('Adm-UpdateOwnUser', $model)) {
?>
<?php
echo Html::a(Adm::t('user', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Adm::t('user', 'Are you sure you want to delete this item?', ['dot' => false]), 'method' => 'post']]);
?>
<?php
}
?>
</p>
<?php
echo Adm::widget('DetailView', ['model' => $model, 'hover' => true, 'mode' => \kartik\detail\DetailView::MODE_VIEW, 'attributes' => ['username', 'email:email', ['attribute' => 'status', 'value' => $model->status_list($model->status)], ['attribute' => 'role', 'label' => Yii::t('modelAdm/user', 'Assignment Role'), 'format' => 'raw', 'value' => $rolesStr], ['attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDate($model->updated_at)], ['attribute' => 'created_at', 'value' => Yii::$app->formatter->asDate($model->created_at)]]]);
?>
</div>
示例5:
<?php
use pavlinter\adm\Adm;
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model pavlinter\adm\models\AuthRule */
/* @var $dynamicModel yii\base\DynamicModel */
Yii::$app->i18n->disableDot();
$this->title = Adm::t('auth', 'Create Auth Rule');
$this->params['breadcrumbs'][] = ['label' => Adm::t('auth', 'Auth Rules'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
Yii::$app->i18n->resetDot();
?>
<div class="auth-rule-create">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
echo $this->render('_form', ['model' => $model, 'dynamicModel' => $dynamicModel]);
?>
</div>
示例6:
<?php
use pavlinter\adm\Adm;
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model pavlinter\adm\models\AuthAssignment */
Yii::$app->i18n->disableDot();
$this->title = Adm::t('auth', 'Update Auth Assignment: {item_name}', ['item_name' => $model->item_name]);
$this->params['breadcrumbs'][] = ['label' => Adm::t('auth', 'Auth Assignments'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->item_name, 'url' => ['index']];
$this->params['breadcrumbs'][] = Adm::t('auth', 'Update');
Yii::$app->i18n->resetDot();
?>
<div class="auth-assignment-update">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
echo $this->render('_form', ['model' => $model]);
?>
</div>
示例7: actionDelete
/**
* Deletes an existing Page model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param string $id
* @param null|integer $id_parent
* @return mixed
*/
public function actionDelete($id, $id_parent = null)
{
if (!in_array($id, Module::getInst()->closeDeletePage)) {
$this->findModel($id)->delete();
Yii::$app->getSession()->setFlash('success', Adm::t('', 'Data successfully removed!'));
}
$url = ['index', 'id_parent' => 0];
if ($id_parent !== null) {
$url['id_parent'] = $id_parent;
}
return $this->redirect($url);
}
示例8: function
?>
<div class="languages-index">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a(Adm::t('language', 'Create Language'), ['create'], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('!', '#', ['class' => 'btn btn-primary btn-adm-nestable-view']);
?>
</p>
<?php
echo Adm::widget('GridView', ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'nestable' => ['id' => 'pages-nestable-grid', 'btn' => false, 'nameCol' => 'name', 'parentCol' => false, 'orderBy' => SORT_ASC], 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'image', 'format' => 'raw', 'value' => function ($model, $index, $widget) {
if ($model->image) {
return Html::img($model->image, ['style' => 'max-width: 100px;max-height:100px;']);
}
}, 'width' => '100px'], 'name', 'code', ['class' => 'kartik\\grid\\BooleanColumn', 'attribute' => 'active', 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['options' => ['placeholder' => Adm::t('', 'Select ...', ['dot' => false])], 'pluginOptions' => ['allowClear' => true]]], ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{update} {delete}', 'width' => '70px']]]);
?>
</div>
示例9:
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-6">
<div>
<?php
echo $form->field($model, 'webtools')->textarea();
?>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<div>
<?php
echo $form->field($model, 'active', ["template" => "{input}\n{label}\n{hint}\n{error}"])->widget(CheckboxX::classname(), ['pluginOptions' => ['threeState' => false]]);
?>
</div>
</div>
</div>
<p>
<?php
echo InputButton::widget(['label' => !isset(Yii::$app->params[Module::getInstance()->settingsKey]) ? Adm::t('', 'Create', ['dot' => false]) : Adm::t('', 'Update', ['dot' => false]), 'options' => ['class' => 'btn btn-primary'], 'input' => 'adm-redirect', 'name' => 'redirect', 'formSelector' => $form]);
?>
</p>
<?php
ActiveForm::end();
?>
</div>
示例10:
</table>
<div style="text-align: center; padding: 10px 0px;">
<a class="text-font3" href="<?php
echo Url::to(['default/invoice', 'alias' => $model->alias], true);
?>
" style="background: none repeat scroll 0 0 #88ad09;color: white;display: inline-block;padding: 8px 20px;text-decoration: none;">
<?php
echo Adm::t('oplata/mail', "Pay");
?>
</a>
</div>
<div class="text-font" style="margin: 10px 0px;">
<?php
echo Adm::t('oplata/mail', "Link: {url}", ['url' => Url::to(['default/invoice', 'alias' => $model->alias], true)]);
?>
</div>
</div>
</div>
</div>
<?php
$this->endBody();
?>
</body>
</html>
<?php
$this->endPage();
示例11:
}, 1000);
}
}']]);
?>
</div>
<?php
}
?>
</div>
<div class="col-xs-6">
<a class="btn btn-s-md btn-white cloneBtn" href="javascript:void(0);">
<i class="fa fa-plus text"></i>
<span class="text"><?php
echo Adm::t('oplata', 'Add Item', ['dot' => false]);
?>
</span>
</a>
</div>
</div>
</div>
<?php
Adm::end('ActiveForm');
?>
</div>
<?php
示例12:
<?php
use yii\helpers\Html;
use pavlinter\adm\Adm;
/* @var $this yii\web\View */
/* @var $model app\models\ContactMsg */
Yii::$app->i18n->disableDot();
$this->title = Adm::t('app/contact_msg', 'Update Contact Msg: ') . ' ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => Adm::t('app/contact_msg', 'Contact Msgs'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Adm::t('app/contact_msg', 'Update');
Yii::$app->i18n->resetDot();
?>
<div class="contact-msg-update">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
echo $this->render('_form', ['model' => $model]);
?>
</div>
示例13:
<?php
use pavlinter\adm\Adm;
/**
* @var yii\web\View $this
*/
?>
<div class="elfinder-default-index">
<h1><?php
echo Adm::t('file', 'Media Files');
?>
</h1>
<?php
echo Adm::widget('FileManager');
?>
</div>
示例14:
<?php
use yii\helpers\Html;
use pavlinter\adm\Adm;
/* @var $this yii\web\View */
/* @var $model pavlinter\admoplata\models\OplataTransaction */
Yii::$app->i18n->disableDot();
$this->title = Adm::t('oplata', 'Update Order: ', ['modelClass' => 'Oplata Transaction']) . ' #' . $model->id;
$this->params['breadcrumbs'][] = ['label' => Adm::t('oplata', 'List'), 'url' => ['index']];
$this->params['breadcrumbs'][] = Adm::t('oplata', 'Update');
Yii::$app->i18n->resetDot();
?>
<div class="oplata-transaction-update">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
echo $this->render('_form', ['model' => $model, 'items' => $items]);
?>
</div>
示例15: function
/* @var $searchModel pavlinter\adm\models\AuthAssignmentSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
Yii::$app->i18n->disableDot();
$this->title = Adm::t('auth', 'Auth Assignments');
$this->params['breadcrumbs'][] = $this->title;
Yii::$app->i18n->resetDot();
?>
<div class="auth-assignment-index">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a(Adm::t('auth', 'Create Auth Assignment'), ['create'], ['class' => 'btn btn-primary']);
?>
</p>
<?php
echo Adm::widget('GridView', ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], 'item_name', ['attribute' => 'user_id', 'value' => function ($model, $index, $widget) {
if ($model->user) {
return $model->user->username;
}
}], ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{update} {delete}', 'width' => '70px']]]);
?>
</div>