You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specify fixed locals for rendered templates by default, disable with use_template_fixed_locals? false
This is designed to work with the fixed locals support added to
Roda, in applications that specify default fixed locals for
templates using the :template_opts option to Roda's render
plugin. A recommended practice for Roda going forward is to
specify that templates do not accept local variables by default,
and force templates that accept local variables to specify which
local variables are accepted:
plugin :render, template_opts: {
default_fixed_locals: '()',
extract_fixed_locals: true
}
This change allows Rodauth to work with such a recommendation,
by specifying that Rodauth templates take the rodauth local
variable (and the button template takes the value and opts
local variables). In cases where the user is passing additional
local variables via the :locals option, the assumption is they
are using their own templates, in which case Rodauth shouldn't
specify the fixed locals, so Rodauth doesn't set fixed locals
in that case. There may be other cases where Rodauth shouldn't
set fixed locals, and for those cases, the
use_template_fixed_locals? false configuration method can be used.
If the Roda and Tilt versions support fixed locals, this run the
tests with fixed locals on by default.
Copy file name to clipboardExpand all lines: doc/base.rdoc
+1
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,7 @@ unopen_account_error_status :: The response status to use when trying to login t
82
82
use_database_authentication_functions? :: Whether to use functions to do authentication. True by default on PostgreSQL, MySQL, and Microsoft SQL Server, false otherwise.
83
83
use_date_arithmetic? :: Whether the date_arithmetic extension should be loaded into the database. Defaults to whether deadline values should be set.
84
84
use_request_specific_csrf_tokens? :: Whether to use request-specific CSRF tokens. True if the default CSRF setting are used.
85
+
use_template_fixed_locals? :: Whether to specify fixed locals for rodauth templates. True by default, should only be set to false if overriding the templates and having them accept different local variables.
0 commit comments