title: Codeigniter: Message: Call to a member function line() on null
body: <p>Codeigniter:</p>
  
  <p>I am doing this in language/english/pages/about-me_lang.php:</p>
  
  <pre><code>&lt;?php echo $this-&gt;lang-&gt;line('url_Contact')?&gt;
  </code></pre>
  
  <p>and I am given this error:</p>
  
  <pre><code>Message: Call to a member function line() on null
  </code></pre>
  
  <p>so $this doesn't have lang...</p>
  
  <p>What should I use to get lang line variable?</p>
  
  <p>And how to know that is $this anyway? I mean in the whole thing (Codeigniter)</p>
  
  <p>Thanks</p>
  
  <p><strong>Update 1:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/uYBtJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uYBtJ.png" alt="enter image description here"></a></p>
  
  <p>it is here, in these files that nothing with $this-> will work, like $this->load or $this->lang.</p>
  
  <p>What is $this here and how to get $this that I can load files there?</p>
  
  <p><strong>Update 2:</strong></p>
  
  <blockquote>
    <p>$this is applicable inside a class context.</p>
  </blockquote>
  
  <p>So it means that a php file in views folder belongs to a class (is it from a controler class context?), but php file under language isn't, hm...</p>
  
  <p><strong>Update 3:</strong></p>
  
  <p>So, in view we have CI_Loader and based on this: <a href="https://www.codeigniter.com/user_guide/libraries/loader.html" rel="nofollow noreferrer">https://www.codeigniter.com/user_guide/libraries/loader.html</a></p>
  
  <p>is responsible for what it is responsible :)</p>
  
  <p>...but, under the language folder, we have a different thing: </p>
  
  <pre><code>because when I try: $this-&gt;load-&gt;model('functions');
  </code></pre>
  
  <p>i get:</p>
  
  <pre><code>Message: Undefined property: CI_Lang::$load
  </code></pre>
  
  <p>Now, how with CI_Lang class to get that variable?</p>
  
  <p><strong>Update 4:</strong></p>
  
  <p>Found the solution, posted it as separate answer down below!</p>