artgris / FileManagerBundle

FileManager is a simple Multilingual File Manager Bundle for Symfony
MIT License
171 stars 89 forks source link

Service Configuration possibility use "orderby" and "order" for generate url #102

Open ethsam opened 2 years ago

ethsam commented 2 years ago

Hi, in my service i add "orderby" and "order" for url generate :

public function getConf($extra = []) {
        $dateNow = new \DateTime('now', new \DateTimeZone('Indian/Reunion'));
        $year = $this->getDirectoryExist($dateNow->format('Y'));
        $month = $this->getDirectoryExist($dateNow->format('Y') . "/" . $dateNow->format('m'));
        $day = $this->getDirectoryExist($dateNow->format('Y') . "/" . $dateNow->format('m') . "/" . $dateNow->format('d'));

        $localUri = "../public/assets/images/articles/". $dateNow->format('Y') . "/" . $dateNow->format('m') . "/" . $dateNow->format('d');

        return [
            'dir' => $localUri,
            'orderby' => 'date',
            'order' => 'desc',
            'type' => 'image',
            'tree' => false,
            ];
    }

Not working...

artgris commented 1 year ago

Hi, "orderby" and "order" are only configurable in the url:

{{ path('file_manager', {'conf':'perso', 'orderby': 'date', 'order' : 'desc'}) }}

or

/manager/?conf=perso&orderby=date&order=desc