CodeIgniter Forums
Security library Loading Error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Security library Loading Error (/showthread.php?tid=49591)

Pages: 1 2


Security library Loading Error - El Forum - 02-26-2012

[eluser]Eng.Faruk[/eluser]
When using the security helper in a controller ,i got error like this
$this->load->library('security');
$this->load->helper('security');


Error:

PHP Error was encountered
Severity: Notice

Message: Undefined property: Careers::$security

So can anyone suggest me to figureout the problem?



Security library Loading Error - El Forum - 02-26-2012

[eluser]InsiteFX[/eluser]
The Error is telling you that $security is not defined!

Try adding this at the top of your class.
Code:
public $security = '';



Security library Loading Error - El Forum - 02-26-2012

[eluser]Eng.Faruk[/eluser]
Dear,
Thanx for your reply.
Now i getting this error.


Quote:An Error Was Encountered
Unable to load the requested class: security


Awaiting for your feedback.


Security library Loading Error - El Forum - 02-26-2012

[eluser]InsiteFX[/eluser]
Where are you loading this?
Controller, Library or Model

You need to show your code for us to be able to help you.



Security library Loading Error - El Forum - 02-26-2012

[eluser]Eng.Faruk[/eluser]
Code:
class NewPassport extends Controller {

public $security = '';
function NewPass()
{
  parent::Controller();
    

  $this->load->library('security');
  $this->load->helper('security');
  
  $this->load->helper('url');
  $this->load->helper('form');
        $this->load->library('session');    
        $this->load->model('cms_model','cms', TRUE);
  $this->load->library('form_validation');
  

}



Security library Loading Error - El Forum - 02-26-2012

[eluser]pickupman[/eluser]
Using CI 2.0 or higher, the Security class is autoloaded by default because it is a core class. You do not need to load it. If you comment that line out, are you still getting an error?


Security library Loading Error - El Forum - 02-26-2012

[eluser]Eng.Faruk[/eluser]
I am using CI_VERSION 1.7.1
and if comment the line like below
//public $security = '';
Then Error comes like this
Quote:An Error Was Encountered
Unable to load the requested class: security



Security library Loading Error - El Forum - 02-26-2012

[eluser]pickupman[/eluser]
[quote author="Eng.Faruk" date="1330285732"]I am using CI_VERSION 1.7.1[/quote]

I would strongly recommend upgrading your version of CI as there are have been several updates since. The upgrade usually takes about 10-15 to rename a few constructors.


Security library Loading Error - El Forum - 02-26-2012

[eluser]Eng.Faruk[/eluser]
without updating the version is it possible to fix the error?


Security library Loading Error - El Forum - 02-26-2012

[eluser]Noobigniter[/eluser]
Why do not update ? it's free ^^