Yii Framework Forum: [Ask] Modifikasi View Untuk Detailview - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[Ask] Modifikasi View Untuk Detailview Rate Topic: -----

#1 User is offline   dst34m 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 70
  • Joined: 07-November 12

Posted 09 March 2014 - 08:35 AM

misi gan mau tanya lagi, gmn ya modifikasi view ---> (detail view) biar ga monotone kyk bawaannya? ane cb modifikasi manual pake echo tp waktu ada value dari satu field yg null, malah jd error...

mohon sarannya ya gan..

trims.

Attached File(s)


0

#2 User is offline   dst34m 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 70
  • Joined: 07-November 12

Posted 13 March 2014 - 03:06 AM

mohon saran donk... please..
0

#3 User is offline   mhdrasad 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 199
  • Joined: 20-April 11
  • Location:Bumi Indonesia

Posted 14 March 2014 - 02:41 AM

$TS->HI_NAME << ini kemungkinan null
Wait For True Concept or Finish it With Coding Concept .
#chadnox
0

#4 User is offline   dst34m 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 70
  • Joined: 07-November 12

Posted 15 March 2014 - 11:17 PM

View Postmhdrasad, on 14 March 2014 - 02:41 AM, said:

$TS->HI_NAME << ini kemungkinan null


iy gan, nah kalau misal memang tidak diisi itu pasti kluar error, biar g error gmn ya?
skrg sih ane akalin tiap baris data nya ane kasih if(isset()).

ada yg lebih efektif ndak?
0

#5 User is offline   mhdrasad 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 199
  • Joined: 20-April 11
  • Location:Bumi Indonesia

Posted 16 March 2014 - 10:49 PM

View Postdst34m, on 15 March 2014 - 11:17 PM, said:

iy gan, nah kalau misal memang tidak diisi itu pasti kluar error, biar g error gmn ya?
skrg sih ane akalin tiap baris data nya ane kasih if(isset()).

ada yg lebih efektif ndak?


// klo $model->EMP_HEALT_TYPE udah pasti ada nilainya
$TS = HEALTH::model()->findByPk($model->EMP_HEALT_TYPE);
if($TS<>array()){
echo CHtml::link($TS->HI_NAME)
}


Ya intinya begimana caranya supaya gak diecho itu yang NULL. Tinggal di improve aja om :D
Wait For True Concept or Finish it With Coding Concept .
#chadnox
0

#6 User is offline   Bogel 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 35
  • Joined: 13-April 13

Posted 04 April 2014 - 03:27 AM

Sedikit saran untuk improvement.

echo (!empty($TS) && !is_null($TS->HI_NAME)) ? $TS->HI_NAME : '-';


Tapi yang lebih efektif adalah memastikan data di tabel yang sifatnya referensi seperti yang diwakili oleh model HEALTH terisi secara benar. :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users