This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » symfony 1.3 and 1.4 » SOLVED - NEWBIE routing question
SOLVED - NEWBIE routing question [message #103015] Fri, 23 July 2010 22:39 Go to next message
chriscowley  is currently offline chriscowley
Messages: 2
Registered: July 2010
Junior Member
Sorry to appear stupid, but this not only my first post, but also my first time using Symfony.

I have a very simple project: frontend with a few modules (home, blog, cv, etc) and a backend (built afterwards using the admin generator).

In the dev environment everything is fine, but in the production environment the routing is not working. It is really simple, I just want it to automatically route / to home/index.

Both frontend_dev.php and backend_dev.php work perfectly, but neither index.php or backend.php work.

apps/frontend/config/routing.yml:
homepage:
  url:   /
  param: { module: home, action: index }

# generic rules
# please, remove them by adding more specific rules
default_index:
  url:   /:module
  param: { action: index }

default:
  url:   /:module/:action/*


apps/backend/config/routing.yml:
tag:
  class: sfDoctrineRouteCollection
  options:
    model:                Tag
    module:               tags
    prefix_path:          /tags
    column:               id
    with_wildcard_routes: true

blog_post:
  class: sfDoctrineRouteCollection
  options:
    model:                BlogPost
    module:               blog
    prefix_path:          /blog
    column:               id
    with_wildcard_routes: true

# You can find more information about this file on the symfony website:
# [url]http://www.symfony-project.org/reference/1_4/en/10-Routing[/url]

# default rules
homepage:
  url:   /
  param: { module: blog, action: index }

# generic rules
# please, remove them by adding more specific rules
default_index:
  url:   /:module
  param: { action: index }

default:
  url:   /:module/:action/*

[Updated on: Sat, 24 July 2010 11:36]

Re: NEWBIE routing question [message #103017 is a reply to message #103015 ] Sat, 24 July 2010 01:35 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Welcome to the forum.

"neither ... work" -- what happens when you try? This is important information - please be detailed.

Incidentally, you'll have noticed that this forum strips preceding spaces from text. If you have formatted text, such as YAML, it is necessary to wrap those blocks in [code] tags. Would you edit your post?


Remember Palestine
Re: NEWBIE routing question - RESOLVED [message #103026 is a reply to message #103017 ] Sat, 24 July 2010 10:00 Go to previous message
chriscowley  is currently offline chriscowley
Messages: 2
Registered: July 2010
Junior Member
I actually fixed it last night myself Very Happy

II just changed:
$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'prod', false);


to
$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'prod', true);


Thanks for pointing out the whitespace issue - bit of an issue with YAML Smile
Previous Topic:Problème d'insertion SQL avec relation sur doctrine
Next Topic:Embed form - how to get id of saved objects.
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software