Jump to content

Recommended Posts

  • Moderators
Posted

Ok, i'm trying to make a add on and i am making it only accessable for pilots but when i was logged in, i all got the red bar and my .Tpl is in the templates folder.

What is wrong with this code?

<?php

class flightops extends CodonModule
{

       public function index()
       {
		if(!Auth::LoggedIn())

		$this->set('message', 'You must be logged in to access this feature!');
		$this->render('core_error.tpl');
		return;

       Template::Show('flightops.tpl');

       }
}
?>

Any help would be awsome ;)

Guest lorathon
Posted

Try this

You need to put what you want done if the IF is true in brackets since it is more than one command.

<?php

class flightops extends CodonModule
{

       public function index()
       {
                       if(!Auth::LoggedIn())
                       {
                       $this->set('message', 'You must be logged in to access this feature!');
                       $this->render('core_error.tpl');
                       return;
                       }    

       Template::Show('flightops.tpl');

       }
}
?>

  • Moderators
Posted

It worked, thanks so much! :D

I'm just making a flight ops page with alot of features. Thanks for help!

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.

Loading...
×
×
  • Create New...