我在尝试登录系统时收到错误请求 (#400)错误。我正在本地主机上工作。
主要布局:
<html lang="<?= Yii::$app->language ?>">
<head>
<meta charset="<?= Yii::$app->charset; ?>">
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1"/>
<?= Html::csrfMetaTags(); ?>
<title><?= Html::encode($this->title); ?></title>
<?php $this->head(); ?>
</head>
<body></body>
</html>
Run Code Online (Sandbox Code Playgroud)
视图 ( login.php):
<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
$this->title = 'Login';
$this->params['breadcrumbs'][] = $this->title; ?>
<div class="container w-xxl w-auto-xs">
<a href class="navbar-brand block m-t">OpenXcell Pvt. Ltd.</a>
<div class="m-b-lg">
<div class="wrapper text-center">
<strong>Sign in to get in touch</strong>
</div>
<form action="/advanced/admin/site/login"
method="post"
name="form"
class="form-validation">
<div class="list-group list-group-sm">
<div class="list-group-item"> …Run Code Online (Sandbox Code Playgroud) 如果路由器具有子组件,如何共享变量并通过绑定保持变量更新?
这是我的代码(的一部分):
app_component.dart:
import 'package:angular2/core.dart';
import 'package:angular2_components/angular2_components.dart';
import 'package:angular2/router.dart';
import 'package:my_app/profile_component/profile_component.dart';
import 'package:my_app/login_component/login_component.dart';
@Component(
selector: 'my-app',
styleUrls: const ['app_component.css'],
templateUrl: 'app_component.html',
directives: const [
ROUTER_DIRECTIVES,
materialDirectives,
LoginComponent,
ProfileComponent
],
providers: const [
ROUTER_PROVIDERS,
const Provider(LocationStrategy, useClass: HashLocationStrategy),
materialProviders
],
)
@RouteConfig(const [
const Route(path: 'home', name: 'Home', component: HomeComponent, useAsDefault: true),
const Route(path: 'profile', name: "User Profile", component: ProfileComponent)
])
class AppComponent {
@ViewChild('login')
LoginComponent loginComponent;
@ViewChild('profile')
ProfileComponent profileComponent;
bool get isUserLoggedIn => loginComponent.isUserLoggedIn;
}
Run Code Online (Sandbox Code Playgroud)
app_component.html:
<nav>
<ul>
<li *ngIf="!isUserLoggedIn"> …Run Code Online (Sandbox Code Playgroud) 我遇到的情况是,我在我的 php 网站中使用了多个主题,并且还集成了一个 wordpress 博客。
例如,这是我的网站网址: http://example.com
在那里我想通过传递一个查询参数来切换主题,例如:
http://example.com?mytheme=red_theme
http://example.com?mytheme=blue_theme
etc.
Run Code Online (Sandbox Code Playgroud)
目前我在 WordPress 中激活的主题是这样的blue_theme,我的 WordPress 博客 URL 是这样的:
http://example.com/blog?mytheme=red_theme
Run Code Online (Sandbox Code Playgroud)
例如:red_theme应该像预览一样显示。
否则,如果我通过这个 URL:
http://example.com/blog
Run Code Online (Sandbox Code Playgroud)
然后blue_theme应该显示默认主题 ( )。
我可以在核心 PHP 中调整它,但我不知道如何使用 WordPress。
Relativ和Dart的新手我有以下问题:
my_component.dart:
import 'package:angular2/core.dart';
import 'package:angular2_components/angular2_components.dart';
import 'package:google_maps/google_maps.dart';
import 'dart:html';
@Component(
selector: 'google-route-map',
styleUrls: const ['my_component.css'],
templateUrl: 'my_component.html',
directives: const [materialDirectives],
providers: const [materialProviders],
)
class MyComponent {
MyComponent() {
var m = querySelector("#my-canvas");
print (m); // is null
// do something with m....
}
}
Run Code Online (Sandbox Code Playgroud)
my_component.html:
<div id="my-canvas"></div>
Run Code Online (Sandbox Code Playgroud)
据我所知,问题是querySelector查询只有基本dom而不是shadowDom.
但是,如何在模板中查询id?
感觉像一个愚蠢的问题,但我不明白。如何在Angular 2 Dart模板中进行快速字符串连接?
我的组件有一个单独的html文件,可以说my_component.html:
作品:
....
<div id="abc">
{{order.pickupPlace.email}}
</div>
...
Run Code Online (Sandbox Code Playgroud)
作品:
....
<div id="abc">
{{ ((order.pickupPlace.state) ? order.pickupPlace.state+" ":'')}}
</div>
...
Run Code Online (Sandbox Code Playgroud)
不起作用:
....
<div id="abc">
{{"<br/>"+order.pickupPlace.email}}
</div>
...
Run Code Online (Sandbox Code Playgroud)
不起作用:
....
<div id="abc">
{{order.pickupPlace.name+" "+order.pickupPlace.email}}
</div>
...
Run Code Online (Sandbox Code Playgroud)
尝试在此处的文档中找到答案(https://webdev.dartlang.org/angular/guide/template-syntax#!#expression-operators),但是没有运气。
当然,我可以*ngIf在有条件输出的每个元素上使用,但是有没有办法进行简单的字符串连接?
我要实现的目标:
abstract final class NoticeTypes {
const ERROR = "error";
const WARNING = "warning";
const INFO = "info";
const SUCCESS = "success";
static function getAll() {
$oClass = new ReflectionClass(__CLASS__);
return $oClass->getConstants();
}
}
Run Code Online (Sandbox Code Playgroud)
解释器不允许这样做:
致命错误:无法在...中的抽象类上使用final修饰符
但是,我想将其用作“ 恒定的不可修改的枚举 ”。这应该:
为什么解释器不允许这样做,我应如何实施?
目前我正在学习Haskell.我们必须确定给定函数的最一般类型,但我还没有得到它.解释器如何确定函数的最一般类型,尤其是lambda表达式?什么是手动确定最常规类型的安全方法?
tx2 = (\x y z -> y.z.z)
tx2::a->(a->b)->(a->a)->b -- my guess
tx2 :: a -> (b -> c) -> (b -> b) -> b -> c -- interpreter solution
Run Code Online (Sandbox Code Playgroud)
如果第一个变量(a)应用于表达式z,则z必须将a作为输入参数,但它在(b-> b)中使用b.y消耗b并生成c,因此最终结果必须为c.但为什么b(作为中间结果?)包含在类型中?如果是这样,为什么它不是 - >(b - > c) - >(b - > b) - > b-> b - > c?
tm2 = (\i -> [sum,product]!!i)
tm2:: Int->[(Integer->Integer->Integer)]->(Integer->Integer->Integer) -- my guess
\i -> [sum,product] !! i :: Num a => Int -> [a] -> a -- interpreter with direct input
tm2 :: …Run Code Online (Sandbox Code Playgroud) 你好我在那里尝试了以下我认为应该是有效的CSS,它不起作用(用谷歌Chrome测试).
<ul>
<li><a href="...">bla</a></li>
<li><a href="...">bla</a></li>
<li><a href="...">bla</a></li>
<li><a href="...">bla</a></li>
<li><a href="...">bla</a></li>
</ul>
Run Code Online (Sandbox Code Playgroud)
CSS:
ul li {
float:left;
}
ul li:nth-child(3):after {
content:"";
display:table;
clear:both;
}
Run Code Online (Sandbox Code Playgroud)
浮动列表元素应在响应式设计中的列表中的每个第三个元素之后开始一个新行.你有解决方案的建议吗?这不应该工作吗?
当父高度未指定(自动)时,如何让子 div 成为父高度的 120%?
当父级具有指定的高度时,它会起作用:
#bar {
background-color:rgba(120,0,0,0.5);
height:120px;
}
#child {
background-color:rgba(0,120,0,0.5);
height:120%;
}Run Code Online (Sandbox Code Playgroud)
<div id="bar">
<div id="child">
Lorem<br/>
ipsum<br/>
dolor<br/>
sit<br/>
amet.
</div>
</div>Run Code Online (Sandbox Code Playgroud)
当父高度为自动(未指定)时,它会失败:
#bar {
background-color:rgba(120,0,0,0.5);
}
#child {
background-color:rgba(0,120,0,0.5);
height:120%;
}Run Code Online (Sandbox Code Playgroud)
<div id="bar">
<div id="child">
Lorem<br/>
ipsum<br/>
dolor<br/>
sit<br/>
amet.
</div>
</div>Run Code Online (Sandbox Code Playgroud)
听起来是一个简单的问题,但结果证明解决起来非常具有挑战性。对于某些网站,我的内容只有在用户悬停/聚焦链接时才会显示。然而,该链接本身有一个目标。
如果触摸屏用户单击这些链接之一,浏览器会立即转到该href位置。这意味着悬停内容永远不可见!
这就是为什么没有鼠标(或其他可以像魔术遥控器一样悬停的设备)的用户应该看到替代内容的原因。但是我怎样才能检测到这一点?
$(document).on('click','#my-menu-inner > ul > li > a',function(e) {
if(clientHasInputDeviceSupportingHover()) {
return true;
} else {
e.preventDefault();
$('#for-no-hover-visitors').html('');
$(this).clone().appendTo('#for-no-hover-visitors');
$(this).next().clone().appendTo('#for-no-hover-visitors');
}
});
function clientHasInputDeviceSupportingHover() {
// HOW CAN I DETECT THIS???
if($('#checkhover:checked').length > 0) {
return true;
}
return false;
}Run Code Online (Sandbox Code Playgroud)
.clearfix::after {
content: "";
clear: both;
display: table;
}
#my-menu-inner > ul {
margin:10px;
width:100%;
background-color:yellow;
list-style-type:none;
position:relative;
}
#my-menu-inner > ul > li {
float:left;
margin:20px;
}
#my-menu-inner > ul > li > a …Run Code Online (Sandbox Code Playgroud)