本文整理汇总了PHP中common\models\User::isUserProduccion方法的典型用法代码示例。如果您正苦于以下问题:PHP User::isUserProduccion方法的具体用法?PHP User::isUserProduccion怎么用?PHP User::isUserProduccion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common\models\User
的用法示例。
在下文中一共展示了User::isUserProduccion方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: behaviors
/**
* @inheritdoc
*/
public function behaviors()
{
return ['access' => ['class' => AccessControl::className(), 'only' => ['gobierno-federal', 'embajadas', 'gdf', 'estatales', 'partidos-politicos', 'delegaciones', 'create-gob', 'create-embajada', 'create-gdf', 'create-estatales', 'create-ppoliticos', 'create-delegacion', 'create', 'update', 'delete', 'change'], 'rules' => [['allow' => true, 'actions' => ['gobierno-federal', 'embajadas', 'gdf', 'estatales', 'partidos-politicos', 'delegaciones', 'create-gob', 'create-embajada', 'create-gdf', 'create-estatales', 'create-ppoliticos', 'create-delegacion', 'create', 'update', 'delete', 'change'], 'roles' => ['@'], 'matchCallback' => function ($rule, $action) {
//Llamada al método que comprueba si es un vendedor
return \common\models\User::isUserSeo(Yii::$app->user->identity->id);
}], ['allow' => true, 'actions' => ['gobierno-federal', 'embajadas', 'gdf', 'estatales', 'partidos-politicos', 'delegaciones', 'create-gob', 'create-embajada', 'create-gdf', 'create-estatales', 'create-ppoliticos', 'create-delegacion', 'create', 'update', 'delete', 'change'], 'roles' => ['@'], 'matchCallback' => function ($rule, $action) {
//Llamada al método que comprueba si es un vendedor
return \common\models\User::isUserProduccion(Yii::$app->user->identity->id);
}]]]];
return ['verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['POST']]]];
}
示例2: behaviors
/**
* @inheritdoc
*/
public function behaviors()
{
return ['access' => ['class' => AccessControl::className(), 'only' => ['index', 'create', 'update', 'delete', 'change'], 'rules' => [['allow' => true, 'actions' => ['index', 'create', 'update', 'delete', 'change'], 'roles' => ['@'], 'matchCallback' => function ($rule, $action) {
//Llamada al método que comprueba si es un vendedor
return \common\models\User::isUserSeo(Yii::$app->user->identity->id);
}], ['allow' => true, 'actions' => ['index', 'create', 'update', 'delete', 'change'], 'roles' => ['@'], 'matchCallback' => function ($rule, $action) {
//Llamada al método que comprueba si es un vendedor
return \common\models\User::isUserProduccion(Yii::$app->user->identity->id);
}]]]];
return ['verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['POST']]]];
}
示例3: elseif
</title>
<?php
$this->head();
?>
</head>
<body>
<?php
$this->beginBody();
?>
<div class="wrap">
<?php
NavBar::begin(['brandLabel' => 'TeleUrban', 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-inverse navbar-fixed-top']]);
if (Yii::$app->user->isGuest) {
$menuItems[] = ['label' => 'Login', 'url' => ['/site/login']];
} elseif (\common\models\User::isUserProduccion(Yii::$app->user->identity->id)) {
$menuItems = [['label' => 'Agenda', 'url' => ['/agenda/index']], ['label' => 'Producción', 'items' => array(['label' => 'Dinamicas', 'url' => ['/dinamicas/index']], ['label' => 'Contenidos', 'url' => ['/contenidos/index']], ['label' => 'Comunicados', 'items' => array(['label' => 'Gobierno Federal', 'url' => ['/comunicado/gobierno-federal']], ['label' => 'Embajadas', 'url' => ['/comunicado/embajadas']], ['label' => 'GDF', 'url' => ['/comunicado/gdf']], ['label' => 'Estatales', 'url' => ['/comunicado/estatales']], ['label' => 'Partidos Políticos', 'url' => ['/comunicado/partidos-politicos']], ['label' => 'Delegaciones', 'url' => ['/comunicado/delegaciones']])])], ['label' => 'Personal', 'items' => array(['label' => 'Logout (' . Yii::$app->user->identity->username . ')', 'url' => ['/site/logout'], 'linkOptions' => ['data-method' => 'post']], ['label' => 'Cambia Contraseña', 'url' => ['/site/cambiaclave']])]];
} else {
$menuItems = [['label' => 'Agenda', 'url' => ['/agenda/index']], ['label' => 'Cuentas', 'items' => array(['label' => 'Iniciativa Privada', 'url' => ['/cuentas/iniciativa-privada']], ['label' => 'Gobierno Federal', 'url' => ['/cuentas/gobierno-federal']], ['label' => 'GDF', 'url' => ['/cuentas/gdf']], ['label' => 'Estatales', 'url' => ['/cuentas/estatales']], ['label' => 'Partidos Políticos', 'url' => ['/cuentas/partidos']], ['label' => 'Delegación', 'url' => ['/cuentas/delegacion']], ['label' => 'Intercambio', 'url' => ['/cuentas/intercambio']], ['label' => 'Fundación', 'url' => ['/cuentas/fundacion']])], ['label' => 'Contactos', 'items' => array(['label' => 'Iniciativa Privada', 'url' => ['/contactos/iniciativa-privada']], ['label' => 'Gobierno Federal', 'url' => ['/contactos/gobierno-federal']], ['label' => 'GDF', 'url' => ['/contactos/gdf']], ['label' => 'Estatales', 'url' => ['/contactos/estatales']], ['label' => 'Partidos Políticos', 'url' => ['/contactos/partidos']], ['label' => 'Delegación', 'url' => ['/contactos/delegacion']], ['label' => 'Intercambio', 'url' => ['/contactos/intercambio']], ['label' => 'Fundación', 'url' => ['/contactos/fundacion']], ['label' => 'Proveedores', 'url' => ['/proveedores-contacto/index']])], ['label' => 'Producción', 'items' => array(['label' => 'Dinamicas', 'url' => ['/dinamicas/index']], ['label' => 'Contenidos', 'url' => ['/contenidos/index']], ['label' => 'Comunicados', 'items' => array(['label' => 'Gobierno Federal', 'url' => ['/comunicado/gobierno-federal']], ['label' => 'Embajadas', 'url' => ['/comunicado/embajadas']], ['label' => 'GDF', 'url' => ['/comunicado/gdf']], ['label' => 'Estatales', 'url' => ['/comunicado/estatales']], ['label' => 'Partidos Políticos', 'url' => ['/comunicado/partidos-politicos']], ['label' => 'Delegaciones', 'url' => ['/comunicado/delegaciones']])])], ['label' => 'Proveedores', 'url' => ['/proveedores/index']], ['label' => 'Personal', 'items' => array(['label' => 'Logout (' . Yii::$app->user->identity->username . ')', 'url' => ['/site/logout'], 'linkOptions' => ['data-method' => 'post']], ['label' => 'Cambia Contraseña', 'url' => ['/site/cambiaclave']])]];
}
echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'items' => $menuItems]);
NavBar::end();
?>
<div>
<?php
echo $content;
?>
<?php
echo Alert::widget();
?>