Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [symfony] ver 1.4.8
Forum PHP.pl > Forum > PHP > Frameworki
czorny1986
Witam serdecznie,

mam problem z panelem administracyjnym. Konkretnie chodzi o to, że wszystko chodzi elegancko jeżeli używam wersji developerskiej. Natomiast jeżeli przełączę się na wersje produkcyjna [backend.php], to bez problemu zaloguję się do panelu, ale już w adresie z backend.php robi się backend_dev.php. Jeżeli zmienię ręcznie znowu na backend.php i wybiore którąś z pozycji menu przełącza mi się do modułu frontendu.

Prosze rzućcie jakąś radą bo siedzę nad tym cały dzień. :/

PS. czyszczę cache

to jest mój plik routingu z backendu
  1. image:
  2. class: sfDoctrineRouteCollection
  3. options:
  4. model: image
  5. module: image
  6. prefix_path: /image
  7. column: id_image
  8. with_wildcard_routes: true
  9.  
  10. reference:
  11. class: sfDoctrineRouteCollection
  12. options:
  13. model: Reference
  14. module: reference
  15. prefix_path: /reference
  16. column: id_reference
  17. with_wildcard_routes: true
  18.  
  19. realization:
  20. class: sfDoctrineRouteCollection
  21. options:
  22. model: Realization
  23. module: realization
  24. prefix_path: /realization
  25. column: id_realizations
  26. with_wildcard_routes: true
  27.  
  28. contact:
  29. class: sfDoctrineRouteCollection
  30. options:
  31. model: Contact
  32. module: contact
  33. prefix_path: /contact
  34. column: idContact
  35. with_wildcard_routes: true
  36.  
  37. company:
  38. class: sfDoctrineRouteCollection
  39. options:
  40. model: company
  41. module: company
  42. prefix_path: /company
  43. column: id_company
  44. with_wildcard_routes: true
  45.  
  46. # You can find more information about this file on the symfony website:
  47. # <a href="http://www.symfony-project.org/reference/1_4/en/10-Routing" target="_blank">http://www.symfony-project.org/reference/1_4/en/10-Routing</a>
  48.  
  49. # default rules
  50. homepage:
  51. url: /
  52. param: { module: administrator, action: index }
  53.  
  54. # generic rules
  55. # please, remove them by adding more specific rules
  56. default_index:
  57. url: /:module
  58. param: { action: index }
  59.  
  60. default:
  61. url: /:module/:action/*
jaro87
Nie masz na sztywno wpisanych linków z backend_dev w tym menu? Używasz link_to?
czorny1986
w menu robie poprzez link_to

to jest wycinek z menu :

  1. <h3><a href="#">Realizacje</a></h3>
  2. <div>
  3. <p></p>
  4. <ul>
  5. <li> <?php echo link_to('Dodaj nowe realizacje', 'realization') ?> </li>
  6. <li> <?php echo link_to('Dodaj nowe zdjęcie do realizacji', 'image') ?> </li>
  7.  
  8. </ul>
  9. </div>
janek9
pokaż .htaccess i ProjectConfiguration.class.php
czorny1986
to jest .htaccess
  1. Options +FollowSymLinks +ExecCGI
  2.  
  3. <IfModule mod_rewrite.c>
  4. RewriteEngine On
  5.  
  6. # uncomment the following line, if you are having trouble
  7. # getting no_script_name to work
  8. #RewriteBase /
  9.  
  10. # we skip all files with .something
  11. #RewriteCond %{REQUEST_URI} \..+$
  12. #RewriteCond %{REQUEST_URI} !\.html$
  13. #RewriteRule .* - [L]
  14.  
  15. # we check if the .html version is here (caching)
  16. RewriteRule ^$ index.html [QSA]
  17. RewriteRule ^([^.]+)$ $1.html [QSA]
  18. RewriteCond %{REQUEST_FILENAME} !-f
  19.  
  20. # no, so we redirect to our front web controller
  21. RewriteRule ^(.*)$ index.php [QSA,L]
  22. </IfModule>



a to projectConfiguration.class
  1. require_once 'C://xampp//xampplite//php//PEAR//symfony/autoload/sfCoreAutoload.class.php';
  2. sfCoreAutoload::register();
  3.  
  4. class ProjectConfiguration extends sfProjectConfiguration
  5. {
  6. public function setup()
  7. {
  8. $this->enablePlugins('sfDoctrinePlugin');
  9. $this->enablePlugins('sfLightboxPlugin');
  10. $this->enablePlugins('mpRealityAdminPlugin');
  11. $this->enablePlugins('sfDoctrineGuardPlugin');
  12. $this->enablePlugins('sfFormExtraPlugin');
  13. $this->enablePlugins('isicsWidgetFormTinyMCEPlugin');
  14. }
  15. }

mlawnik
Czy mam omamy wzrokowe, czy w projectConfiguration.class są podwójne slashe w require_once?
czorny1986
Ok ju chyba wiem...

W htaccess trzeba na samej gorze dodać reguły

RewriteRule "^admin$" "backend.php" [QSA]
RewriteRule "^admin/(.*)$" "backend.php" [QSA]

a następnie w routingu przed każdą regułą dodać /admin

z tego co widzę działa...

Dziekuję Wam za zainteresowanie tematem i nakierowanie z tym htaccess
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.