Welcome Guest, Not a member yet? Register   Sign In
Display raw content instead of html
#1

[eluser]Radou[/eluser]
Hello !

I am developing a CI app, and I have a controller with a function that is used to view a post :

Code:
function view($id=0)
        {
    

            $check['idUser'] = $this->tank_auth->get_user_id();
            $check['post'] = $this->MPost->getAllPosts_by('id',$id);
            
            if(sizeof($check['post'])==0)
            {
            
            $this->load404page();
          
            }else{
    
          
            $data['title'] = "...";
            $data['subtitle'] = " ... ..";
            $data['elementidcontainer'] = "..";
            $data['elementid'] = "...";
            $data['currentuser'] = $this->tank_auth->get_user_id();
            
            $data['poster'] = $this->MPost->getPoster($id);
            $data['posterpostnum'] = $this->MUsers->count_byuser('post',$data['poster'][0]['idUser']);
            $data['posterconnections'] = $this->MUsers->myConnections($data['poster'][0]['idUser']);
    

          

   $this->load->vars($data);
          $this->load->view('header');
          $this->load->view('view-post');
          $this->load->view('footer');
        }
        }


The function is simplified here.

It is working great but I want to change it. Actually I would like to change the last section to load view, header and footer, in a way I can send the array $data in the browser as a raw text.

I read a lot about session flashdata, but I don't know if I have to send the array to another controller function or could I write a simple view that will contain the data and display it as a raw.

Bu raw I mean something similar to what github has when you read a code (they have a raw button that render a text from a textarea

Can anyone guide me through this ?

Thanks in advance



Messages In This Thread
Display raw content instead of html - by El Forum - 11-07-2013, 02:35 PM
Display raw content instead of html - by El Forum - 11-07-2013, 04:13 PM
Display raw content instead of html - by El Forum - 11-07-2013, 04:23 PM
Display raw content instead of html - by El Forum - 11-07-2013, 04:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB