Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6701619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:57:20+00:00 2026-05-26T06:57:20+00:00

I’m not sure how to do this because its not echoing my html. Its

  • 0

I’m not sure how to do this because its not echoing my html. Its showing the div tag in firebug but not anything else after it which should be either the index page(homepage) or my 404 page. What’s supposed to happen is its supposed to find out which page view its supposed to load via the if statement and then load load that view inside the content page.

Controller:

 $siteInfo = $this->kow->getSiteTitleAndSlogan();
 $activeTemplate = $this->kow->getTemplate();
 if ($this->kow->pageStatus('index', $activeTemplate[0]->short_name) == 1){
     $page = $this->load->view($activeTemplate[0]->short_name.'/pages/index'); 
 } else {
     $page = $this->load->view($activeTemplate[0]->short_name.'/pages/404'); 
 }
 $footerLinks = $this->kow->getFooterNav(); 
 $this->template
 ->title($siteInfo[0]->site_name,$siteInfo[0]->site_slogan)
 ->prepend_metadata('<link rel="stylesheet" type="text/css" href="http://www.kansasoutlawwrestling.com/assets/css/'.$activeTemplate[0]->short_name.'.css" />')
 ->set('footerLinks', $footerLinks)
 ->set('page', $page)               
 ->set_partial('header', $activeTemplate[0]->short_name.'/header')
 ->set_partial('navigation', $activeTemplate[0]->short_name.'/navigation')            
 ->set_partial('content', $activeTemplate[0]->short_name.'/content')
 ->set_partial('footer', $activeTemplate[0]->short_name.'/footer')
 ->build('kow');

if ($this->kow->pageStatus('index', $activeTemplate[0]->short_name) == 1){
      $page = $this->load->view($activeTemplate[0]->short_name.'/pages/index'); 
} else {
      $page = $this->load->view($activeTemplate[0]->short_name.'/pages/404'); 
}

View:

<div id="content">
<?php 
echo $page; 
?>
</div>

EDIT: What I’m trying to do is take the id of the active template and the string index to the pageStatus function and find out if the status of the page has a value of 1. When I run the print_r function like below I get this:

 Array ( [0] => Array ( [status_id] => 1 ) ) 

Controller

if ($this->kow->pageStatus('index', $activeTemplate[0]->id) == 1){
    $page = $this->load->view($activeTemplate[0]->short_name.'/pages/index', '', true); 
} else {
    $page = $this->load->view($activeTemplate[0]->short_name.'/pages/404', '', true); 
}
print_r($this->kow->pageStatus('index', $activeTemplate[0]->id));

EDIT 2: I’m still not getting the right page to view.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:57:21+00:00Added an answer on May 26, 2026 at 6:57 am

    You’re loading the views for index and 404 into the $page variable incorrectly. To store the output of a $this->load->view() call you must include true as the third parameter.

    From the CI user guide

    Returning views as data

    There is a third optional parameter lets you change the behavior of the function so that it returns data as a string rather than sending it to your browser. This can be useful if you want to process the data in some way. If you set the parameter to true (boolean) it will return data. The default behavior is false, which sends it to your browser. Remember to assign it to a variable if you want the data returned:

    $string = $this->load->view('myfile', '', true);
    

    Also, the last bit of your code, the second definition of $page happens after the call to ->set('page', $page) and ->build('kow'); which therefore won’t change the output.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.