Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [CakePHP]problem z komponentem
Luzak
post
Post #1





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 18.05.2006

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


Mam problem z tworzeniem komponentu , a dokladnie ma być to menu , które bedzie pobierać z mysql informacje na temat kategorii i je wyswietlać.


app\controllers\components:
  1. <?php
  2. class MenuComponent extends Object {
  3. var $controller = true;
  4.  
  5. /**
  6.  * Startup method
  7.  * Called automatically, used to set the variable to define the menu.
  8.  * Could equally be used to define a context menu, based upon the controller nam
    e and action.
  9.  *
  10.  * @return null
  11.  */
  12. function startup(&$controller)
  13. {
  14. $this->controller = &$controller;
  15. $this->controller->set('MenuItems',$this->controller->Category->findAll());
  16. }
  17.  
  18. /**
  19.  * Check groups
  20.  * Perform any logic desired to delete groups.
  21.  * In this code, if a group is defined which is not a link and has no children i
    t is removed 
  22.  *
  23.  * @param array $menu
  24.  * @return array
  25.  */
  26.  
  27. }
  28. ?>


oraz stworzyłem model do obslugi kategorii
app\models:
  1. <?php
  2.  
  3. class Category extends AppModel
  4. {
  5. var $name = 'Category';
  6. }
  7.  
  8. ?>


Problem polega na tym , że nie wiem jak dostać się do tego modelu od strony komponentu questionmark.gif
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: 22.08.2025 - 10:04