Witam,
dzisiaj zacząłem się kształcić w strone frameworka CI i mam następujący problem:
  1. <?php
  2.  
  3. class Welcome extends Controller {
  4. public $url, $ok;
  5.  
  6. function __construct() {
  7. parent::Controller();
  8. $this -> url = $_POST['url'];
  9. $this -> ok = $_POST['ok'];
  10.  
  11. $this -> ur;
  12.  
  13. $this->tab = array();
  14. } // construct end
  15.  
  16. function index() {
  17. $this -> load -> model( 'cuturl');
  18.  
  19. if($this -> ok) {
  20. if($this -> cuturl -> checkUrl($this -> url) == true) {
  21. $this -> cuturl -> add( $this -> url);
  22.  
  23. $query = $this -> cuturl -> down();
  24. $this -> ur = $query->result();
  25.  
  26. echo $this -> ur['id'];
  27. $tab = array(
  28. 'bg' => rand(1,3),
  29. 'display' => 'block',
  30. 'urlid' => $this -> ur['id'],
  31. 'url_url' => $this -> ur['url']
  32. ); // array with data
  33.  
  34. } else {
  35. echo '<script>alert(\'Link jest niepoprawny!\');</script>';
  36. }
  37. }
  38. $this->tab[] = $this->response['content'] = $content;
  39. $this->tab[] = $tab;
  40. $this->load->view('index', $tab);
  41.  
  42. }
  43. }
  44.  
  45. /* End of file welcome.php */
  46. /* Location: ./system/application/controllers/welcome.php */

oto mój kontroler
  1. $query = $this -> cuturl -> down();
  2. $this -> ur = $query->result();

w tym miejscu mam rekordy z bazy. gdy wezmę print_r pokazuje mi zawartość tablicy, a gdy zapisuje jedną wartość do innej tablicy ($tab) to w pliku szablonu nie chce mi zwrócić rekoru. To nie wina tablicy, bo inne dane tablica zwraca.