Jump to content

Unexpected t_if


Xtremer360

Recommended Posts

I'm getting a unexpected t_if error and not sure where my fix is.

 

<?php
if($templateVar == '')
{
$templateVar = 'peach'; //defaulting to be safe
}
else
{
$templateVar = $templateVar; //passed from controller
}
?>
<?php $this->load->view($templateVar . '/header'); ?>
<?php $this->load->view($templateVar . '/navigation'); ?>
<!-- End Navigation -->
<?php $this->load->view($templateVar . '/msgbox'); ?>
<?php
    if((empty($bodyType))||(!isset($bodyType))||(trim($bodyType)=="")){$this->load->view($templateVar . '/body_full');}
       elseif($bodyType == "full"){$this->load->view($templateVar . '/body_full');}
/*
Commented out for now, as currently we only have one layout dimension, this is $
out various sections that have different layouts, 2 columns, 3 columns, columns$
on and so forth.
       elseif($bodyType == "2column"){$this->load->view($templateVar . '/body_2column$
       elseif($bodyType == "3column"){$this->load->view($templateVar . '/body_3column$
       elseif($bodyType == "blog"){$this->load->view($templateVar . '/body_blog');}
*/
else{$this->load->view($templateVar . '/body_full');}
?>

<?php $this->load->view($templateVar . '/footer'); ?>

 

Issue line:

if((empty($bodyType))||(!isset($bodyType))||(trim($bodyType)=="")){$this->load->view($templateVar . '/body_full');}

Link to comment
https://forums.phpfreaks.com/topic/262180-unexpected-t_if/
Share on other sites

I can't spot anything in the block of code you posted so I suspect that there is an unclosed brace (or something like that) in one of the view files being loaded with:

 

<?php $this->load->view($templateVar . '/_whatever_'); ?>

 

Then, when PHP reaches the if statement in question... it's unexpected.

Link to comment
https://forums.phpfreaks.com/topic/262180-unexpected-t_if/#findComment-1343606
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.