URL mapping of actions with camelCase names

2009-05-29 Thread smeenai

Hey all, just getting started with CakePHP and came across a small
problem. I have a controller with a function named byName. I'm quoting
http://book.cakephp.org/view/46/Routes-Configuration:

/products/view_clearance maps to the viewClearance() action of the
ProductsController

However, when I try to access this action using by_name in the URL, I
get an action not found error message. If I use byName in the URL it
works perfectly. I did a search and
http://groups.google.com/group/cake-php/browse_thread/thread/e19f277a27dcef71/2d2bf4f18f9a671b?lnk=gstq=urls+actions+underscores#2d2bf4f18f9a671b
has a similar issue as far as I can tell. In that thread, Pablo Viojo
also states in his second post that this is supposed to be the
standard behaviour, so it might be some sort of bug. I'm using Cake
1.2.3.8166, downloaded from Sourceforge.

Cheers.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: URL mapping of actions with camelCase names

2009-05-29 Thread Pablo Viojo
Can you post the URL that allow to access and the URL that throws an error?
(becuse I get lost! :) )
Saludos,

Pablo Viojo
pvi...@gmail.com
http://pviojo.net
(#260 y creciendo!)


Ayudar nos hace felices!
http://needish.com  - http://helperman.org



On Fri, May 29, 2009 at 3:42 PM, smeenai shoaib.mee...@gmail.com wrote:


 Hey all, just getting started with CakePHP and came across a small
 problem. I have a controller with a function named byName. I'm quoting
 http://book.cakephp.org/view/46/Routes-Configuration:

 /products/view_clearance maps to the viewClearance() action of the
 ProductsController

 However, when I try to access this action using by_name in the URL, I
 get an action not found error message. If I use byName in the URL it
 works perfectly. I did a search and

 http://groups.google.com/group/cake-php/browse_thread/thread/e19f277a27dcef71/2d2bf4f18f9a671b?lnk=gstq=urls+actions+underscores#2d2bf4f18f9a671b
 has a similar issue as far as I can tell. In that thread, Pablo Viojo
 also states in his second post that this is supposed to be the
 standard behaviour, so it might be some sort of bug. I'm using Cake
 1.2.3.8166, downloaded from Sourceforge.

 Cheers.

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: URL mapping of actions with camelCase names

2009-05-29 Thread Pablo Viojo
I defined this on my controller (TestingController):
function by_name(){
   echo by_name;
die();
}
function byName(){
echo byName;
die();
}

And the results are:

 /testing/by_name  -- by_name
 /testing/byName  -- byName

If I set the following route


Router::connect('/testing/by_name/*', array(
'controller' = testing,
'action' = byName,
));

the results are:

 /testing/by_name  -- byName
 /testing/byName  -- byName

Both urls are mapped to TestingController:byName
and  TestingController:by_name is no longer needed (I removed it to test
this case)

Saludos,

Pablo Viojo
pvi...@gmail.com
http://pviojo.net
(#260 y creciendo!)


Ayudar nos hace felices!
http://needish.com  - http://helperman.org



On Fri, May 29, 2009 at 5:21 PM, Pablo Viojo pvi...@gmail.com wrote:

 Can you post the URL that allow to access and the URL that throws an error?
 (becuse I get lost! :) )
 Saludos,

 Pablo Viojo
 pvi...@gmail.com
 http://pviojo.net
 (#260 y creciendo!)

 
 Ayudar nos hace felices!
 http://needish.com  - http://helperman.org




 On Fri, May 29, 2009 at 3:42 PM, smeenai shoaib.mee...@gmail.com wrote:


 Hey all, just getting started with CakePHP and came across a small
 problem. I have a controller with a function named byName. I'm quoting
 http://book.cakephp.org/view/46/Routes-Configuration:

 /products/view_clearance maps to the viewClearance() action of the
 ProductsController

 However, when I try to access this action using by_name in the URL, I
 get an action not found error message. If I use byName in the URL it
 works perfectly. I did a search and

 http://groups.google.com/group/cake-php/browse_thread/thread/e19f277a27dcef71/2d2bf4f18f9a671b?lnk=gstq=urls+actions+underscores#2d2bf4f18f9a671b
 has a similar issue as far as I can tell. In that thread, Pablo Viojo
 also states in his second post that this is supposed to be the
 standard behaviour, so it might be some sort of bug. I'm using Cake
 1.2.3.8166, downloaded from Sourceforge.

 Cheers.

 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: URL-mapping

2009-04-01 Thread Jeroen van Ingen

I created a junction (like symbolic links in Linux) with 'junction
link magic'. Now it works...

On 29 mrt, 16:23, Dr. Loboto drlob...@gmail.com wrote:
 Sorry, misunderstood your situation. I think you cannot do anything in
 this case at all. Cake retrieve base url as dirname(env('PHP_SELF'))
 and dir is always site1 not regarding to apache alias. Check
 Dispatcher::baseUrl() method.

 On Mar 28, 8:18 am, Jeroen van Ingen neob...@gmail.com wrote:

  I tried but I can't get it to work
  I added the following lines to the httpd.conf file:
  RewriteEngine On
  RewriteRule ^/site2(.*) /site1$1
  This works fine, but doesn't solve my problem. It still generates
  links likehttp://localhost/site1insteadof links likehttp://localhost/site2

  If I add the following lines to httpd.conf the server will not start
  RewriteEngine On
  RewriteBase /site2
  RewriteRule ^/site2(.*) /site1$1

  If I add the following line to .htaccess, it even won't work:
  RewriteBase /site1

  What am I doing wrong?

  On 27 mrt, 03:50, Dr. Loboto drlob...@gmail.com wrote:

   You should add RewriteBase /site2 directive into your
   webroot .htaccess for site2.

   On Mar 26, 11:18 pm, Jeroen neob...@gmail.com wrote:

My Windows-PC has one http-dir called C:/xampp/htdocs/site1 and I
configured Apache to map site2 to the same location (C:/xampp/htdocs/
site1).
At the moment I configured apache as follows:
AliasMatch ^/site2(.*) C:/xampp/htdocs/site$1

When I go tohttp://localhost/site2/controller/action Apache maps
it to site1 and the URL in the browser the URL is 
stillhttp://localhost/site2/controller/action. So far, so good.
The problem is on every page the links generated are as 
follows:http://localhost/site1/controller/action and I want links 
likehttp://localhost/site2/controller/action.

Is it possible to let Apache generate 
linkshttp://localhost/site2/controller/action
on every page? If so, how?
If Apache can't generate links 
likehttp://localhost/site2/controller/action,
how can I let Cake generate links 
likehttp://localhost/site2/controller/action
when I'm 'incoming' from site2 instead of site1?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: URL-mapping

2009-03-29 Thread Dr. Loboto

Sorry, misunderstood your situation. I think you cannot do anything in
this case at all. Cake retrieve base url as dirname(env('PHP_SELF'))
and dir is always site1 not regarding to apache alias. Check
Dispatcher::baseUrl() method.

On Mar 28, 8:18 am, Jeroen van Ingen neob...@gmail.com wrote:
 I tried but I can't get it to work
 I added the following lines to the httpd.conf file:
 RewriteEngine On
 RewriteRule ^/site2(.*) /site1$1
 This works fine, but doesn't solve my problem. It still generates
 links likehttp://localhost/site1instead of links likehttp://localhost/site2

 If I add the following lines to httpd.conf the server will not start
 RewriteEngine On
 RewriteBase /site2
 RewriteRule ^/site2(.*) /site1$1

 If I add the following line to .htaccess, it even won't work:
 RewriteBase /site1

 What am I doing wrong?

 On 27 mrt, 03:50, Dr. Loboto drlob...@gmail.com wrote:

  You should add RewriteBase /site2 directive into your
  webroot .htaccess for site2.

  On Mar 26, 11:18 pm, Jeroen neob...@gmail.com wrote:

   My Windows-PC has one http-dir called C:/xampp/htdocs/site1 and I
   configured Apache to map site2 to the same location (C:/xampp/htdocs/
   site1).
   At the moment I configured apache as follows:
   AliasMatch ^/site2(.*) C:/xampp/htdocs/site$1

   When I go tohttp://localhost/site2/controller/action Apache maps
   it to site1 and the URL in the browser the URL is 
   stillhttp://localhost/site2/controller/action. So far, so good.
   The problem is on every page the links generated are as 
   follows:http://localhost/site1/controller/action and I want links 
   likehttp://localhost/site2/controller/action.

   Is it possible to let Apache generate 
   linkshttp://localhost/site2/controller/action
   on every page? If so, how?
   If Apache can't generate links 
   likehttp://localhost/site2/controller/action,
   how can I let Cake generate links 
   likehttp://localhost/site2/controller/action
   when I'm 'incoming' from site2 instead of site1?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: URL-mapping

2009-03-27 Thread Jeroen van Ingen

I tried but I can't get it to work
I added the following lines to the httpd.conf file:
RewriteEngine On
RewriteRule ^/site2(.*) /site1$1
This works fine, but doesn't solve my problem. It still generates
links like http://localhost/site1 instead of links like http://localhost/site2

If I add the following lines to httpd.conf the server will not start
RewriteEngine On
RewriteBase /site2
RewriteRule ^/site2(.*) /site1$1

If I add the following line to .htaccess, it even won't work:
RewriteBase /site1

What am I doing wrong?

On 27 mrt, 03:50, Dr. Loboto drlob...@gmail.com wrote:
 You should add RewriteBase /site2 directive into your
 webroot .htaccess for site2.

 On Mar 26, 11:18 pm, Jeroen neob...@gmail.com wrote:

  My Windows-PC has one http-dir called C:/xampp/htdocs/site1 and I
  configured Apache to map site2 to the same location (C:/xampp/htdocs/
  site1).
  At the moment I configured apache as follows:
  AliasMatch ^/site2(.*) C:/xampp/htdocs/site$1

  When I go tohttp://localhost/site2/controller/action Apache maps
  it to site1 and the URL in the browser the URL is 
  stillhttp://localhost/site2/controller/action. So far, so good.
  The problem is on every page the links generated are as 
  follows:http://localhost/site1/controller/action and I want links 
  likehttp://localhost/site2/controller/action.

  Is it possible to let Apache generate 
  linkshttp://localhost/site2/controller/action
  on every page? If so, how?
  If Apache can't generate links 
  likehttp://localhost/site2/controller/action,
  how can I let Cake generate links 
  likehttp://localhost/site2/controller/action
  when I'm 'incoming' from site2 instead of site1?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



URL-mapping

2009-03-26 Thread Jeroen

My Windows-PC has one http-dir called C:/xampp/htdocs/site1 and I
configured Apache to map site2 to the same location (C:/xampp/htdocs/
site1).
At the moment I configured apache as follows:
AliasMatch ^/site2(.*) C:/xampp/htdocs/site$1

When I go to http://localhost/site2/controller/action Apache maps
it to site1 and the URL in the browser the URL is still
http://localhost/site2/controller/action. So far, so good.
The problem is on every page the links generated are as follows:
http://localhost/site1/controller/action and I want links like
http://localhost/site2/controller/action.

Is it possible to let Apache generate links 
http://localhost/site2/controller/action
on every page? If so, how?
If Apache can't generate links like 
http://localhost/site2/controller/action,
how can I let Cake generate links like 
http://localhost/site2/controller/action
when I'm 'incoming' from site2 instead of site1?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: URL-mapping

2009-03-26 Thread Dr. Loboto

You should add RewriteBase /site2 directive into your
webroot .htaccess for site2.

On Mar 26, 11:18 pm, Jeroen neob...@gmail.com wrote:
 My Windows-PC has one http-dir called C:/xampp/htdocs/site1 and I
 configured Apache to map site2 to the same location (C:/xampp/htdocs/
 site1).
 At the moment I configured apache as follows:
 AliasMatch ^/site2(.*) C:/xampp/htdocs/site$1

 When I go tohttp://localhost/site2/controller/action Apache maps
 it to site1 and the URL in the browser the URL is 
 stillhttp://localhost/site2/controller/action. So far, so good.
 The problem is on every page the links generated are as 
 follows:http://localhost/site1/controller/action and I want links 
 likehttp://localhost/site2/controller/action.

 Is it possible to let Apache generate 
 linkshttp://localhost/site2/controller/action
 on every page? If so, how?
 If Apache can't generate links 
 likehttp://localhost/site2/controller/action,
 how can I let Cake generate links 
 likehttp://localhost/site2/controller/action
 when I'm 'incoming' from site2 instead of site1?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: URL mapping?

2008-03-04 Thread Dardo Sordi Bogado

Also, have a look at Admin.routing in app/config/core.php , you can
find more here: http://book.cakephp.org

On Mon, Mar 3, 2008 at 11:45 PM, Adam Royle [EMAIL PROTECTED] wrote:

  You can do that, but then you need to work around the multiple
  controllers issue. I don't bother these days since I've just gotten
  used to the url structure. Maybe you're placing too much important on
  the url (especially for an admin section).

  eg i have this:

  /admin - routed to /admin/users/dashboard

  /admin/users/
  /admin/users/dashboard
  /admin/users/login
  /admin/users/add

  /admin/images/
  /admin/images/add

  /admin/events/
  /admin/events/add

  etc

  I only worry about pretty urls for my frontend, but I try not to stray
  away from the default structure. I suggest you develop everything the
  standard way, then once your app is finished use routes, etc, to
  customise the urls. You might find you won't worry about it after all.

  Hope that helps.

  Cheers,
  Adam



  On Mar 4, 6:49 am, Jason [EMAIL PROTECTED] wrote:
   I am pretty new to cakephp.
  
   Currently I have the following URL.
  
   http://localhost/cake/PageControl/add/
  
   How would I change this url to..
  
   http://localhost/cake/admin/add/
  
   while still using the PageControl. The reason for this is logically it
   makes a lot more sense.
  
   My second question.. is it possible map several controllers to a
   single URL?
  
   For example above the controller is page_controller. Would it be
   possible to map category_controller to the same 'admin' URL assuming
   that the functions were different.
  
   As I said above I am new, I hope this makes sense and I hope I will be
   enlightened.
  
   Jason
  


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



URL mapping?

2008-03-03 Thread Jason

I am pretty new to cakephp.

Currently I have the following URL.

http://localhost/cake/PageControl/add/

How would I change this url to..

http://localhost/cake/admin/add/

while still using the PageControl. The reason for this is logically it
makes a lot more sense.




My second question.. is it possible map several controllers to a
single URL?

For example above the controller is page_controller. Would it be
possible to map category_controller to the same 'admin' URL assuming
that the functions were different.

As I said above I am new, I hope this makes sense and I hope I will be
enlightened.

Jason
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: URL mapping?

2008-03-03 Thread Adam Royle

You can do that, but then you need to work around the multiple
controllers issue. I don't bother these days since I've just gotten
used to the url structure. Maybe you're placing too much important on
the url (especially for an admin section).

eg i have this:

/admin - routed to /admin/users/dashboard

/admin/users/
/admin/users/dashboard
/admin/users/login
/admin/users/add

/admin/images/
/admin/images/add

/admin/events/
/admin/events/add

etc

I only worry about pretty urls for my frontend, but I try not to stray
away from the default structure. I suggest you develop everything the
standard way, then once your app is finished use routes, etc, to
customise the urls. You might find you won't worry about it after all.

Hope that helps.

Cheers,
Adam

On Mar 4, 6:49 am, Jason [EMAIL PROTECTED] wrote:
 I am pretty new to cakephp.

 Currently I have the following URL.

 http://localhost/cake/PageControl/add/

 How would I change this url to..

 http://localhost/cake/admin/add/

 while still using the PageControl. The reason for this is logically it
 makes a lot more sense.

 My second question.. is it possible map several controllers to a
 single URL?

 For example above the controller is page_controller. Would it be
 possible to map category_controller to the same 'admin' URL assuming
 that the functions were different.

 As I said above I am new, I hope this makes sense and I hope I will be
 enlightened.

 Jason
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---