mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Compare commits
2 Commits
2c11426211
...
b150092395
Author | SHA1 | Date | |
---|---|---|---|
|
b150092395 | ||
|
25126267af |
@ -46,7 +46,7 @@ class Email extends SymfonyEmail
|
|||||||
private static string|array $admin_email = '';
|
private static string|array $admin_email = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the HTML template to render the email with (without *.ss extension)
|
* The name of the HTML template to render the email with
|
||||||
*/
|
*/
|
||||||
private string $HTMLTemplate = '';
|
private string $HTMLTemplate = '';
|
||||||
|
|
||||||
@ -408,13 +408,11 @@ class Email extends SymfonyEmail
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the template to render the email with
|
* Set the template to render the email with.
|
||||||
|
* Do not include a file extension unless you are referencing a full absolute file path.
|
||||||
*/
|
*/
|
||||||
public function setHTMLTemplate(string $template): static
|
public function setHTMLTemplate(string $template): static
|
||||||
{
|
{
|
||||||
if (substr($template ?? '', -3) == '.ss') {
|
|
||||||
$template = substr($template ?? '', 0, -3);
|
|
||||||
}
|
|
||||||
$this->HTMLTemplate = $template;
|
$this->HTMLTemplate = $template;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@ -428,13 +426,11 @@ class Email extends SymfonyEmail
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the template to render the plain part with
|
* Set the template to render the plain part with.
|
||||||
|
* Do not include a file extension unless you are referencing a full absolute file path.
|
||||||
*/
|
*/
|
||||||
public function setPlainTemplate(string $template): static
|
public function setPlainTemplate(string $template): static
|
||||||
{
|
{
|
||||||
if (substr($template ?? '', -3) == '.ss') {
|
|
||||||
$template = substr($template ?? '', 0, -3);
|
|
||||||
}
|
|
||||||
$this->plainTemplate = $template;
|
$this->plainTemplate = $template;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ class Form extends ModelData implements HasRequestHandler
|
|||||||
const ENC_TYPE_MULTIPART = 'multipart/form-data';
|
const ENC_TYPE_MULTIPART = 'multipart/form-data';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Accessed by Form.ss.
|
* Accessed by Form template.
|
||||||
* A performance enhancement over the generate-the-form-tag-and-then-remove-it code that was there previously
|
* A performance enhancement over the generate-the-form-tag-and-then-remove-it code that was there previously
|
||||||
*
|
*
|
||||||
* @var bool
|
* @var bool
|
||||||
@ -159,7 +159,7 @@ class Form extends ModelData implements HasRequestHandler
|
|||||||
/**
|
/**
|
||||||
* Legend value, to be inserted into the
|
* Legend value, to be inserted into the
|
||||||
* <legend> element before the <fieldset>
|
* <legend> element before the <fieldset>
|
||||||
* in Form.ss template.
|
* in Form template.
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*/
|
*/
|
||||||
@ -888,7 +888,7 @@ class Form extends ModelData implements HasRequestHandler
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the legend value to be inserted into
|
* Set the legend value to be inserted into
|
||||||
* the <legend> element in the Form.ss template.
|
* the <legend> element in the Form template.
|
||||||
* @param string $legend
|
* @param string $legend
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
@ -1234,7 +1234,7 @@ class Form extends ModelData implements HasRequestHandler
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the legend value to be inserted into the
|
* Get the legend value to be inserted into the
|
||||||
* <legend> element in Form.ss
|
* <legend> element in Form template
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
@ -948,7 +948,7 @@ class FormField extends RequestHandler
|
|||||||
*
|
*
|
||||||
* The default field holder is a label and a form field inside a div.
|
* The default field holder is a label and a form field inside a div.
|
||||||
*
|
*
|
||||||
* @see FieldHolder.ss
|
* see FieldHolder template
|
||||||
*
|
*
|
||||||
* @param array $properties
|
* @param array $properties
|
||||||
*
|
*
|
||||||
|
@ -87,7 +87,7 @@ class SSViewer
|
|||||||
private TemplateEngine $templateEngine;
|
private TemplateEngine $templateEngine;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string|array $templates If passed as a string with .ss extension, used as the "main" template.
|
* @param string|array $templates If passed as a string, used as the "main" template.
|
||||||
* If passed as an array, it can be used for template inheritance (first found template "wins").
|
* If passed as an array, it can be used for template inheritance (first found template "wins").
|
||||||
* Usually the array values are PHP class names, which directly correlate to template names.
|
* Usually the array values are PHP class names, which directly correlate to template names.
|
||||||
* <code>
|
* <code>
|
||||||
@ -179,7 +179,7 @@ class SSViewer
|
|||||||
$templates[] = $template;
|
$templates[] = $template;
|
||||||
$templates[] = ['type' => 'Includes', $template];
|
$templates[] = ['type' => 'Includes', $template];
|
||||||
|
|
||||||
// If the class is "PageController" (PSR-2 compatibility) or "Page_Controller" (legacy), look for Page.ss
|
// If the class is "PageController" (PSR-2 compatibility) or "Page_Controller" (legacy), look for Page template
|
||||||
if (preg_match('/^(?<name>.+[^\\\\])_?Controller$/iU', $class ?? '', $matches)) {
|
if (preg_match('/^(?<name>.+[^\\\\])_?Controller$/iU', $class ?? '', $matches)) {
|
||||||
$templates[] = $matches['name'] . $suffix;
|
$templates[] = $matches['name'] . $suffix;
|
||||||
}
|
}
|
||||||
|
@ -308,7 +308,7 @@ class i18nTest extends SapphireTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See @i18nTestModule.ss for the template that is being used for this test
|
* See i18nTestModule.ss for the template that is being used for this test
|
||||||
* */
|
* */
|
||||||
public function testNewTemplateTranslation()
|
public function testNewTemplateTranslation()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user