From 42905cb9ac0242844a6e36cf90bcb51bcf01bc5e Mon Sep 17 00:00:00 2001 From: lopar Date: Sat, 4 Jul 2020 23:00:47 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D1=82=D0=B0=D1=80=D1=82=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D0=BD=D0=BE=D1=81=D0=B0=20showinf=5Fpers();=20?= =?UTF-8?q?=D0=B2=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=20(=D0=BD=D0=B0=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D0=B5=D1=86!=5F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/User.php | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/classes/User.php b/classes/User.php index 2800b5a..1953c90 100644 --- a/classes/User.php +++ b/classes/User.php @@ -43,8 +43,13 @@ class User } } - protected function showItem(array $item) { - echo sprintf('%s', $item['image'], $item['name']); + protected function showItem(array $item) + { + if ($item) { + echo sprintf('%s', $item['image'], $item['name']); + } else { + echo ""; + } } public function showUserInfo() { @@ -65,15 +70,19 @@ class User Находится в {$this->getRoomName($this->room)}
Предметы на тушке:
USERINFO; - if (isset($dressed_item[1])) { - $this->showItem($dressed_item[1]); - } - if (isset($dressed_item[2])) { - $this->showItem($dressed_item[2]); - } - if (isset($dressed_item[4])) { - $this->showItem($dressed_item[4]); - } + $this->showItem($dressed_item[1]); + $this->showItem($dressed_item[2]); + $this->showItem($dressed_item[3]); + $this->showItem($dressed_item[4]); +// if (isset($dressed_item[1])) { +// $this->showItem($dressed_item[1]); +// } +// if (isset($dressed_item[2])) { +// $this->showItem($dressed_item[2]); +// } +// if (isset($dressed_item[4])) { +// $this->showItem($dressed_item[4]); +// } } } \ No newline at end of file