Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [CodeIgniter]problem z modelem
tabbi
post
Post #1





Grupa: Zarejestrowani
Postów: 150
Pomógł: 3
Dołączył: 30.10.2010

Ostrzeżenie: (0%)
-----


Witam,

mam Model blog_model.php:
  1. class Blog_model extends CI_Model {
  2.  
  3. var $title = '';
  4. var $content = '';
  5. var $date = '';
  6.  
  7. function __construct()
  8. {
  9. // Call the Model constructor
  10. parent::__construct();
  11. }
  12.  
  13.  
  14. function get()
  15. {
  16.  
  17. $query = $this->db->query('SELECT(*) FROM demo_files');
  18. return $query;
  19. }
  20.  
  21.  
  22. }


w kontrolerze blog.php proboje odpalić cos z modelu ale wyskakuje blad:

Call to undefined function get() in C:\xampp\htdocs\framework\application\controllers\blog.php

blog.php:
  1. class Blog extends CI_Controller {
  2.  
  3. var $data;
  4.  
  5. public function __construct()
  6. {
  7. parent::__construct();
  8. // Your own constructor code
  9. $this->load->model('Blog_model');
  10. $this->data = $this->Blog_model>get();
  11. }
  12. public function index()
  13. {
  14. $data = $this->data;
  15. $this->load->view('blog',$data);
  16.  
  17. }
  18. }


Co jest nie tak questionmark.gif

Codeigniter wersja 2.0

Ten post edytował tabbi 7.04.2011, 18:41:16
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 00:08