Xtremer360 Posted May 7, 2012 Share Posted May 7, 2012 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');} Quote Link to comment https://forums.phpfreaks.com/topic/262180-unexpected-t_if/ Share on other sites More sharing options...
codebyren Posted May 7, 2012 Share Posted May 7, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/262180-unexpected-t_if/#findComment-1343606 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.