Skip to content

getBrowserPath in CLI #1616

Closed Answered by ytilotti
ytilotti asked this question in Q&A
Dec 13, 2024 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Sorry, I copied mindlessly. The code:

namespace App\Command;

use Liip\ImagineBundle\Imagine\Cache\CacheManager;
use Symfony\Component\Routing\RouterInterface;

class TestCommand extends Command
{
    public function __construct(
        protected readonly CacheManager $imagineCacheManager,
        private RouterInterface $router,
    ) {
        parent::__construct();
    }

    // Création d'une colonne export dans le devis
    protected function execute(InputInterface $input, OutputInterface $output): int
    {
         $this->router->getContext()->setHost('myurl2.com');
        $logo = $this->imagineCacheManager->getBrowserPath('path/logo.png', 'logo_50x50');
    }
}

And work with:

$this

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ytilotti
Comment options

@dbu
Comment options

dbu Dec 16, 2024
Maintainer

@ytilotti
Comment options

Answer selected by dbu
@dbu
Comment options

dbu Dec 17, 2024
Maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants