Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [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
pedro84
post
Post #2





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


  1. Blog_model>get();
widzisz czego Ci brakuje?


--------------------
Google knows the answer...
Go to the top of the page
+Quote Post
tabbi
post
Post #3





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

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


siedzialem nad tym z 20 minut późnym wieczorem dzisiaj na świeżo też tego nie zauważyłem ehh. dzieki
Go to the top of the page
+Quote Post

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: 19.08.2025 - 09:07