Skip to main content
edited body
Source Link
Lovntola
  • 344
  • 2
  • 14

The Problem is the SEF Plugin. So I don't want to modify a core Plugin, so I wrote a new Plugin that makes the changes only for the mustache template back.
!!! Importetnt tatImportent that the new plugin must execute after the SEF Plugin
Here is my code sample to replace the / for the {{name}}

public function onAfterRender()
    {
        if (!$this->app->isClient('site'))
        {
            return;
        }
        
        $buffer = $this->app->getBody();
        $buffer = str_replace('/{{', '{{', $buffer);
            $this->app->setBody($buffer);
    }

The Problem is the SEF Plugin. So I don't want to modify a core Plugin, so I wrote a new Plugin that makes the changes only for the mustache template back.
!!! Importetnt tat the new plugin must execute after the SEF Plugin
Here is my code sample to replace the / for the {{name}}

public function onAfterRender()
    {
        if (!$this->app->isClient('site'))
        {
            return;
        }
        
        $buffer = $this->app->getBody();
        $buffer = str_replace('/{{', '{{', $buffer);
            $this->app->setBody($buffer);
    }

The Problem is the SEF Plugin. So I don't want to modify a core Plugin, so I wrote a new Plugin that makes the changes only for the mustache template back.
!!! Importent that the new plugin must execute after the SEF Plugin
Here is my code sample to replace the / for the {{name}}

public function onAfterRender()
    {
        if (!$this->app->isClient('site'))
        {
            return;
        }
        
        $buffer = $this->app->getBody();
        $buffer = str_replace('/{{', '{{', $buffer);
            $this->app->setBody($buffer);
    }
Source Link
Lovntola
  • 344
  • 2
  • 14

The Problem is the SEF Plugin. So I don't want to modify a core Plugin, so I wrote a new Plugin that makes the changes only for the mustache template back.
!!! Importetnt tat the new plugin must execute after the SEF Plugin
Here is my code sample to replace the / for the {{name}}

public function onAfterRender()
    {
        if (!$this->app->isClient('site'))
        {
            return;
        }
        
        $buffer = $this->app->getBody();
        $buffer = str_replace('/{{', '{{', $buffer);
            $this->app->setBody($buffer);
    }