我使用PHP Smarty时很奇怪.似乎php文件的编码会影响css.
PHP文件(ANSI) - test2.php
<?php
include_once("inc/smarty_inc.php");
$smarty->display('test.tpl.htm');
Run Code Online (Sandbox Code Playgroud)
Smarty文件(ANSI) - test.tpl.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>JPR</title>
</head>
<body>
<div style="width:500px;height:200px; background-color:Red;margin:auto;">
test
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
当这两个文件是ANSI时.div显示在页面的中心.(IE和Firefox)
当其中一个转换成utf-8时.div显示在页面左侧.(仅在IE中,可以使用Firefox)
它有什么关系?如何在IE中使用uff-8使其正常?
代码如下:
public class Program
{
static void Main(string[] args)
{
father f = new son(); Console.WriteLine(f.GetType());
f.show();
}
}
public class father
{
virtual public void show()
{
Console.WriteLine("father");
}
}
public class son : father
{
public override void show()
{
Console.WriteLine("son");
}
}
Run Code Online (Sandbox Code Playgroud)
结果是'儿子'.
如果我修改' public override void show()'到' public new void show()',结果是'父亲'.
所以我在下面的"规则"中总结:
以上都是我对多态性的理解.任何误解和错误?
我正在使用Zend Frameworker 1.12.
根据帮助文件,我使用Zend_Db_Statement来执行我的sql.
下面是我的PHP代码:
$sql = "delete from options where id=?";
$stmt = new Zend_Db_Statement_Mysqli($this->getAdapter(), $sql);
return $stmt->execute(array('1'));
Run Code Online (Sandbox Code Playgroud)
但错误是异常'PDOException',消息'SQLSTATE [HY093]:参数号无效:D:\ Zend\workspaces\DefaultWorkspace.metadata.plugins\org.zend.php.framework.resource\resources中没有绑定任何参数\ ZendFramework-1\library\Zend\Db\Statement\Mysqli.php:209堆栈跟踪:
......... .........
我用谷歌搜索了几天,但没有任何作用.
谁知道怎么修它?
WebClient 是一个响应式客户端,它提供了 RestTemplate 的替代方案。据说是异步的。
但我怀疑以下代码:
WebClient.create()
.method(HttpMethod.GET)
.uri("http://localhost:8080/testApi")
.retrieve()
.bodyToMono(String.class)
Run Code Online (Sandbox Code Playgroud)
它什么都不做。没有发送任何 http 请求。好像没有触发。除非我通过 add 触发它.block()。但它使事情不是“异步”。
另外,我所知道的是使用.subscribe()它使事情看起来异步。
但是 WebClient 是为此设计的吗?使用 WebClient 的最佳实践是什么?
php ×2
asynchronous ×1
c# ×1
html ×1
java ×1
mysql ×1
polymorphism ×1
smarty ×1
spring-boot ×1