內容簡介
此外掛可以在需要的地方加入版權年份或日期間隔。預設情況下,它只會顯示當前年份,由伺服器指定(希望它能准確跟踪時間)。選擇性地,您可以包括開始年份。如果開始年份與當前年份不同,則會顯示開始年份和當前年份之間的間隔。
例如,如果您將開始年份設為2015,在2018年,您將得到以下結果:
2015-2018
您還可以設置自定義分隔符,以便間隔符號看起來不同。例如,如果您不希望破折號周圍有空格,您可以將分隔符設置為“-”,然後您將獲得以下結果:
2015-2018
範例
<?php
declare( strict_types = 1 );
namespace MyTheme\FooterTemplate
{
use \WaughJ\CopyrightYear\CopyrightYear;
?>
<footer class="footer">
<p>版權 Jaimeson Waugh © <?= new CopyrightYear( 2015, '-' ); ?>。</p>
</footer>
<?php
}
或
[版權年份 start="2015" divider="-"]
這將列印消息:版權 Jaimeson Waugh © 2015-2018。
外掛標籤
開發者團隊
原文外掛簡介
Adds copyright year or interval o’ years where desired. By default, it just shows the current year, as specified by the server ( which is hopefully keeping accurate track o’ time ). Optionally, you can include a start year. If the start year is different from the current year, then it will show an interval ‘tween the start year & current year.
For instance, if you set the start year to 2015, in 2018 you will get the following:
2015 - 2018
You can also set a custom divider if you want the interval sign to look different. For instance, if you don’t want the hyphen to have spaces round it, you could set the divider to “-“, & you will get the following:
2015-2018
Example
