Welcome Guest, Not a member yet? Register   Sign In
Can't call the right action
#9

[eluser]Plume[/eluser]
Sorry but I understood in reading doc that using subfolder to organize Controllers its like :
A folder = Controller
A file in this folder = Action
So mail/read

Yes, I saw that mail/read/index/2 works but usually I just have to do e.g : mail/view ( for viewing list ) :
Code:
<?php
class View extends Controller{

  private $tableUsers = 'users';
  private $tablePlayers = 'players';
  private $tableMail = 'mail';

  private $userSess = array();
  private $playerSess = array();

  public function __construct(){

    parent::Controller();
    if(!$this->session->userdata('logged_in')){

      redirect('home/home');
    }

    $this->userSess = $this->session->userdata('user');
    $this->playerSess = $this->session->userdata('player');
    $this->lang->load('mail', $this->userSess['localisation']);
  }

  public function index(){

    $this->load->database();

    $selectMail = 'SELECT '.$this->tableMail.'.id AS mail_id, subject, date_send, is_read, name, firstname ' .
        'FROM '.$this->tableMail.' ' .
          'JOIN '.$this->tablePlayers.' ' .
          'ON from_id = '.$this->tablePlayers.'.id ' .
        'WHERE to_id = '.$this->playerSess['id'].';';
    $selectMailStmt = $this->db->query($selectMail);
    $this->selectMailArray = $selectMailStmt->result_array();

    $this->layout->view('mail/view');
  }
}

Am I so wrong ? :/


Messages In This Thread
Can't call the right action - by El Forum - 10-11-2008, 11:48 AM
Can't call the right action - by El Forum - 10-11-2008, 12:01 PM
Can't call the right action - by El Forum - 10-11-2008, 01:12 PM
Can't call the right action - by El Forum - 10-11-2008, 01:55 PM
Can't call the right action - by El Forum - 10-11-2008, 02:11 PM
Can't call the right action - by El Forum - 10-11-2008, 02:43 PM
Can't call the right action - by El Forum - 10-11-2008, 02:56 PM
Can't call the right action - by El Forum - 10-11-2008, 03:09 PM
Can't call the right action - by El Forum - 10-11-2008, 03:14 PM
Can't call the right action - by El Forum - 10-11-2008, 03:47 PM
Can't call the right action - by El Forum - 10-11-2008, 04:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB