Yii Framework Forum: Help - Mengubah Layout Yii - Yii Framework Forum

Jump to content

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

Help - Mengubah Layout Yii mengatur tampilan/layout di Yii Rate Topic: -----

#1 User is offline   funthere 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 16-April 13

Posted 16 April 2013 - 02:30 AM

agan mastah sekalian, tolong dong pencerahannya/ codingannya untuk buat tampilan/layout kayak gambar ini.
thx b4 :D

Attached File(s)


0

#2 User is offline   Nur Rochim 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 04-February 13
  • Location:Indonesia

Posted 16 April 2013 - 10:46 AM

View Postfunthere, on 16 April 2013 - 02:30 AM, said:

agan mastah sekalian, tolong dong pencerahannya/ codingannya untuk buat tampilan/layout kayak gambar ini.
thx b4 :D


Tinggal d ubah css nya aja gan
0

#3 User is offline   Finzaiko 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 37
  • Joined: 18-November 11
  • Location:Indonesia

Posted 17 April 2013 - 12:38 AM

agan ubah aja file main.php di folder protected/views/layouts/main.php
0

#4 User is offline   daudtm 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 85
  • Joined: 25-April 13
  • Location:Malang

Posted 25 April 2013 - 01:45 AM

View Postfunthere, on 16 April 2013 - 02:30 AM, said:

agan mastah sekalian, tolong dong pencerahannya/ codingannya untuk buat tampilan/layout kayak gambar ini.
thx b4 :D


Agan udah punya slicingnya (html+css), jadi gini step by stepnya:
1. header + footer masuk ke protected/views/layout/main.php (jangan lupa bagian echo $contentnya)
<html>
 <head>
 ...
 </head>
 <body>
    <header>...</header>
    <?php echo $content; ?>
    <footer>...</footer>
  </body>
</html>


2. bagian navigasi samping dan dan bagian content dibaginya di protected/views/layout/column2.php (jangan lupa echo $contentnya juga, karena content sebenarnya akan di load dari view masing2)
contoh view:
<?php $this->beginContent('//layouts/main'); ?>
 <div class="main-container">
   <div class="sidebar">
     <?php if (Yii::app()->user->isGuest) : ?>
      //login form
     <?php endif; ?>


     //listing menu navigasi
   </div>
   <div class="content">
     <?php echo $content; ?>
   </div>
 </div>
<?php $this->endContent(); ?>

3. masukan bagian conten ke view yg sesuai, lalu dari controllernya ubah bagian layout:
contoh view:
<h1>Welcome to aplikasi ane</h1>
<p>aplikasi ini bla.. bla.. bla..</p>
<p>lorem ipsum notter ipsum lorem ...</p>


contoh controller:
        public $layout='//layouts/column2';

0

#5 User is offline   ruderbytes 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 05-November 12
  • Location:Indonesia

Posted 17 May 2013 - 08:48 PM

kalau masih bingung buka link ini aja gan
Yii Layouts
atau bisa lihat tutorialnya
kalai masih bingung
[wiki]yii layouts

Happy Coding gan :))
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