kirsty
Member
I want to modify the error template to display more info on some of my custom errors. How do I access the params shown in this dump from the template?
I can access them in the error phrase as {my_error_param} etc but I want to use them in the template to do more complicated stuff something like the pseudo-code below rather than squish everything into the phrase, especially since the phrase editor tells me 'ideally markup should be made in templates, rather than phrases.'. I'm just not clear how I navigate through the dumped var above to get the pieces.
Thanks.
Code:
array:4 [▼
"xf" => array:36 [▶]
"errors" => array:1 [▶]
"error" => Phrase {#282 ▼
#language: Language {#232 ▶}
#name: "my_error_name"
#params: array:3 [▼
"my_error_param" => 128
"my_error_url" => "https://www.whateversomething.co.uk/"
"my_error_otherstuff" => true
]
#allowHtml: true
#options: []
}
"forJson" => true
]
Code:
<xf:if this is a my_error_name error and my_error_otherstuff is true>
obviously this is pseudo code but i want to access {my_error_param} and {my_error_url} and things and whatnot in here
</xf:if>
Thanks.