Jump to content

can i exit; in a template?


diogo
 Share

Recommended Posts

I like to use this tecnique for my pages under construction:

<?php
if($user->id==40){
include("construction.inc");
}else{
// home code
}

but today it occurred to me to do simply this:

<?php if($user->id==40) include("construction.inc");?>

// home code

and in the end of the included file:

<?php exit;

Is there any problem on doing this? I don't think there's something going on after the page is rendered, but just wanted to be sure...

Link to comment
Share on other sites

I think you are better off not exiting, just because any hooks that go after render theoretically wouldn't get executed. It's possible some other housekeeping might get missed. Doing a "return;" might be better.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...