如何告诉yii2注销已登录系统的特定用户?
比方说,有2个用户登录系统,userA并且userB.
如何指定退出userB?
我所知道的是userB必须触发此命令才能注销.
Yii::$app->user->logout();
return $this->goHome();
Run Code Online (Sandbox Code Playgroud)
但也许我们可以使用一些命令Yii::$app->user->logout('userB');?
或者它有其他方式吗?
我刚搬到Yii2.如何制作这样的文本框:
<?= $form->field($model, 'xxx') ?>
Run Code Online (Sandbox Code Playgroud)
但没有使用任何模型?
我是angular的新手,并试图与easyui angular结合使用。
我在尝试打开/关闭对话框时发现此错误:
错误错误:ExpressionChangedAfterItHasBeenCheckedError:检查表达式后,表达式已更改。以前的值:'klass:l-btn f-inline-row f-content-center l-btn-small l-btn-focus'。当前值:'klass:l-btn f-inline-row f-content-center l-btn-small'。
这是我的代码。
user.component.html
<eui-linkbutton (click)="addAction()" iconCls="icon-add" style="margin-bottom:10px">Add New</eui-linkbutton>
<eui-datagrid
[data]="users" style="height1:250px" [filterable]="true"
[selectionMode]="'single'"
[(selection)]="rowSelected"
[euiContextMenu]="contextMenu"
>
</eui-datagrid>
<!-- contextmenu -->
<eui-menu #contextMenu (itemClick)="contextClick($event)">
<eui-menu-item value="edit" text="Edit"></eui-menu-item>
<eui-menu-item text="Delete"></eui-menu-item>
<eui-menu-item text="View"></eui-menu-item>
</eui-menu>
<eui-dialog #formDialog [closed]="closed" [draggable]="true" [modal]="true" [title]="isNewRow ? 'Add' : 'Edit'" (close)="closed=true">
<div class="dialog-button">
<eui-linkbutton [disabled]="!formObj.valid" (click)="saveAction()" style="width:80px">Save</eui-linkbutton>
<eui-linkbutton (click)="formDialog.close()" style="width:80px">Cancel</eui-linkbutton>
</div>
</eui-dialog>
Run Code Online (Sandbox Code Playgroud)
user.component.ts
export class UserComponent implements OnInit {
rowSelected = null;
formObj: FormGroup;
constructor(public userService: UserService, …Run Code Online (Sandbox Code Playgroud) 让我说我有一个这样的词是"I shoot someone using ak47 and m4s 32 times"
什么是删除纯号码的最佳方法,这样我才会得到"I shoot someone using ak47 and m4s times"
如果有人能教我怎么做,我会很高兴.
我想做一些子查询选择,其条件是从主查询选择中获取的。
这是我的查询:
SELECT
DISTINCT MONTH(datetime_end) as B,
(
SELECT
SUM(DATEDIFF(DAY, datetime_start, datetime_end))
FROM
[simrke].[trx_medical_ruang] MR,
[simrke].[trx_ruang] R
WHERE
MR.ruang_cd = R.ruang_cd AND
R.ruang_nm like 'BAKUNG%' AND
MONTH(datetime_end) = B
)
FROM
[simrke].[trx_medical_ruang] M
ORDER BY B
;
Run Code Online (Sandbox Code Playgroud)
其中子查询选择条件MONTH(datetime_end) = B来自先前的选择,但我收到此错误消息:
[错误] 42S22 - [SQL Server] 列名“B”无效。
指向第一个 B 选择的正确方法是什么?
我尝试实现这个源并且运行良好。当我尝试从我的 telnet(windows)访问它时,它总是像这样发送我键入的字符。
但当我尝试使用 Linux 访问它时,它工作得很好。我使用 windows cmd 时出错了吗?顺便说一句,我使用它telnet 127.0.0.1 12345通过两个操作系统上的 telnet 进行连接。
我需要使用 Python 执行一些长时间的过程,该过程将使用 PHP(我的主要语言)调用并实时显示结果。
假设这是我的 Python 脚本(a.py)。
import time
for x in range(10):
print "S;adasdasd;",x
time.sleep(0.5)
Run Code Online (Sandbox Code Playgroud)
我尝试了很多来自互联网的例子,但总是得到相同的结果。PHP 总是等到脚本完成然后显示它。
这是我尝试过的众多代码之一。
header( 'Content-type: text/html; charset=utf-8' );
$handle = popen('python folder\\a.py', 'r');
while (!feof($handle)) {
echo fgets($handle);
flush();
ob_flush();
}
pclose($handle);
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
php ×4
yii2 ×2
angular ×1
linux ×1
python ×1
real-time ×1
session ×1
shell ×1
sql-server ×1
str-replace ×1
subquery ×1
telnet ×1
typescript ×1
windows ×1