不要在Internet浏览器中打印信息,因为CodeIgniter方法

I have a problem in this method produtos_categoria the model folder, was to print all the information that is in the database, but that is not what happens. He behaves as if there was no information from the database table produtos.

 public function produtos_categoria($categoria){            
        $this->db->where('id_categoria',$categoria);        
        return $this->db->get('produtos')->result();
    }

in my database there are some tables, one of them is the Categorias table and the Produtos table.

I created a method to print the information from the category table and the Products table, but only information appears on the table categories browser. I messed up something in the project and need to find the error, I'm new to PHP programming.

this class is to be created produtos_categoria the method;

<?php

class Categorias_model extends CI_Model{

    var $id_categorias;
    var $categoria_nome;
    var $categoria_slug;
    var $data_alteracao;

    function __construct() {
        parent::__construct();
    }
    public function listar_categorias(){
        return $this->db->get('categorias')->result();
    }
    public function produtos_categoria($categoria){         
        $this->db->where('id_categoria',$categoria);        
        return $this->db->get('produtos')->result();
    }

    public function detalhes_categoria_by_slug($slug){
        $this->db->where('categoria_slug',$slug);
        $categorias = $this->db->get('categorias')->result();
        if(count($categorias) == 1){
            foreach ($categorias as $categoria){
                $this->id_categorias = $categoria->id_categorias;
                $this->categoria_nome = $categoria->categoria_nome;
                $this->categoria_slug = $categoria->categoria_slug;
                $this->data_alteracao = $categoria->data_alteracao;
            }

            $dados['categoria'] = $this;
            $dados['produtos_categoria']= $this->produtos_categoria($this->id_categorias);


        }
        else{
            $dados['categoria']= null;
            $dados['produtos_categoria']= null;
        }

        return $dados;
    } 

}

and this class that this line of code that prints the information in the browser

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Home extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->model('Categorias_model','categorias');
    }

    public function index()
    {
        $dados_header = array(
                    'titulo' => 'Super loja legal - Home',
                    'descricao' => 'descrição que vai no cabeçalho html',
                    'palavras_chave' => 'palavra 1,palavra 2, palavra N'
                ); 
                $dados_cabecalho = array(
                    'titulo_h2' => 'Catálago de produtos'
                );

                $dados_cabecalho['categorias'] = $this->categorias->listar_categorias();

                $this->layout->region('html_header','view_html_header',$dados_header);
                $this->layout->region('cabecalho','view_cabecalho',$dados_cabecalho);
                $this->layout->region('corpo','view_conteudo');
                $this->layout->region('rodape','view_rodape');
                $this->layout->region('html_footer','view_html_footer');
                $this->layout->show('layout');



    }
        public function categoria($slug){
            $dados_cabecalho['categorias'] = $this->categorias->listar_categorias();
            $dados['categoria'] = $this->categorias->detalhes_categoria_by_slug($slug);
            echo "<pre>";
            print_r($dados_cabecalho);
            print_r($dados);

        }
}

is this piece of code that prints the information;

public function categoria($slug){
            $dados_cabecalho['categorias'] = $this->categorias->listar_categorias();
            $dados['categoria'] = $this->categorias->detalhes_categoria_by_slug($slug);
            echo "<pre>";
            print_r($dados_cabecalho);
            print_r($dados);

here is the result;

http://localhost/Carrinho_de_Compras/index.php/home/categoria/algum-slug-de-categoria

be returning as if it had no information on the bank;

[categoria] => Array
        (
            [categoria] => 
            [produtos_categoria] => 
        )

)