0

I am new in codeigniter, I want to send link with data flash message in codeiniter how can I send the link? this is my session message.

     $this->session->set_flashdata('message', '<div id="message" class="alert alert-error">Your account is not active yet. Please activate your account.</div>');

I want to send link like that

  <a href="<?php site_url().'/home/link';?></a>

how can I send, please help me to to this thanks in advance

4

1 回答 1

2

In the controller create a link and assign it in a variable like this

function index(){
    $link = site_url('home/link');
    //Now assign this variable in flash and redirect
    $this->session->set_flashdata('message', '<div id="message" class="alert alert-   error">Your account is not active yet. Please activate your account.</div>');    
    $this->session->set_flashdata('link', $link);    
    redirect('othercontroller/method');
}
于 2013-04-30T07:36:11.713 回答