Browse Source

StoreTwigExtension

packProduct
Guillaume 3 years ago
parent
commit
7232c555dc
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      Twig/StoreTwigExtension.php

+ 6
- 0
Twig/StoreTwigExtension.php View File

new TwigFunction('merchant_current', [$this, 'getMerchantCurrent']), new TwigFunction('merchant_current', [$this, 'getMerchantCurrent']),
new TwigFunction('user_merchant_current', [$this, 'getUserMerchantCurrent']), new TwigFunction('user_merchant_current', [$this, 'getUserMerchantCurrent']),
new TwigFunction('section_current', [$this, 'getSectionCurrent']), new TwigFunction('section_current', [$this, 'getSectionCurrent']),
new TwigFunction('section_default', [$this, 'getSectionDefault']),
new TwigFunction('section_current_default', [$this, 'getSectionCurrentDefault']), new TwigFunction('section_current_default', [$this, 'getSectionCurrentDefault']),
new TwigFunction('section_current_visited', [$this, 'getSectionCurrentVisited']), new TwigFunction('section_current_visited', [$this, 'getSectionCurrentVisited']),
new TwigFunction('is_out_of_sections', [$this, 'isOutOfSections']), new TwigFunction('is_out_of_sections', [$this, 'isOutOfSections']),
return $this->sectionResolver->getCurrent(); return $this->sectionResolver->getCurrent();
} }


public function getSectionDefault(): ?SectionInterface
{
return $this->sectionStore->setMerchant($this->merchantResolver->getCurrent())->getOneDefault();
}

public function getSectionCurrentDefault(): ?SectionInterface public function getSectionCurrentDefault(): ?SectionInterface
{ {
return $this->sectionResolver->getCurrent(true); return $this->sectionResolver->getCurrent(true);

Loading…
Cancel
Save