SHOW:
|
|
- or go back to the newest paste.
1 | earth.ctp in full | |
2 | ||
3 | <?php $this->layout = 'applayout'; ?> | |
4 | ||
5 | <div id="container"> | |
6 | ||
7 | <div class="col-md-5 col-sm-5 " data-spy="scroll" data-target="#sidebar-nav"> | |
8 | ||
9 | <?php echo $this->Html->image('earth1.jpg'); ?> | |
10 | ||
11 | <h2> Fact File </h2> | |
12 | - | <?php foreach ($earth as $planet): ?> |
12 | + | |
13 | ||
14 | - | <h3><?php echo $planet['Planet']['planet_name']; ?></h3> |
14 | + | <h3><?php echo $earth['Planet']['planet_name']; ?></h3> |
15 | ||
16 | - | <p> <?php echo $planet['Planet']['planet_info']; ?></p> |
16 | + | <p> <?php echo $earth['Planet']['planet_info']; ?></p> |
17 | ||
18 | ||
19 | - | <?php endforeach; ?> |
19 | + | |
20 | </div><!-- /.col-xs-12 main --> | |
21 | ||
22 | <!-- Text Area col-sm-4 --> | |
23 | <div class="col-md-6 col-sm-6 "> | |
24 | //planet_content goes here | |
25 | </div> | |
26 | </div> | |
27 | ||
28 | ||
29 | ||
30 | PlanetsController.php in full | |
31 | ||
32 | <?php | |
33 | ||
34 | class PlanetsController extends AppController | |
35 | { | |
36 | public $name = 'Planets'; | |
37 | public $helpers = array('Html', 'Form'); | |
38 | public function earth() { | |
39 | ||
40 | ||
41 | $earth = $this->Planet->find('first', array('conditions' => array('planet_name' => 'Earth'))); | |
42 | $this->set('earth', $earth); | |
43 | ||
44 | ||
45 | } | |
46 | public function venus(){} | |
47 | public function mercury(){} | |
48 | public function mars(){} | |
49 | public function saturn(){} | |
50 | public function jupiter(){} | |
51 | public function uranus(){} | |
52 | public function neptune(){} | |
53 | ||
54 | } | |
55 | ?> |