Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14343

Can't acccess personnal library

$
0
0
Hi all ,

I've just created a library called Cms and i've follow those steps : http://www.codeigniter.com/user_guide/ge...aries.html

When i try to access function in my library i obtain error :  PHP FATAL ERROR : Call to a member function getTags() on a non-object

The controller code is :
PHP Code:
$this->load->library('Cms');
 
$pageName "index";
 
$data['cms'] = $this->Cms->getTags($pageName);
 
$this->load->view('accueil'$data); 

My class is :
PHP Code:
<?php defined('BASEPATH') OR exit('No direct script access allowed');

class 
Cms {

 
       public function getTags($pageName)
 
       {
 
        $query $this->db->query("SELECT * FROM cms WHERE 'page_name' = $pageName");

 foreach (
$query->result_array() as $row)
 {
 
       return $row;
 }
 
       }


I've checked many times mispelled word, but everything seems to be ok !!
I'm lost !
Thank for your help !

Viewing all articles
Browse latest Browse all 14343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>