 <p>You use <code>$this-&gt;form_validation</code> only from inside controllers and/or models. </p> <p>When you are inside the library itself, you're in a different scope, where the <code>form_validation</code> property doesn't exist ... and you don't need it in the first place - you just use <code>$this</code>, so it's <code>$this-&gt;set_message()</code> instead of <code>$this-&gt;form_validation-&gt;set_message()</code>.</p> <p>Read up on how OOP works: <a href="http://www.php.net/manual/en/language.oop5.basic.php" rel="nofollow">http://www.php.net/manual/en/language.oop5.basic.php</a></p>