20.01.2015 Views

Yii Framework

Yii Framework

Yii Framework

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

42<br />

รูปที่ 10-5 แสดงการเรียกใช้ฟังก์ชั่น saveAs()<br />

ปัญหาที่พบ : ในฟังก์ชั่น actionCreate() มีปัญหาในส่วนที่เป็นค าสั่ง $this-> redirect (array( 'view',<br />

'id'=>$model->image_id )); ซึ่งปัญหาที่เกิดขึ้นจะท าการชี้แจงใน ภาคผนวก ก.<br />

การแสดงผลรูปภาพ<br />

ที่ ไ ด เรค ท อรี่ www/<strong>Yii</strong>Training/protected/views/image/_view.php แ ก้ ไ ข ส่ ว น ข อ ง<br />

Attribute ที่ชื่อ picture เพื่อให้สามารถแสดงผลรูปภาพได้ ซึ่งมีการแก้ไขค าสั่ง ดังรูปที่ 10-6<br />

รูปที่ 10-6 แสดงการใช้ค าสั่ง แสดงผลรูปภาพ<br />

เมื่อแก้ไขค าสั่งเรียบร้อยแล้ว สามารถดูรูปแบบการแสดงผลได้ ที่ http://localhost/<br />

<strong>Yii</strong>Training/index.php/image/index ซึ่งมีรูปแบบการแสดงผล ดังรูปที่ 10-11

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!