HMVC et Flashdata, Librairie Layout |
[eluser]Unknown[/eluser]
Hi everyone, This is a moment that I use codeigniter, however I have a problem I can not solve In the first time, I use HMVC (https://bitbucket.org/wiredesignz/codeig...sions-hmvc) and from the configuration of this one, it is impossible to use flashdata In my controller I set out my flashdata like this Code: $this->session->set_flashdata('error', 'Mon message'); In my view Code: <?php echo $this->session->flashdata('error'); ?> Well on my controller after the set_flashdata redirects to another method which it displays my view supposed to display my flashdata I have the session library is autoload so no worries on that side of the Do you have an idea of the problem? In the second time, I use to manage my layout library Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); In a librairy that I am creating, I have a send_email method (no need to describe the function lol) Code: private function send_email($email, $data) Except that it is impossible for me to use a layout in sending email. The library is autoload, it works perfectly in a controller and if I use Code: $this->CI->email->message($this->CI->load->view('auth/email_activation', $data, true)); It works perfectly. An idea of the potential problem? Thank you in advance Ps: sorry for my english is bad, I'm French Regards
[eluser]TheFuzzy0ne[/eluser]
Welcome to the CodeIgniter forums! With regards to your flashdata problem: Are you using database sessions? If so, do you have a hook that only saves session data at the end of controller execution? Enabling the [url="http://ellislab.com/codeigniter/user-guide/general/profiling.html"]profiler[/url] may help you see what's going on. With regards to your template problem, it looks like $this->CI->layout->view() is not returning any data. Something like this might work: Code: // Start buffering the output. Hope this helps. |
Welcome Guest, Not a member yet? Register Sign In |