03-15-2009, 06:47 PM
[eluser]matches[/eluser]
Hello, I am trying to load a view within a view and having some trouble.
I want to load this Location Selector within another view.
Location Selector Controller
Location Selector View
then I trying to load it within this view
When I view the page. I just begins the selection and fails before it fills in any data.
Any ideas what I am do
Hello, I am trying to load a view within a view and having some trouble.
I want to load this Location Selector within another view.
Location Selector Controller
Code:
<?php
class locationSelector extends Controller {
function __construct()
{
parent::Controller();
$this->load->database();
$this->load->helper(array('form', 'url'));
}
function index()
{
$venueCountries = "SELECT * FROM cities ORDER BY country, city";
$venueStateProvence = "SELECT * FROM cities ORDER BY state_provence";
$venueCity = "SELECT * FROM cities ORDER BY city";
$venues = "SELECT * FROM venues ORDER BY venue";
$data['venueCountries'] = $this->db->query($venueCountries);
$data['venueStateProvence'] = $this->db->query($venueStateProvence);
$data['venueCity'] = $this->db->query($venueCity);
$data['venues'] = $this->db->query($venues);
$this->load->view('locationSelector/index', $data);
}
}
?>
Location Selector View
Code:
<select>
<option>Select Venue</option>
<?php foreach($venues->result() as $row): ?>
<option><?= $row->venue ?></option>
<?php endforeach; ?>
</select>
<select>
<option>Select Country</option>
<?php foreach($venueCountries->result() as $row): ?>
<option><?= $row->country ?></option>
<?php endforeach; ?>
</select>
Quote:<?php $this->load->view('/locationSelector/index'); ?>
Code:
<?php $this->load->view('header/index'); ?>
<div id="content">
<div id="rightColumn">
<?php $this->load->view('/locationSelector/index'); ?>
</div>
<div id="leftColumn">
</div>
<div id="centerColumn">
<?php foreach($blogEntries->result() as $row): ?>
<div class="blogEntry">
<h2><a >id ?>"><?= $row->title ?></a></h2>
<h3><?= $row->category ?>/<?= $row->subCategory ?></h3>
<p><?= $row->body ?></p>
<?php
$time = mysql_to_unix($row->entryTime);
$datestring = "%Y %m %d";
echo mdate($datestring, $time);
?>
</div>
<?php endforeach; ?>
</div>
<div style="clear: both;"></div>
</div>
<?php $this->load->view('footer/index'); ?>
When I view the page. I just begins the selection and fails before it fills in any data.
Any ideas what I am do