• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Public variable in controller

#1
[eluser]someone Smile[/eluser]
Hello!

I've created some controller with public variable, which I would like to use in all functions. It looks like this:
Code:
<?php
class Test extends CI_Controller {

public $appname = "test";

public function index()
{
  echo $this->appname . " is name of app.";
}
}
?>

Is this way of using variable secure and true or is any other way better?

Thanks! :-)


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.