Hi,
I am quite a newbe of symfony, and I have begun developing my project
reading the step-by-step jobeet tutorial.
The project environment is the following: Symfony 1.4.1 with Doctine.
I have a problem with Routing, with this particular set of code:
#routing.yml
show-appartamento:
url: /:tipoalloggio/:provincia_slug/:id
class: sfDoctrineRoute
options: { model: Appartamento, type: object }
param: { module: appartamento, action: show }
requirements:
id: \d+
sf_method: [get]
where tipoalloggio and id are DB field (or attributes of class
Appartamento), whereas provincia_slug is a "virtual" attribute, i.e. a
new field built as explained in the tutorial in order to "sluggify"
the field provincia from special characters.
The problem is that if I write in the browser an URL that has a typo
in the fields 'id' or 'tipoalloggio', then symfony returns an error,
whereas if I make a typo in the "virtual" field
'provincia_slug' (defined virtual because it is not an original DB
parameter), symfony does not display any error message and I get the
results as if only 'id' and 'tipoalloggio' where considered.
Example :http://myproject/frontend_dev.php/appartamento/catania/1
Here tipoalloggio --> appartamento
id --> 1
provincia_slug--> catania
are all correct values.
If I write an url like this
http://myproject/frontend_dev.php/appartamento/catania/234
(non existing id)
or
http://myproject/frontend_dev.php/appartammmmento/catania/1
(non existing tipoalloggio)
then I receive an error, but If I write:
http://myproject/frontend_dev.php/appartamento/cataniAAAAAA/1
(non existing provincia_slug), then no error is displayed and symfony
outputs the exact query result only considering the fields id and
tipoalloggio.
I would like to avoid it and I would expect that every field in the
url were parsed by symfony.
Could yuo please help me?
Thank you
Cristian
--
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en.