Hallo
Was ist die beste Lösung in Conto 3.5.x, um die Template zu ändern?
Ich bin in view : x.html5, formular is gesendet, ich will den view y.html5 anzeigen, was muss ich machen.
Danke
Hallo
Was ist die beste Lösung in Conto 3.5.x, um die Template zu ändern?
Ich bin in view : x.html5, formular is gesendet, ich will den view y.html5 anzeigen, was muss ich machen.
Danke
Kannst du deine Frage besser stellen?
Ich verstehe vorab nur Bahnhof
Was möchtest du genau machen?
Wenn du dich mit Deutsch schwer tust stell die Frage einfach in Englisch.
lg Matthias
Full Service Agentur - Grafikdesign, Screendesign, Webdesign, Webentwicklung, SEO, Weiterbildung, persönliches Coaching
http://www.matthiasgmeiner.com
Sorry, let's do it in english.
In "classes" I have a module that is calling the template "x.html5", when the user click a button (Form submit) on "x.html5" template I want to redirect him to "y.html5" what is the clean way to do this?
should I alter the $strTemplate value?
maybe use the redirect() method?
You do not redirect to a template. A template is used by a module to render it's output.
Do you want to render the output using a different template (which would be $this->template = new FrontendTemplate(nameoftemplate)) or do you want to redirect to a different page?
Contao-Community-Treff Bayern: http://www.contao-bayern.de
I don't understand 100% of your question, but this extension may help you:
https://contao.org/de/erweiterungsli...ksplitter.html
You can redirect depending on a value of form variable.
Ok so my question is, I want to redirect to a new template (if possible staying on the same page URL).
PHP-Code:
Is there a difference between doing ? :
$this->Template = new \FrontendTemplate($myTemplateName);
or
$strTemplate = $myTemplateName;
I'm trying this "$this->Template = new \FrontendTemplate($myTemplateName);" but I got a blank screen even if I re-generated the autoload.
It depends on where you do what. If you do (1) in your compile method, you overwrite the templates object that was already instanciated in the Module class.
If you do (2) in your modules generate function and call parent::generate() afterwards, you switch the template without overwriting the instance.
I guess it may help if you read the code of the base class for every frontend module in module.php.
What does $myTemplateName contain? Where is the desired template file stored? Please post your module code.
Best
Thanks
Geändert von iteration.info (21.09.2015 um 22:16 Uhr)
Hello
Got it!
Have to use : $this->strTemplate
and not $strTemplate
And it's working, thanks for your help guys!
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
Lesezeichen