DirectoryLister 排序修改

2021-01-13 – 7:09 下午 --- 5,907 次阅读

1. 改 "app\vendor\symfony\finder\Iterator\SortableIterator.php":

        } elseif (self::SORT_BY_NAME_NATURAL === $sort) {
            $this->sort = static function (SplFileInfo $a, SplFileInfo $b) use ($order) {
                return $order * strnatcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname());

忽略大小写的自然排序:

        } elseif (self::SORT_BY_NAME_NATURAL === $sort) {
            $this->sort = static function (SplFileInfo $a, SplFileInfo $b) use ($order) {
                return $order * strnatcasecmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname());

2. 改 "app\views\components\file.twig"

<div class="ml-2">
<button
title="{{ translate('file.info') }}"
class="flex justify-center items-center rounded-full p-2 -m-1 md:invisible hover:bg-gray-400 hover:shadow group-hover:visible"
v-on:click.prevent="showFileInfo('{{ url(file.getPathname) | escape('js') }}')"
>
<i class="fas fa-info-circle"></i>
</button>
</div>

不显示 Hash 按钮:

<div class="ml-2">
<button
title="{{ translate('file.info') }}"
class="flex justify-center items-center rounded-full p-2 -m-1 md:invisible hover:bg-gray-400 hover:invisible group-hover:invisible"
v-on:click.prevent="showFileInfo('{{ url(file.getPathname) | escape('js') }}')"
>
<i class="fas fa-info-circle"></i>
</button>
</div>

:roll:

点击显示引用框
引用本文,复制粘贴...

点击可把本文加入多个网络分享站点

您还可以参考以下文章:


标签相关

  • None

内容相关

您必须 登录 才能发表评论.