Multiword Controller Name

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiword Controller Name

Teriaki

I'm fairly new to CakePHP, but I can't seem to get around this problem.
I have created about a dozen models and controllers, but all
controllers with multiword names fail.

For example:
AvailabilityState in /app/models/availability_state.php
AvailabilityStatesController in
/app/components/availability_states_controller.php
Default view at /app/views/availability_states/index.thtml
With the table {$prefix}availability_states.
Accessed via http://www.example.com/availability_states/

I have read other suggestions about fixing this in PHP 4, but I don't
think that they apply to me.
I am running PHP 5.1.2, CakePHP 1.1.8.3544, on Linux, Apache/1.3.34. I
have tried it with and without the $name or $uses variables. I have not
touched the routing settings. The model, controller, and view, contain
only the bare minimum amount of code that should work (that would work
in a single-word-name version). I have read about a possible
mod_rewrite problem, but I do not have access to the .conf files.

Is there something I'm missing here??


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Multiword Controller Name

John David Anderson (_psychic_)


On Nov 2, 2006, at 4:09 PM, Teriaki wrote:

>
> I'm fairly new to CakePHP, but I can't seem to get around this  
> problem.
> I have created about a dozen models and controllers, but all
> controllers with multiword names fail.

How? What's the error message look like?

-- John

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Multiword Controller Name

Jon Bennett
In reply to this post by Teriaki

> I'm fairly new to CakePHP, but I can't seem to get around this problem.
> I have created about a dozen models and controllers, but all
> controllers with multiword names fail.
>
> For example:
> AvailabilityState in /app/models/availability_state.php
> AvailabilityStatesController in
> /app/components/availability_states_controller.php
> Default view at /app/views/availability_states/index.thtml
> With the table {$prefix}availability_states.
> Accessed via http://www.example.com/availability_states/

you should have availability_states_controller.php inside
/app/controllers/ not /app/componets like you've stated above

j

--


jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Multiword Controller Name

Teriaki

You're right, it is under app/controllers/ -- my mistake.

Also there doesn't appear to be an error message. For example, if on
any other controller, I try to open an invalid view, it responds with a
correctly formatted 404 error. On this one, however, regardless of what
appears after availability_states/ the pagestops rendering just before
any view content would appear, and the remainder of the layout is cut
off. I did notice, however, that when the view is valid, the title of
the layout is, correctly, 'Availability States, and otherwise '404 Not
Found'

Not being too familiar with CakePHP, I'm not if there are any tricks to
retrieve the error if none is displayed.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Multiword Controller Name

Teriaki

Sorry guys, I just figured it out! It was actually caused by an element
incorrectly trying to load a controller. This wasn't a problem in my
other controllers since they were associated (by 1 or 2 levels of
recursion). But because I had specifically removed all associations to
test the new controllers, the newer set of controllers just didn't
work. It was just a coincidence that all of the new models had long
names.

I got rid of the element (will fix it later) and problem solved.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---