A
A
Alexfixer2020-02-13 14:57:14
CodeIgniter
Alexfixer, 2020-02-13 14:57:14

Confused with set_flashdata?

Task: After successfully adding a comment, display the message with flash data
Adding comments via the Comment() method
In the Posts controller

Comment() {
<?php $this->session->set_flashdata('message', 'Комментарий успешно добавлен'); ?>
}


in view:
<?php echo $this->session->flashdata('message'); ?> 

  <form action="/posts/comment" method="post">
    
  </form>


why after sending a comment I have an empty, no message?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question