本文整理汇总了PHP中date::year方法的典型用法代码示例。如果您正苦于以下问题:PHP date::year方法的具体用法?PHP date::year怎么用?PHP date::year使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类date
的用法示例。
在下文中一共展示了date::year方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
public function main()
{
?>
<div id="main">
<div id="reports-new">
<div class="ui error form segment square-corners no-shadow">
<div class="three fields">
<div class="field">
<label>Год набора</label>
<input id="year" name="year" placeholder="<?php
echo date::year();
?>
" type="text" value="<?php
echo $this->report->year;
?>
">
</div>
<div class="field">
<label>Срок обучения (лет)</label>
<input id="duration" name="duration" placeholder="4" type="text" value="<?php
echo $this->report->duration;
?>
" onchange="calendar.update();">
</div>
<div class="field">
<label>ФИО ректора</label>
<input id="rector" name="rector" placeholder="М.П. Батура" type="text" value="<?php
echo $this->report->rector;
?>
">
</div>
</div>
<div class="field">
<label>Регистрационный номер учебного плана</label>
<input id="registration_number" name="registration_number" placeholder="2014.09.20/000" type="text" value="<?php
echo $this->report->registration_number;
?>
">
</div>
<div class="field">
<div class="ui fluid selection dropdown">
<div class="default text">Форма обучения</div>
<i class="dropdown icon"></i>
<input type="hidden" id="training_form_id" name="training_form_id" value="<?php
echo $this->report->training_form_id;
?>
">
<div class="menu">
<?php
$training_forms = training_forms::get();
if ($training_forms) {
foreach ($training_forms as $training_form) {
?>
<div class="item" data-value="<?php
echo $training_form->id;
?>
"><?php
echo html::escape($training_form->name);
?>
</div>
<?php
}
}
?>
</div>
</div>
</div>
<div class="field">
<div class="ui fluid selection dropdown">
<div class="default text">Квалификация специалиста</div>
<i class="dropdown icon"></i>
<input type="hidden" id="qualification_id" name="qualification_id" value="<?php
echo $this->report->qualification_id;
?>
">
<div class="menu">
<?php
$qualifications = qualifications::get();
if ($qualifications) {
foreach ($qualifications as $qualification) {
?>
<div class="item" data-value="<?php
echo $qualification->id;
?>
"><?php
echo html::escape($qualification->name);
?>
</div>
<?php
}
}
?>
</div>
</div>
</div>
//.........这里部分代码省略.........
示例2: last_day_of_week
public static function last_day_of_week($year = null, $month = null, $week = null, $format = 'j')
{
if ($year === null) {
$year = date::year();
}
if ($month === null) {
$month = date::month();
}
if ($week === null) {
$week = date::week();
}
if ($week == date::weeks_in_month($year, $month)) {
return date::last_day_of_month($year, $month, $format);
}
if ($week > date::weeks_in_month($year, $month)) {
return 0;
}
return date($format, strtotime('this sunday', date::first_day_of_week($year, $month, $week, 'U')));
}