Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> CakePHP, dlaczego nie wyświetla mi widoku?
miedzna
post 9.03.2010, 13:04:56
Post #1





Grupa: Zarejestrowani
Postów: 401
Pomógł: 1
Dołączył: 10.03.2004
Skąd: Warszawa

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


plik modelu: postblog.php
  1. class Postblog extends AppModel {
  2. var $name = "Postblog";
  3. }


plik kontrolera: postsblog_controller.php
  1. class PostsblogController extends AppController {
  2.  
  3. var $name = "Postsblog";
  4.  
  5. function blog() {
  6. $this->set('postsblog',$this->Postblog->findall());
  7. }
  8.  
  9. }


plik widoku: postsblog/blog.ctp
  1. <h1>Posty:</h1>
  2. <?php foreach($posts as $post) { ?>
  3. <h2><?php echo $post['Post']['id'];?>. <?php echo $post['Post']['name'];?></h2>
  4. <p><?php echo $post['Post']['post'];?></p>
  5. <? } ?>


i oczywiście tabela w bazie:
  1. CREATE TABLE postsblog (
  2. id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  3. name VARCHAR(255) DEFAULT '',
  4. post TEXT NOT NULL,
  5. PRIMARY KEY (id)
  6. );


i po wejćiu na adres www.costam.pl/postsblog ciągle dostaje: Error: The requested address '/postsblog' was not found on this server.

Szlak mnie trafia już...
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 Wersja Lo-Fi Aktualny czas: 14.08.2025 - 02:46