Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony] jak zrobić profil użytkownika ?
nieraczek
post
Post #1





Grupa: Zarejestrowani
Postów: 405
Pomógł: 6
Dołączył: 12.01.2007

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


Mam zainstalowany sfGuardPlugin, staram się zrobić profil użytkownika - korzystałem w tym celu z tej strony: ttp://www.symfony-project.org/plugins/sfGuardPlugin zakładka Readme.
Próbuję zrobić profil po stronie aplikacji frontend. Utworzyłem tabelę sf_guard_user_profile w bazie danych z kolumnami:
id PK
user_id FK - połączenie z kolumna 'id' tabeli 'sf_guard_user'
imie

Potem wygenerowałem plik schema.yml
  1. <?php
  2. php symfony doctrine:build-schema
  3. ?>
- tabela z profilem wygląda w pliku schema.yml w ten sposób:
  1. SfGuardUserProfile:
  2.  tableName: sf_guard_user_profile
  3.  columns:
  4.    id:
  5.      type: integer(4)
  6.      primary: true
  7.      autoincrement: true
  8.    user_id:
  9.      type: integer(4)
  10.      default: ''
  11.      notnull: true
  12.    imie:
  13.      type: string(200)
  14.      default: ''
  15.      notnull: true
  16.  relations:
  17.    SfGuardUser:
  18.      local: user_id
  19.      foreign: id
  20.      type: one


Oraz polecenia:
php symfony doctrine:build-model
php symfony doctrine:build-forms
php symfony cc

W module, którego strony są widoczne po zalogowaniu dałem w action.class.php w metodzie executeTajne:
  1. <?php
  2. $this->name = $this->getUser()->getGuardUser()->getProfile()->getImie();
  3. ?>


W tajnejneSuccess.php:
  1. <?php
  2. echo "$name";
  3. ?>


Potem jeszcze polecenie:
php symfony cc


I jak po zalogowaniu wejdę na stronę 'tajne' to widzę stronę:

Oops! An Error Occurred
The server returned a "500 Internal Server Error".


Otwarcie tej samej strony jako developer daje informację: Unknown method sfGuardUser::getProfile - dlaczego ?

Ten post edytował nieraczek 2.03.2009, 16:05:54
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: 19.08.2025 - 13:21