Функция MonthData также не выводит данные.
Что мне делать?
============================== =
Я изменил исходный код вот так, и он работает нормально.
спасибо.
Код: Выделить всё
public int $_year;
public int $_month;
public int $_day;
Код: Выделить всё
$this->_year = $year ? $year : date('Y');
$this->_month = $month ? $month : date('n');
$this->_day = date('j');
}
{
Код: Выделить всё
return $this->monthData($this->_month, $this->_year);
}
Код: Выделить всё
**This is the source code used in 7.2.**
1.php
if(!$year) { $year=date('Y'); $month=date('n'); $day=date('j'); }
echo "$year $month $day "; // 2024 5 4
$cal = new Calendar($year,$month);
echo $cal->showMonth($_SESSION['Iyagi_Id']);
2.php
class Calendar
{
var $_year = null;
var $_month = null;
var $_day = null;
function Calendar($year,$month) {
$this->_year = $year ? $year : date('Y');
$this->_month = $month ? $month : date('n');
$this->_day = date('j');
}
function showMonth ()
{
echo "$this->_month $this->_year cale 88";
return $this->monthData($this->_month, $this->_year);
}
function monthData ($setMonth, $setYear) {
GLOBAL $setMonth, $setYear;
echo "-105 $setMonth , $setYear 105-";
}
Подробнее здесь: https://stackoverflow.com/questions/784 ... from-class
Мобильная версия