[eluser]kingconnections[/eluser]
So I am a noob. Nice to meet you all. I am having a problem with a CI site that loads a blank page on index. I thought the problem was in the routes.php file, so I echoed some test in that file. That worked. So then I moved on to the autoload.php file. I echo text in that file and it appears as well. But no display after the auto load comes up, but a white screen and If I try and echo text in the Controller it does not appear. Any ideas???
If I uses a default autoloader.php I believe that it makes it to the controller because it gives me an error about form object not being loaded. Any ideas would be great!!
[eluser]xwero[/eluser]
If you put a echo in any of the files that get loaded it will be displayed, it's not a good way to figure out what goes wrong.
Can i see your controller file where you want to echo?
[eluser]kingconnections[/eluser]
The echo was supposed to be displayed. I wanted to know if it is hitting that file or not. I know that it is not making it to the controller for some reason because when I echo text inside of the controller it is not displayed. Does that not make sense? Sorry I am not familiar with CI enough to know if that is really how it works. I can post the controller.
Code: class Page extends Controller {
function Page()
{
parent::Controller();
$this->tpl['title'] = "US Second Homes .com";
$this->tpl['head_search'] = $this->load->view('header/search', NULL, TRUE);
$this->tpl['content'] = '<p>Static page.</p>';
}
function index()
{
$this->tpl['title'] = "Find Your Ideal Second Home Here!";
//echo 'Hello World!';
/**
* Example: add_head('<meta name="keywords" content="second homes, second home pro" />')
* Add this to any page's function BEFORE $this->load->view('template', $this->tpl) is called
*/
add_head('<meta name="description" content="Search our database of ideal vacation and retirement properties in the United States and in other countries. Find agents to help you in popular vacation areas." />');
add_head('<meta name="keywords" content="real estate listings, real estate property, beach property, golf property, lake property, waterfront, florida, texas, colorado, branson, properties, homes, US Second Homes" />');
// Load and markup a random property
$this->load->model('Listing_model', 'listing');
$properties = $this->listing->get_all();
$feature = $properties[array_rand($properties)];
if ($feature)
{
if (count($feature->images))
{
$this->tpl['feature'] = '<a href="/listings/details/' . $feature->asset_id . '">';
$this->tpl['feature'] .= $this->image->display(array_shift($feature->images), 'featured', '', array('style' => 'border: 2px solid #185133; float: none;')) . '</a>';
}
$this->tpl['feature'] .= '<h3 style="font-size: 1.14em; color: #185133; margin: 0; padding: 0; height: 22px; overflow: hidden;">';
$this->tpl['feature'] .= anchor('/listings/details/' . $feature->asset_id, substr($feature->title, 0, 25)) . '</h3>';
}
// End random property
$this->tpl['sidebar'] = $this->load->view('sidebar/home', NULL, TRUE);
$this->tpl['content'] = $this->load->view('static/home', NULL, TRUE);
$this->tpl['head_search'] = $this->load->view('header/search', NULL, TRUE);
$this->load->view('template', $this->tpl);
}
function buy()
{
$this->tpl['title'] = "Looking Into FULL or FRACTIONAL Ownership of a Second Home?";
add_head('<meta name="description" content="Buying a second home through fractional ownership or full ownership" />');
add_head('<meta name="keywords" content="real estate fractional, fractional ownership, vacation homes, beach homes, golf homes, waterfront" />');
$this->tpl['sidebar'] = $this->load->view('sidebar/buy', NULL, TRUE);
$this->tpl['content'] = $this->load->view('static/buy', NULL, TRUE);
$this->tpl['head_search'] = $this->load->view('header/search', NULL, TRUE);
$this->load->view('template', $this->tpl);
}
function list_page()
{
$this->tpl['title'] = "Consider Listing Your Second Home for Full or Fractional Ownership";
add_head('<meta name="description" content="List your vacation property, full or fractional ownership" />');
add_head('<meta name="keywords" content="listing vacation home, listing vacation property, listing fractional, listing second home" />');
$this->tpl['sidebar'] = $this->load->view('sidebar/list', NULL, TRUE);
$this->tpl['content'] = $this->load->view('static/list', NULL, TRUE);
$this->tpl['head_search'] = $this->load->view('header/search', NULL, TRUE);
$this->load->view('template', $this->tpl);
}
function consultants()
{
$this->tpl['title'] = "Fractional Consultants";
$this->tpl['sidebar'] = $this->load->view('sidebar/consultants', NULL, TRUE);
$this->tpl['content'] = $this->load->view('static/consultants', NULL, TRUE);
$this->tpl['head_search'] = $this->load->view('header/search', NULL, TRUE);
$this->load->view('template', $this->tpl);
}
function agents_info()
{
$this->tpl['title'] = "Want to Become a SECOND HOME PRO?";
add_head('<meta name="description" content="Real estate agents can list their special second home properties in our second home database" />');
add_head('<meta name="keywords" content="list vacation property online, second home market, real estate marketing, real estate fractional" />');
$this->tpl['sidebar'] = $this->load->view('sidebar/agents_info', NULL, TRUE);
$this->tpl['content'] = $this->load->view('static/agents_info', NULL, TRUE);
$this->tpl['head_search'] = $this->load->view('header/search', NULL, TRUE);
$this->load->view('template', $this->tpl);
}
function manage()
{
$this->tpl['title'] = "Important Decisions Precede FULL and FRACTIONAL Asset Management";
$this->tpl['sidebar'] = $this->load->view('sidebar/manage', NULL, TRUE);
$this->tpl['content'] = $this->load->view('static/manage', NULL, TRUE);
$this->tpl['head_search'] = $this->load->view('header/search', NULL, TRUE);
$this->load->view('template', $this->tpl);
}
[eluser]xwero[/eluser]
Where is your tpl variable defined?
another thing i noticed the second argument of load->view should be '' and not null. I don't know if this is causing the blank page but it doesn't hurt to try
[eluser]kingconnections[/eluser]
I am not sure, someone brought me this code. I had to cut some out because of max size limit. Can I comment sections out to try and isolate the issue?
|