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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.