mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 21:12:15 +09:00
Add option to prepend header/footer to existing content
This commit is contained in:
parent
a66b036dd5
commit
7d8c09750b
1 changed files with 32 additions and 6 deletions
|
|
@ -2508,12 +2508,20 @@ class Context
|
|||
* Add html code before </head>
|
||||
*
|
||||
* @param string $header add html code before </head>.
|
||||
* @param bool $prepend
|
||||
* @return void
|
||||
*/
|
||||
public static function addHtmlHeader($header)
|
||||
public static function addHtmlHeader($header, bool $prepend = false)
|
||||
{
|
||||
if ($prepend)
|
||||
{
|
||||
self::$_instance->html_header = $header . (self::$_instance->html_header ? "\n" : '') . self::$_instance->html_header;
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$_instance->html_header .= (self::$_instance->html_header ? "\n" : '') . $header;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns added html code by addHtmlHeader()
|
||||
|
|
@ -2594,11 +2602,20 @@ class Context
|
|||
* Add html code after <body>
|
||||
*
|
||||
* @param string $header Add html code after <body>
|
||||
* @param bool $prepend
|
||||
* @return void
|
||||
*/
|
||||
public static function addBodyHeader($header)
|
||||
public static function addBodyHeader($header, bool $prepend = false)
|
||||
{
|
||||
if ($prepend)
|
||||
{
|
||||
self::$_instance->body_header = $header . (self::$_instance->body_header ? "\n" : '') . self::$_instance->body_header;
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$_instance->body_header .= (self::$_instance->body_header ? "\n" : '') . $header;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns added html code by addBodyHeader()
|
||||
|
|
@ -2614,11 +2631,20 @@ class Context
|
|||
* Add html code before </body>
|
||||
*
|
||||
* @param string $footer Add html code before </body>
|
||||
* @param bool $prepend
|
||||
* @return void
|
||||
*/
|
||||
public static function addHtmlFooter($footer)
|
||||
public static function addHtmlFooter($footer, bool $prepend = false)
|
||||
{
|
||||
if ($prepend)
|
||||
{
|
||||
self::$_instance->html_footer = $footer . (self::$_instance->html_footer ? "\n" : '') . self::$_instance->html_footer;
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$_instance->html_footer .= (self::$_instance->html_footer ? "\n" : '') . $footer;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns added html code by addHtmlHeader()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue