我无法理解为什么php会给我一个错误
"致命错误:无法声明类rex\builder\RexBuilder,因为该名称已在第12行的/var/www/site2.dev/App/rex/RexBuilder.php中使用"
RexBuilder是静态类,它只被调用一次.我对项目进行了搜索,不再使用同名的类.
<?php
namespace rex\builder;
require_once 'Router.php';
use rex\router\Router;
error_reporting(E_ALL);
ini_set('display_errors', 1);
class RexBuilder {
public static function collector($array) {
$router = new Router();
foreach ($array as $key => $val) {
$router->get($val->getMethod(), $val->getInterfaces(), $val->getHandler());
}
$router->init();
}
}
?>
Run Code Online (Sandbox Code Playgroud)
在index.php中调用该类
RexBuilder::collector(array(
new BuildModel('POST', '/api/v1/user/register', new \api\register\Registration()),
new BuildModel('POST', '/api/v1/user/login', new \api\login\Login())));
Run Code Online (Sandbox Code Playgroud)
更多此类未使用
我设置了transition: all ease-in-out 1s;,但以同样的方式更改 的属性grid-column不起作用transition。
有没有其他方法可以在这里使用动画?
<div class="projects">
<div class="project" style="background: url(img/p1.png) center no-repeat / cover"></div>
<div class="project" style="background: url(img/p2.jpg) center no-repeat / cover"></div>
<div class="project" style="background: url(img/p3.jpg) center no-repeat / cover"></div>
<div class="project" style="background: url(img/p4.png) center no-repeat / cover"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
.projects {
width: 100%;
height: 500px;
display: grid;
grid-template-columns: repeat(4, minmax(100px, 1fr));
grid-auto-rows: 500px;
}
.project {
width: 100%;
transition: all ease-in-out 1s;
}
.project:nth-child(1) {
grid-column: 1;
grid-row: 1;
}
.project:nth-child(1):hover { …Run Code Online (Sandbox Code Playgroud)