我在y
轴上有一个溢出 div,并希望它恰好是屏幕高度的 80%。现在我的这个<div class="overflow-y-auto h-96">
可以工作了,但是高度必须大于 96,恰好是整个屏幕的 80%(为页眉和页脚留出空间)。
使用起来h-4/5
好像不行。
<div class="h-4/5 bg-yellow-200 overflow-hidden">
<div class="overflow-y-auto bg-yellow-500 space-y-3">
<div class="bg-blue-300 h-48">
</div>
<div class="bg-blue-300 h-48">
</div>
<div class="bg-blue-300 h-48">
</div>
<div class="bg-blue-300 h-48">
</div>
<div class="bg-blue-300 h-48">
</div>
<div class="bg-blue-300 h-48">
</div>
<div class="bg-blue-300 h-48">
</div>
<div class="bg-blue-300 h-48">
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
更新:我得到了这个(也可以在这里https://play.tailwindcss.com/NlZdzWfkyD)但是如果我取消注释顶栏它会失败,请问,有什么想法吗?
<div class="h-screen">
<div class="h-full">
<!--<div class="bg-blue-400 py-3">topbar</div>-->
<div class="pl-6 pr-16 pt-12 h-full">
<div class="h-full border border-gray-200 rounded-t-xl px-20 pt-3 flex …
Run Code Online (Sandbox Code Playgroud) Windows 主机和 Ubuntu 来宾之间的共享文件夹具有以下权限: Windows 中为 777 Ubuntu 中为 770
所以......当我像这样运行 docker-compose 时:
version: '2'
services:
web:
image: nginx:latest
ports:
- "8080:80"
volumes:
- ./sf_compartida/codigo:/code
- ./site.conf:/etc/nginx/conf.d/default.conf
networks:
- code-network
php:
image: php:fpm
volumes:
- ./sf_compartida/codigo:/code
networks:
- code-network
networks:
code-network:
driver: bridge
Run Code Online (Sandbox Code Playgroud)
Nginx 的 site.conf 文件:
server {
listen 80;
index index.php index.html;
server_name localhost;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /code;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; …
Run Code Online (Sandbox Code Playgroud) 例如,在PHP中,解析RSS提要的方法可能是:
<?php
$rss = simplexml_load_file('http://blog.wordpress_site.com/feed/');
{{ rss }}
foreach ($rss->channel->item as $item) {
echo $item->title;
echo $item->link;
echo $item->description;
echo $item->guid;
}
?>
Run Code Online (Sandbox Code Playgroud)
我怎么能在Twig上有这个?
更新:感谢回复我得到了它.现在它逐项获取,但不是像帖子的图像,类别或文本等字段:
SimpleXMLElement {#955 ?
+"title": "Website. Description of the website"
+"link": "http://blog.website.com/liktothepost"
+"pubDate": "Fri, 17 Feb 2017 07:56:43 +0000"
+"category": SimpleXMLElement {#1131}
+"guid": "http://blog.website.com/?p=400"
+"description": SimpleXMLElement {#953}
}
Run Code Online (Sandbox Code Playgroud) 提交后如何重置表格?这是一个简单的搜索表单,我在顶部显示一个字段,在底部显示一个表格,显示基于搜索的结果或整个列表......但它不会重置,搜索键仍然存在......
\n\n/**\n * @Route("/", name="plazas_index")\n */\npublic function indexAction(Request $request)\n{\n $form = $this->createForm(\'AppBundle\\Form\\BuscarType\');\n $form->handleRequest($request);\n\n $repository = $this->getDoctrine()->getRepository(\'AppBundle:Plaza\');\n\n if ($form->isSubmitted() && $form->isValid()) {\n\n $clave = $form[\'clave\']->getData();\n\n $query = $repository->createQueryBuilder(\'p\')\n ->where(\'p.nombre LIKE :nombre\')\n ->orWhere(\'p.localidad LIKE :localidad\')\n ->setParameter(\'nombre\', \'%\'.$clave.\'%\')\n ->setParameter(\'localidad\', \'%\'.$clave.\'%\')\n ->orderBy(\'p.nombre\', \'ASC\')\n ->getQuery();\n\n $plazas = $query->getResult();\n $cant = count($plazas);\n\n $this->addFlash($cant ? \'success\' : \'warning\', \'La b\xc3\xbasqueda de \'.$clave. \' ha producido \'.$cant.\' resultados\');\n //return $this->redirectToRoute(\'plazas_index\');\n }\n else {\n $plazas = $repository->findAll();\n }\n\n unset ($form);\n $form = $this->createForm(\'AppBundle\\Form\\BuscarType\');\n $form->handleRequest($request);\n return $this->render(\'admin/plazas/index.html.twig\', array(\n \'plazas\' …
Run Code Online (Sandbox Code Playgroud) 错误信息:
通过关系“AppBundle\Entity\Tarifa#pesos”发现了一个新实体,该实体未配置为级联实体的持久操作:AppBundle\Entity\TarifaPeso@0000000072d3bd4300000000232470d3。要解决此问题: 对此未知实体显式调用 EntityManager#persist() 或配置级联以在映射中保留此关联,例如 @ManyToOne(..,cascade={"persist"})。如果您无法找出导致问题的实体,请执行“AppBundle\Entity\TarifaPeso#__toString()”来获取线索。
塔里法.php
/**
* @ORM\OneToMany(targetEntity="TarifaPeso", mappedBy="tarifa")
*/
private $pesos;
Run Code Online (Sandbox Code Playgroud)
塔里法比索.php
/**
* @ORM\ManyToOne(targetEntity="Tarifa", inversedBy="pesos", cascade={"persist"})
* @ORM\JoinColumn(name="tarifa_id", referencedColumnName="id")
*/
private $tarifa;
Run Code Online (Sandbox Code Playgroud)
TarifaType.php
->add('pesos', CollectionType::class, array(
'entry_type' => TarifaPesoType::class,
'allow_add' => true,
'allow_delete' => true,
'by_reference' => false
))
Run Code Online (Sandbox Code Playgroud)
控制器...
public function newAction(Request $request)
{
$tarifa = new Tarifa();
$form = $this->createForm('AppBundle\Form\TarifaType', $tarifa);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$entityManager = $this->getDoctrine()->getManager();
$entityManager->persist($tarifa);
$entityManager->flush();
$this->addFlash('success', 'project.created_successfully');
return $this->redirectToRoute('admin_post_index');
}
return $this->render('admin/tarifas/new.html.twig', array(
'form' => $form->createView(),
)); …
Run Code Online (Sandbox Code Playgroud) 当我对消息使用新的 ICU 格式时,多元化在 Symfony4.3 中部分工作。
预期行为: One item found
当前行为: {1, plural, =0 {No items found.} one {One item found.} other {# items found.} }
翻译文件适用于其他翻译,所以我认为配置是正确的。在translations/messagges.en.yaml
msg:
photos:
uploaded: >
{photos, plural,
=0 {No items found.}
one {One item found.}
other {# items found.}
}
Run Code Online (Sandbox Code Playgroud)
在模板中有以下行:
{{ 'msg.photos.uploaded'|trans({'photos': 1}) }}
Run Code Online (Sandbox Code Playgroud)