cakephp 3.0 same controller name for admin and users

2015-05-29 Thread Thomas


I am using cakephp 3.0 and want to write some admin actions and some users 
actions in users controller. admin actions should be accessible from admin 
routing and user actions should be accessible without admin routing

I know in cakephp 3.0 for admin, users controller should be in

src/Controller/Admin/UsersController.php

and for normal users, users controller should be in

src/Controller/UsersController.php

Now the confusion is, Is this correct to put same controller name is in 2 
different directories or am I missing something?

This question is also asked on stackoverflow by me

http://stackoverflow.com/questions/30536972/cakephp-3-0-same-controller-name-for-admin-and-users

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Get controller name on layout file - CakePHP3

2014-08-28 Thread Jipson Thomas
Thank you very much. I got it working using the following command
$this->request->params['controller']

Regards,
Jipson

On Thursday, 28 August 2014 13:42:54 UTC+1, Thomas von Hassel wrote:
>
> you have to look in `$this->request` instead
>
>
> On 28 Aug 2014, at 14:35, Jipson Thomas  > wrote:
>
> Hi,
> In my Cakephp 3 project on the layout file, I want to set menu classes 
> based on the current controller name. After a search I tried to get it 
> through the following command on my layout.ctp file
> params['controller']; ?>
>
> But it throughs me an error as following
> *Error: * *paramsHelper* could not be found. 
> *Error: * Create the class *paramsHelper* below in file: 
> src/View/Helper/paramsHelper.php
>
> Does anyone know any fix for this?
>
> Regards,
> Jipson
>
>
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+u...@googlegroups.com .
> To post to this group, send email to cake...@googlegroups.com 
> .
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: How to get controller name from an element view?

2014-08-28 Thread Jipson Thomas
Thank you. I got it working by the following command.
$this->request->params['controller']
Thanks,
Jipson

On Friday, 8 February 2008 19:30:35 UTC, Guill3rmo wrote:
>
> Hi im newbie and my English still sucks, but i want to know get the 
> controller name since an element view. Thanks. 
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Get controller name on layout file - CakePHP3

2014-08-28 Thread Thomas von Hassel
you have to look in `$this->request` instead


On 28 Aug 2014, at 14:35, Jipson Thomas  wrote:

> Hi,
> In my Cakephp 3 project on the layout file, I want to set menu classes based 
> on the current controller name. After a search I tried to get it through the 
> following command on my layout.ctp file
> params['controller']; ?>
> 
> But it throughs me an error as following
> Error: paramsHelper could not be found.   
> Error: Create the class paramsHelper below in file: 
> src/View/Helper/paramsHelper.php
> 
> Does anyone know any fix for this?
> 
> Regards,
> Jipson
> 
> 
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: How to get controller name from an element view?

2014-08-28 Thread Stephen S
I don't think you can use the request object from within an element, but
here's the documentation on it.
http://book.cakephp.org/3.0/en/controllers/request-response.html#request-parameters

If you can't access it from the element you can save it as a variable in
your AppController, though this isn't ideal I understand. Hopefully
somebody else can chip in and provide a better method


On 28 August 2014 13:32, Jipson Thomas  wrote:

> Hi ,
> I tried this solution to get controller name on my layout file, but I am
> getting an error on CakePHP3 as follows,
> *Error: * *paramsHelper* could not be found.
> IS there anyone know a proper solution for this?
>
> Regards,
> Jipson
>
> On Friday, 8 February 2008 19:30:35 UTC, Guill3rmo wrote:
>>
>> Hi im newbie and my English still sucks, but i want to know get the
>> controller name since an element view. Thanks.
>>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Kind Regards
 Stephen Speakman

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Get controller name on layout file - CakePHP3

2014-08-28 Thread Jipson Thomas
Hi,
In my Cakephp 3 project on the layout file, I want to set menu classes 
based on the current controller name. After a search I tried to get it 
through the following command on my layout.ctp file
params['controller']; ?>

But it throughs me an error as following
*Error: * *paramsHelper* could not be found. 
*Error: * Create the class *paramsHelper* below in file: 
src/View/Helper/paramsHelper.php

Does anyone know any fix for this?

Regards,
Jipson

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: How to get controller name from an element view?

2014-08-28 Thread Jipson Thomas
Hi ,
I tried this solution to get controller name on my layout file, but I am 
getting an error on CakePHP3 as follows,
*Error: * *paramsHelper* could not be found. 
IS there anyone know a proper solution for this?

Regards,
Jipson

On Friday, 8 February 2008 19:30:35 UTC, Guill3rmo wrote:
>
> Hi im newbie and my English still sucks, but i want to know get the 
> controller name since an element view. Thanks. 
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: How to omit controller name in pagination links?

2012-05-22 Thread rahajiyev
This line does it, put in template:

$this->Paginator->options(array('url' => array('controller' => null)))


Now all page links are generated without the controller name.

Not sure if it's clean to be put it there and not in the controller,
but I couldn't find out how to do that.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


How to omit controller name in pagination links?

2012-05-22 Thread rahajiyev
I have URL /operations configured to 'controller' => 'milli'
But Cake builds pagination links such as /milli/operations/page:2
How can I tell it not to include the controller name milli so it's /
operations/page:2 ?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: how to get url by giving the controller name, action name and parameters?

2011-12-03 Thread Todong
Thanks, it works!

On Dec 3, 9:53 pm, euromark  wrote:
> you probably want to use Router::url()
>
> On 3 Dez., 14:22, Todong  wrote:
>
>
>
>
>
>
>
> > Hi, everyone!
>
> > I know HtmlHelper::link() can generate a link whose url is generated
> > by an array containing controller, action and parameters
> > e.g.
> > HtmlHelper::link('book', array('controller'=>'books',
> > 'action'=>'view', 4)) will output:
> > book
>
> > Now I wanna get the only the url by giving the controller,action and
> > parameters.
> > getUrl(array('controller'=>'books', 'action'=>'view', 4))  -->  ".../
> > books/view/4"
> > Is such API existed?
>
> > Any suggestion is appreciated.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: how to get url by giving the controller name, action name and parameters?

2011-12-03 Thread euromark
you probably want to use Router::url()


On 3 Dez., 14:22, Todong  wrote:
> Hi, everyone!
>
> I know HtmlHelper::link() can generate a link whose url is generated
> by an array containing controller, action and parameters
> e.g.
> HtmlHelper::link('book', array('controller'=>'books',
> 'action'=>'view', 4)) will output:
> book
>
> Now I wanna get the only the url by giving the controller,action and
> parameters.
> getUrl(array('controller'=>'books', 'action'=>'view', 4))  -->  ".../
> books/view/4"
> Is such API existed?
>
> Any suggestion is appreciated.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


how to get url by giving the controller name, action name and parameters?

2011-12-03 Thread Todong
Hi, everyone!

I know HtmlHelper::link() can generate a link whose url is generated
by an array containing controller, action and parameters
e.g.
HtmlHelper::link('book', array('controller'=>'books',
'action'=>'view', 4)) will output:
book

Now I wanna get the only the url by giving the controller,action and
parameters.
getUrl(array('controller'=>'books', 'action'=>'view', 4))  -->  ".../
books/view/4"
Is such API existed?

Any suggestion is appreciated.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Singular controller name route

2011-11-18 Thread jeremyharris
why not

Router::connect('/:controller', array('action' => 'view'));

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Singular controller name route

2011-11-15 Thread Sam Sherlock
Perhaps using a custom class to collect data from the app.

It could not rerun data unless it has a view action

- S
On 15 Nov 2011 18:43, "martinp"  wrote:

> Thanks for the reply Jeremy, but what I'm actually looking for is a
> way to do this automatically.
>
> In the same way that routes configuration is set up to
> handle /:controller/:action/*, I would like to set
> up /:controller_singular/* which would go to the view action.
>
> i.e. not naming individual controllers in the route config, have it
> happen automagically.
>
> On Nov 15, 4:28 pm, jeremyharris  wrote:
> > Check out:http://book.cakephp.org/view/945/Routes-Configuration
> >
> > There's examples for your very request about halfway through.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Singular controller name route

2011-11-15 Thread martinp
Thanks for the reply Jeremy, but what I'm actually looking for is a
way to do this automatically.

In the same way that routes configuration is set up to
handle /:controller/:action/*, I would like to set
up /:controller_singular/* which would go to the view action.

i.e. not naming individual controllers in the route config, have it
happen automagically.

On Nov 15, 4:28 pm, jeremyharris  wrote:
> Check out:http://book.cakephp.org/view/945/Routes-Configuration
>
> There's examples for your very request about halfway through.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Singular controller name route

2011-11-15 Thread jeremyharris
Check out: http://book.cakephp.org/view/945/Routes-Configuration

There's examples for your very request about halfway through.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Singular controller name route

2011-11-15 Thread martinp
Has anyone seen or achieved routing whereby all controller view
actions can be accessed via the singular name of the controller?

e.g. /pages/view/1 can be accessed by page/1; posts/view/1 by post/1;
etc

I know route classes are possible, I know it's possible to use the
inflector, but I haven't been able to work out how to put it all
together, so that it works for any controller (named following the
conventions) you throw at it. Has anyone done this already?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Custom controller name

2011-08-01 Thread Miles J
Like euromark said, just call it CalController, it *doesnt* have to be
plural.

On Jul 31, 1:58 am, euromark  wrote:
> but almost as easy:
> CalController extends ...
> var $name = 'CalController';
>
> and make sure you post all forms to themselves (which is the default
> thing for cake2 anyway!)
>
> On 31 Jul., 02:58, Roland Pish  wrote:
>
>
>
>
>
>
>
> > Thank you Sam!
> > I'll use the route.
>
> > Cheers
>
> > On 30 jul, 17:42, Sam Sherlock  wrote:
>
> > > For an easier life I would stick with conventions and set the route cal to
> > > route to the CalsController
>
> > > Router::connect('/cal', array(
> > >         'controller' => 'cals',
> > >         'action' => 'index'));
>
> > > but you can have the model useTable an 'some_unconventional_name'
> > > with the following in the model
> > >     public $useTable = 'cal';
>
> > >  - S
>
> > > On 30 July 2011 23:43, Roland Pish  wrote:
>
> > > > I have a model named "Cal". I wanted its table name to "cal" (not
> > > > "cals").
>
> > > > Now, I would like that its controller could be accessed as: mysite.com/
> > > > cal/*   (and avoid being accessed as
> > > > mysite.com/cals/*).
>
> > > > A plus would be that I can declare the controller as: class
> > > > CalController extends...
>
> > > > Is this possible?
>
> > > > Thanks in advance.
>
> > > > --
> > > > Our newest site for the community: CakePHP Video Tutorials
> > > >http://tv.cakephp.org
> > > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> > > > others with their CakePHP related questions.
>
> > > > To unsubscribe from this group, send email to
> > > > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > > > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Custom controller name

2011-07-31 Thread euromark
but almost as easy:
CalController extends ...
var $name = 'CalController';

and make sure you post all forms to themselves (which is the default
thing for cake2 anyway!)


On 31 Jul., 02:58, Roland Pish  wrote:
> Thank you Sam!
> I'll use the route.
>
> Cheers
>
> On 30 jul, 17:42, Sam Sherlock  wrote:
>
>
>
>
>
>
>
> > For an easier life I would stick with conventions and set the route cal to
> > route to the CalsController
>
> > Router::connect('/cal', array(
> >         'controller' => 'cals',
> >         'action' => 'index'));
>
> > but you can have the model useTable an 'some_unconventional_name'
> > with the following in the model
> >     public $useTable = 'cal';
>
> >  - S
>
> > On 30 July 2011 23:43, Roland Pish  wrote:
>
> > > I have a model named "Cal". I wanted its table name to "cal" (not
> > > "cals").
>
> > > Now, I would like that its controller could be accessed as: mysite.com/
> > > cal/*   (and avoid being accessed as
> > > mysite.com/cals/*).
>
> > > A plus would be that I can declare the controller as: class
> > > CalController extends...
>
> > > Is this possible?
>
> > > Thanks in advance.
>
> > > --
> > > Our newest site for the community: CakePHP Video Tutorials
> > >http://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> > > others with their CakePHP related questions.
>
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Custom controller name

2011-07-30 Thread Roland Pish
Thank you Sam!
I'll use the route.

Cheers

On 30 jul, 17:42, Sam Sherlock  wrote:
> For an easier life I would stick with conventions and set the route cal to
> route to the CalsController
>
> Router::connect('/cal', array(
>         'controller' => 'cals',
>         'action' => 'index'));
>
> but you can have the model useTable an 'some_unconventional_name'
> with the following in the model
>     public $useTable = 'cal';
>
>  - S
>
> On 30 July 2011 23:43, Roland Pish  wrote:
>
>
>
>
>
>
>
> > I have a model named "Cal". I wanted its table name to "cal" (not
> > "cals").
>
> > Now, I would like that its controller could be accessed as: mysite.com/
> > cal/*   (and avoid being accessed as
> > mysite.com/cals/*).
>
> > A plus would be that I can declare the controller as: class
> > CalController extends...
>
> > Is this possible?
>
> > Thanks in advance.
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Custom controller name

2011-07-30 Thread Sam Sherlock
For an easier life I would stick with conventions and set the route cal to
route to the CalsController

Router::connect('/cal', array(
'controller' => 'cals',
'action' => 'index'));

but you can have the model useTable an 'some_unconventional_name'
with the following in the model
public $useTable = 'cal';


 - S




On 30 July 2011 23:43, Roland Pish  wrote:

> I have a model named "Cal". I wanted its table name to "cal" (not
> "cals").
>
> Now, I would like that its controller could be accessed as: mysite.com/
> cal/*   (and avoid being accessed as
> mysite.com/cals/*).
>
> A plus would be that I can declare the controller as: class
> CalController extends...
>
> Is this possible?
>
> Thanks in advance.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Custom controller name

2011-07-30 Thread Roland Pish
I have a model named "Cal". I wanted its table name to "cal" (not
"cals").

Now, I would like that its controller could be accessed as: mysite.com/
cal/*  (and avoid being accessed as mysite.com/cals/*).

A plus would be that I can declare the controller as: class
CalController extends...

Is this possible?

Thanks in advance.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Controller Name in App_controller

2010-08-04 Thread Ambika Kulkarni
yes, got it.

Thank you
On Wed, Aug 4, 2010 at 2:18 PM, Amit Rawat  wrote:

> Hi
>
> You can get controller name and action name by:-
>
> $this->params['controller'] and $this->params['action']
>
> Enjoy,
>
> Amit
>
> On Wed, Aug 4, 2010 at 1:19 PM, Ambika Kulkarni <
> ambikakulkarn...@gmail.com> wrote:
>
>> Hi all,
>>
>> Is their any way to get the controller name in app_controller.php
>> file.
>>
>> The problem scenario is like this.
>>
>> In my app_controller i have written a bunch of code in before_filter()
>> function.
>>
>> I have a right panel like
>> Division
>> Element
>> Purchase and so on...
>>
>> As soon as I click on any of this name (Division or Element ...) then
>> I want the respective controller name in the before_filter() function.
>>  For Division link the  controller name is divisions. As soon as I
>> click in Divisions link I am redirected to divisions_controller.php
>> page.
>>
>> Please help me out to solve this prob
>>
>> Thanks and Regards
>> Ambika
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Controller Name in App_controller

2010-08-04 Thread Amit Rawat
Hi

You can get controller name and action name by:-

$this->params['controller'] and $this->params['action']

Enjoy,

Amit

On Wed, Aug 4, 2010 at 1:19 PM, Ambika Kulkarni
wrote:

> Hi all,
>
> Is their any way to get the controller name in app_controller.php
> file.
>
> The problem scenario is like this.
>
> In my app_controller i have written a bunch of code in before_filter()
> function.
>
> I have a right panel like
> Division
> Element
> Purchase and so on...
>
> As soon as I click on any of this name (Division or Element ...) then
> I want the respective controller name in the before_filter() function.
>  For Division link the  controller name is divisions. As soon as I
> click in Divisions link I am redirected to divisions_controller.php
> page.
>
> Please help me out to solve this prob
>
> Thanks and Regards
> Ambika
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Controller Name in App_controller

2010-08-04 Thread Ambika Kulkarni
Hi all,

Is their any way to get the controller name in app_controller.php
file.

The problem scenario is like this.

In my app_controller i have written a bunch of code in before_filter()
function.

I have a right panel like
Division
Element
Purchase and so on...

As soon as I click on any of this name (Division or Element ...) then
I want the respective controller name in the before_filter() function.
 For Division link the  controller name is divisions. As soon as I
click in Divisions link I am redirected to divisions_controller.php
page.

Please help me out to solve this prob

Thanks and Regards
Ambika

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: cakephp case insensitive controller name

2009-12-14 Thread will
Excellent. The space after was the problem. VERY much appreciated!

On Dec 13, 12:07 pm, Piotr Kilczuk  wrote:
> Hello,
>
> >> Do you use closing ?> tag in your classes?
>
> > yes I do use it.
>
> My suggestion is to stop doing that :) There is no profit, but it can
> break your code.
>
> > I read on one post that you can't have whitespace
> > before it (but newlines are OK). Still, that doesn't seem to be the
> > problem.
>
> _AFTER_
>
> 
> //http://localhost/sth.php
> class Sth { }
>
> ?> !
>
> http://localhost/sth.phpwould return " !" as output and this could
> break your redirects, sessions and cookies - HTTP header stuff in
> general. This is well documented and explained on the WWW.
>
> Try to get one simple action working first, even the default one
> (PagesController::display('home')). Then move on to your controllers
> and actions.
>
> Also it is crucial that you have proper allow() statements if you use
> AuthComponent.
>
> Regards,
> Piotr

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: cakephp case insensitive controller name

2009-12-13 Thread Piotr Kilczuk
Hello,

>> Do you use closing ?> tag in your classes?
>
> yes I do use it.

My suggestion is to stop doing that :) There is no profit, but it can
break your code.

> I read on one post that you can't have whitespace
> before it (but newlines are OK). Still, that doesn't seem to be the
> problem.

_AFTER_

http://localhost/sth.php
class Sth { }

?> !

http://localhost/sth.php would return " !" as output and this could
break your redirects, sessions and cookies - HTTP header stuff in
general. This is well documented and explained on the WWW.

Try to get one simple action working first, even the default one
(PagesController::display('home')). Then move on to your controllers
and actions.

Also it is crucial that you have proper allow() statements if you use
AuthComponent.

Regards,
Piotr

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: cakephp case insensitive controller name

2009-12-12 Thread Walther
I don't use ?> in pure php files.

As for your problem, check routing, and make sure you have cleared you
cache.

And, please define what you mean by 'Does not work'

On Dec 13, 6:05 am, will  wrote:
> Thanks for replying. It's so nice to come back and get an opinion or
> inspire and idea from someone!
>
> On Dec 12, 4:24 pm, Piotr Kilczuk  wrote:
> ...
>
>
>
> > Do you use closing ?> tag in your classes?
>
> yes I do use it. I read on one post that you can't have whitespace
> before it (but newlines are OK). Still, that doesn't seem to be the
> problem.
>
>
>
> > Regards,
> > Piotr

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: cakephp case insensitive controller name

2009-12-12 Thread will
Thanks for replying. It's so nice to come back and get an opinion or
inspire and idea from someone!

On Dec 12, 4:24 pm, Piotr Kilczuk  wrote:
...
>
> Do you use closing ?> tag in your classes?

yes I do use it. I read on one post that you can't have whitespace
before it (but newlines are OK). Still, that doesn't seem to be the
problem.

>
> Regards,
> Piotr

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: cakephp case insensitive controller name

2009-12-12 Thread Piotr Kilczuk
Hello,

> I recently moved my site from a windows server to a linux server. I
> have an admin section to my site (under plugins). It works fine if I
> browse to:

So what you describe is possibly related to the fact, that filenames
are case sensitive under Linux. I don't know however why does this
happen on the action name, while it should rather break on the
controller name (action name does not map to a filename).

Do you use closing ?> tag in your classes?

Regards,
Piotr

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


cakephp case insensitive controller name

2009-12-11 Thread will
I recently moved my site from a windows server to a linux server. I
have an admin section to my site (under plugins). It works fine if I
browse to:

  http://www.jamestownjobalert.com/admin/Success

but this does not work:

  http://www.jamestownjobalert.com/admin/success('s' not
capitalized)

In my admin_controller.php, I have a function defined as:

  function success($action = null, $id = null) {


Can anyone speculate on where I would look to figure out why
capitalized action names in the URL work, but non-capitalized names do
not? The non caps URL goes to a blank page. When I turn on the php
debug, the error I get is:

Warning (2): Cannot modify header information - headers already
sent by (output started at /home/jja/public_html/app/plugins/admin/
controllers/admin_controller.php:410) [CORE/cake/libs/controller/
controller.php, line 616]

Recognizing this error as a redirect issue, I put a line in the
cake/./controller.php file to see if it was redirecting somewhere,
and it seems to be redirecting to /admin/login.php (eventhough I had
already been logged in). Again, I don't think it's a login issue
either because I am able to go to the URL that has the action name in
lower case.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: form->create duplicating my controller name

2008-12-29 Thread ymadh

I was using the wrong URL

/index.php/Clients vs /Clients

thanks for your help.

On Dec 29, 2:49 pm, ymadh  wrote:
> I appreciate your  reply.
>
> Unfortunately that didn't do it. It still creates
>  from my $form->create call
--~--~-~--~~~---~--~~
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: form->create duplicating my controller name

2008-12-29 Thread ymadh

I appreciate your  reply.

Unfortunately that didn't do it. It still creates
 from my $form->create call
--~--~-~--~~~---~--~~
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: form->create duplicating my controller name

2008-12-29 Thread thatsgreat2345

Your model should be called client.php not clients.php

On Dec 29, 10:19 am, ymadh  wrote:
>          echo $form->create('Client',array('action'=>'add'));
>         echo $form->input('firstname');
>         echo $form->input('lastname');
>         echo $form->end('Save Client');
> ?>
>
> I have a simple controller / model / table for adding clients. My
> model is called clients.php, my controller is clients_controller.php
>
> The above code produces this
> 
>
> as you can see, clients is listed twice.  Any ideas why?  It then
> looks for clients as a function inside my controller instead of the
> add function.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



form->create duplicating my controller name

2008-12-29 Thread ymadh

create('Client',array('action'=>'add'));
echo $form->input('firstname');
echo $form->input('lastname');
echo $form->end('Save Client');
?>


I have a simple controller / model / table for adding clients. My
model is called clients.php, my controller is clients_controller.php


The above code produces this


as you can see, clients is listed twice.  Any ideas why?  It then
looks for clients as a function inside my controller instead of the
add function.

--~--~-~--~~~---~--~~
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: routes, controller name and model name

2008-12-08 Thread Filip Camerman

Meanwhile I figured I can combine all the actions in one route, but I
still have to list them all:

  Router::connect('/collections/:action/*', array('controller' =>
'collections'), array('action' => 'add|edit|delete'));

I guess that's the least unelegant way then.

Thx for your reaction though!

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: routes, controller name and model name

2008-12-07 Thread brian

If you don't want to put an action before name-of-collection you'll
need to create a route for each action, AFAIK.

Router::connect('/showcases', array('controller' => 'showcases',
'action' => 'index'));
Router::connect('/showcases/edit/*', array('controller' =>
'showcases', 'action' => 'edit'));

etc.

Router::connect('/collections/:slug',
array('controller' => 'collections', 'action' => 'view'),
array('slug' => '[-_A-Za-z0-9]+')
);


On Sun, Dec 7, 2008 at 5:56 AM, Filip Camerman <[EMAIL PROTECTED]> wrote:
>
> I'm making a site for an artist and when showing image galleries of
> art collections I want url's like
>
> www.site.com/collections/name-of-collection
>
> Now I also have a database table for collections, and hence a
> collection_controller and a collection model.
>
> First I had my routes like this
> - Router::connect('/collections/:action/*', array('controller' =>
> 'collections'));
> - Router::connect('/collections/*', array('controller' =>
> 'collections', 'action' => 'index'));
>
> I thought that the first route would only catch url's with existing
> actions, but instead it also caught my "/collections/name-of-
> collection" url's. So I changed it to:
>
> - Router::connect('/coll/:action/*', array('controller' =>
> 'collections'));
>
> since the url's don't matter for my admin actions. But then I have to
> change my forms because
>
> create('Collection');?>
>
> will post the form to /collections/...
>
> Now I can solve this in several ways (change the model name; make
> separate routes for all my admin actions, ...) but I was wondering if
> there's an elegant way to deal with custom url's that start with a
> controller/model name?
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



routes, controller name and model name

2008-12-07 Thread Filip Camerman

I'm making a site for an artist and when showing image galleries of
art collections I want url's like

www.site.com/collections/name-of-collection

Now I also have a database table for collections, and hence a
collection_controller and a collection model.

First I had my routes like this
- Router::connect('/collections/:action/*', array('controller' =>
'collections'));
- Router::connect('/collections/*', array('controller' =>
'collections', 'action' => 'index'));

I thought that the first route would only catch url's with existing
actions, but instead it also caught my "/collections/name-of-
collection" url's. So I changed it to:

- Router::connect('/coll/:action/*', array('controller' =>
'collections'));

since the url's don't matter for my admin actions. But then I have to
change my forms because

create('Collection');?>

will post the form to /collections/...

Now I can solve this in several ways (change the model name; make
separate routes for all my admin actions, ...) but I was wondering if
there's an elegant way to deal with custom url's that start with a
controller/model name?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: difference in model and controller name

2008-11-17 Thread David C. Zentgraf

> var $name = 'Category ';
  ^

Get rid of the extra space, then your model name should inflect  
properly (and eliminate a million other possible headaches).

On 18 Nov 2008, at 07:43, introvert wrote:

>
> I'm using the latest cakephp (downloaded it a moment ago).
>
> I have created the 'categories' table and database connection works
> just fine.
>
> If I add in the model class the $useTable variable, the error
> "Database table category s for model Category was not found." goes
> away:
>
> Heres the model code:
>  class Category extends AppModel {
>   var $name = 'Category ';
>
>   var $useTable = 'categories';
> }
> ?>
>
> Any idea what is going on?
>
> Many thanks in advance!
>
> On Nov 17, 11:31 pm, teknoid <[EMAIL PROTECTED]> wrote:
>> Either you are using some really really old release of cake,
>> or you did something incorrectly.
>>
>> Cake will look for 'categories' table for a Category model by  
>> default.
>>
>> On Nov 17, 4:35 pm, introvert <[EMAIL PROTECTED]> wrote:
>>
>>> Hey,
>>
>>> Its CategorIES instead of CategorYS.
>>
>>> The error I get:
>>
>>> Error:  Database table category s for model Category was not found.
>>
>>> Or should this work for sure?
>>> In my case it doesnt.
>>
>>>  If not, how to associate the database categories with the model/
>>> controller (since it think the name is categorys)
>>
>>> On Nov 17, 10:26 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]>
>>> wrote:
>>
 On Mon, Nov 17, 2008 at 7:22 PM, introvert  
 <[EMAIL PROTECTED]> wrote:
>>
> Hello,
>>
> I have recently came acrros cakephp and I'm not very familiar  
> with it
> yet.
>>
> I made a model:
> category.php (Category)
>>
> which I want to associate with controller:
> categories_controller.php (CategoriesController)
>>
 That is exactly how cake works.
>>
> but this wont happen due to differences in names Category ->
> Categories (plural form).
>>
 No, exactly the inverse.
>>
> What should I do in such case to make it work?
>>
 Nothing, just read the docs: book.cakephp.org
>>
 HTH,
 - Dardo Sordi.
>>
> Many thanks in advance!
> >


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: difference in model and controller name

2008-11-17 Thread introvert

I'm using the latest cakephp (downloaded it a moment ago).

I have created the 'categories' table and database connection works
just fine.

If I add in the model class the $useTable variable, the error
"Database table category s for model Category was not found." goes
away:

Heres the model code:


Any idea what is going on?

Many thanks in advance!

On Nov 17, 11:31 pm, teknoid <[EMAIL PROTECTED]> wrote:
> Either you are using some really really old release of cake,
> or you did something incorrectly.
>
> Cake will look for 'categories' table for a Category model by default.
>
> On Nov 17, 4:35 pm, introvert <[EMAIL PROTECTED]> wrote:
>
> > Hey,
>
> > Its CategorIES instead of CategorYS.
>
> > The error I get:
>
> > Error:  Database table category s for model Category was not found.
>
> > Or should this work for sure?
> > In my case it doesnt.
>
> >  If not, how to associate the database categories with the model/
> > controller (since it think the name is categorys)
>
> > On Nov 17, 10:26 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]>
> > wrote:
>
> > > On Mon, Nov 17, 2008 at 7:22 PM, introvert <[EMAIL PROTECTED]> wrote:
>
> > > > Hello,
>
> > > > I have recently came acrros cakephp and I'm not very familiar with it
> > > > yet.
>
> > > > I made a model:
> > > > category.php (Category)
>
> > > > which I want to associate with controller:
> > > > categories_controller.php (CategoriesController)
>
> > > That is exactly how cake works.
>
> > > > but this wont happen due to differences in names Category ->
> > > > Categories (plural form).
>
> > > No, exactly the inverse.
>
> > > > What should I do in such case to make it work?
>
> > > Nothing, just read the docs: book.cakephp.org
>
> > > HTH,
> > > - Dardo Sordi.
>
> > > > Many thanks in advance!
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: difference in model and controller name

2008-11-17 Thread Marcelo Andrade
On Mon, Nov 17, 2008 at 6:35 PM, introvert <[EMAIL PROTECTED]> wrote:
>
> The error I get:
>
> Error:  Database table category s for model Category was not found.

Your table must be "categories", in the plural form.
If you are not the dba and cannot rename the tables,
try to put the field

$useTable = "thenameofmycategoriestable";

in your model.

--
MARCELO DE F. ANDRADE (aka "eleKtron")
Belem, PA, Amazonia, Brazil
Linux User #221105

[EMAIL PROTECTED] ~]# links http://pa.slackwarebrasil.org/

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: difference in model and controller name

2008-11-17 Thread teknoid

Either you are using some really really old release of cake,
or you did something incorrectly.

Cake will look for 'categories' table for a Category model by default.


On Nov 17, 4:35 pm, introvert <[EMAIL PROTECTED]> wrote:
> Hey,
>
> Its CategorIES instead of CategorYS.
>
> The error I get:
>
> Error:  Database table category s for model Category was not found.
>
> Or should this work for sure?
> In my case it doesnt.
>
>  If not, how to associate the database categories with the model/
> controller (since it think the name is categorys)
>
> On Nov 17, 10:26 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]>
> wrote:
>
> > On Mon, Nov 17, 2008 at 7:22 PM, introvert <[EMAIL PROTECTED]> wrote:
>
> > > Hello,
>
> > > I have recently came acrros cakephp and I'm not very familiar with it
> > > yet.
>
> > > I made a model:
> > > category.php (Category)
>
> > > which I want to associate with controller:
> > > categories_controller.php (CategoriesController)
>
> > That is exactly how cake works.
>
> > > but this wont happen due to differences in names Category ->
> > > Categories (plural form).
>
> > No, exactly the inverse.
>
> > > What should I do in such case to make it work?
>
> > Nothing, just read the docs: book.cakephp.org
>
> > HTH,
> > - Dardo Sordi.
>
> > > Many thanks in advance!
>
>
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: difference in model and controller name

2008-11-17 Thread introvert

Hey,

Its CategorIES instead of CategorYS.

The error I get:

Error:  Database table category s for model Category was not found.

Or should this work for sure?
In my case it doesnt.

 If not, how to associate the database categories with the model/
controller (since it think the name is categorys)


On Nov 17, 10:26 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]>
wrote:
> On Mon, Nov 17, 2008 at 7:22 PM, introvert <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > I have recently came acrros cakephp and I'm not very familiar with it
> > yet.
>
> > I made a model:
> > category.php (Category)
>
> > which I want to associate with controller:
> > categories_controller.php (CategoriesController)
>
> That is exactly how cake works.
>
> > but this wont happen due to differences in names Category ->
> > Categories (plural form).
>
> No, exactly the inverse.
>
> > What should I do in such case to make it work?
>
> Nothing, just read the docs: book.cakephp.org
>
> HTH,
> - Dardo Sordi.
>
> > Many thanks in advance!
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: difference in model and controller name

2008-11-17 Thread Dardo Sordi Bogado

On Mon, Nov 17, 2008 at 7:22 PM, introvert <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I have recently came acrros cakephp and I'm not very familiar with it
> yet.
>
> I made a model:
> category.php (Category)
>
> which I want to associate with controller:
> categories_controller.php (CategoriesController)

That is exactly how cake works.

> but this wont happen due to differences in names Category ->
> Categories (plural form).

No, exactly the inverse.

> What should I do in such case to make it work?

Nothing, just read the docs: book.cakephp.org

HTH,
- Dardo Sordi.

> Many thanks in advance!
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



difference in model and controller name

2008-11-17 Thread introvert

Hello,

I have recently came acrros cakephp and I'm not very familiar with it
yet.

I made a model:
category.php (Category)

which I want to associate with controller:
categories_controller.php (CategoriesController)

but this wont happen due to differences in names Category ->
Categories (plural form).

What should I do in such case to make it work?

Many thanks in advance!
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



routes, changing controller name

2008-11-13 Thread tiberium911

I saw an example on here that used variables in the regex part.
Router::connect(
"/articles/:year/:month/:day/:slug",
array("controller" => "articles", "month" => null, "day" => null,
"slug" => null),
array('year' => $Year, 'month' => $Month, 'day' => $Day, 'slug' =>
"[A-Za-z0-9_\-]+")
);

Was wondering if there is a way to use the same sort of variables for
setting the controller as well. Possibly something like
Router::connect('/reports/:type/*', array('controller' => 'reports_'.
$Type, 'action' => 'index'));

Thanks

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



For some reason cake does not like this controller name to be plural?

2008-07-18 Thread Parris

Cake is telling me:
Missing Controller
Error: EventController could not be found.

Error: Create the class EventController below in file: app/controllers/
event_controller.php




My Event Model (event.php in /models):
 array(
'className' =>  'GalleryCategory',
'foreignKey' => 'id',
'associationForeignKey' => 'gallery_id',
'joinTable' => 'gallery_categories'
),
'EventCategory' => array(
'className' =>  'EventCategory',
'foreignKey' => 'id',
'associationForeignKey' => 'cat_id',
'joinTable' => 'event_categories'
)
);
}
?>

Events Controllers (events_controller.php in /controllers):
set('events', $this->Event->findAll());
}
}
?>

When I make it singular it works for the most part; however, the
association event_categories doesn't work quite right. It will display
the name of each column within the array, but the values for those
items end up blank. I think for some reason it is steming from this
singular plural issue. Even if it isn't, I really need to fix this
problem before i go on. The most interesting thing is that the
association with GalleryCategory works just fine and all the values in
the array work perfectly. I have been stuck along all of these issues
for the past couple days. I have made soo many searches on this. Read
and reread all the conventions. I have no idea where to turn.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to get controller name from an element view?

2008-02-09 Thread Guill3rmo

Thanks a lot, that´s what i was looking for.

On 8 feb, 16:22, MonkeyGirl <[EMAIL PROTECTED]> wrote:
> > Hi im newbie and my English still sucks, but i want to know get the
> > controller name since an element view. Thanks.
>
> Try echoing out $this->params['controller'] - is that what you're
> after?
>
> Hope that helps,
> Zoe.
--~--~-~--~~~---~--~~
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: How to get controller name from an element view?

2008-02-08 Thread MonkeyGirl

> Hi im newbie and my English still sucks, but i want to know get the
> controller name since an element view. Thanks.

Try echoing out $this->params['controller'] - is that what you're
after?

Hope that helps,
Zoe.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



How to get controller name from an element view?

2008-02-08 Thread Guill3rmo

Hi im newbie and my English still sucks, but i want to know get the
controller name since an element view. Thanks.

--~--~-~--~~~---~--~~
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: controller name

2007-07-28 Thread Andras Kende


Both  $irregularPlural = array('niche' => 'niches');   or var $uses =
array('Niche');  works great

Thanks for the help  !!!

Andras


--~--~-~--~~~---~--~~
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: controller name

2007-07-27 Thread citrus

I think your problem can be solved by editting inflections.php, which
is located in app/config directory. To be more precisely, add niche -
niches to your $irregularPlural array like this:

$irregularPlural = array('niche' => 'niches');

It would work seamlessly then.


--~--~-~--~~~---~--~~
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: controller name

2007-07-27 Thread RoE

Hello Andras,

Try to declare $uses variable inside your controller somewhat like
below.

.
.
class NichesController extends AppController {
   var $name = 'Niches';

   var $uses = array('Niche');

   var $scaffold;
}


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



controller name

2007-07-27 Thread Andras Kende

Hello,

Quick question I have the following:

niches_controller.php


Calling it by www.domain/cake/niches  errors out with complaining
about missing model:

Missing Model
No class found for the Nich model.
Fatal: Create the class below in file: app/models/nich.php Etc...

But I have

niche.php


I don't understand why the exact same works with Movie - Movies  but
not this Niche - Niches ??

What is the best way to deal with this errors?

Thank you,

Andras Kende
http://www.kende.com

--~--~-~--~~~---~--~~
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: same directory as controller name

2007-07-27 Thread [EMAIL PROTECTED]

I have a solution.
When a request is made apache checks if the directory exists. If it
does, it checks if index.php, index.htm or index.html exists. If they
don't, the request is forwarded to cake. And all this magic with
mod_rewrite voodoo:


   RewriteEngine on

   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule ^$ app/webroot/ [L]

   # check if directory exists, if so, add default indexing script.
(and do a [N]ext round so the %{REQUEST_FILENAME} gets updated. Should
also work with [PT])
   RewriteCond %{REQUEST_FILENAME} -d
   RewriteRule (.*) %{REQUEST_FILENAME}index.php [N]

   # if above rewrite didn't yield any success, try with .htm
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule (.*)index.php$ $1index.htm

   # now try with .html
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule (.*)index.htm$ $1index.html

   # last but not least, if it is a file, serve it, else strip the
index.html and give it to cake :)
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule (.*)index.html$ $1
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule (.*) app/webroot/$1 [L]



--~--~-~--~~~---~--~~
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: same directory as controller name

2007-07-26 Thread Grant Cox

I don't know how to write htaccess files, but you could get apache to
rewrite requests for /intranet and /intranet/ to /intranet/index .
This file will not exist, and the Cake action will be called instead.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



same directory as controller name

2007-07-26 Thread [EMAIL PROTECTED]

Hi,

ideally, I'd like cake to get a request only when the full path (minus
the path of the webroot) of the directory or file does not exist. As I
understand it in the situation now, the request doesn't get through as
soon as the first directory exists, but no further checks are being
done.

e.g.
I have a controller IntranetController which would be called as soon
as you request /intranet .
But I also have a directory /intranet/downloads , which should be
accessible without going through cake. It should not call the intranet
controller with the action downloads but serve the directory listing
of /intranet/downloads.

So, I have 2 questions:
1/ Is above situation possible only with apache and .htaccess files?
I've tried the following in the .htaccess file in the root of the cake
directory tree:

   RewriteEngine on
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule^$ app/webroot/[L]
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule(.*) app/webroot/$1 [L]

This doesn't work. As soon as /intranet is requested, I get the a 403
(which it should do when you would request it and no cake was
installed, as I don't allow a directroy listing) where I'd like to get
the page rendered by cake. As soon as I request /intranet/downloads, I
get a Missing action error. These are the opposite responses as I was
hoping for.

2/ If apache fails, the sollution would be that I should have a check
performed in cake to see if the requested address physically exists on
the server. And when it does, redirect the user. But I'd rather not.

Any ideas?
Kenny


--~--~-~--~~~---~--~~
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: controller name ("s")

2007-07-12 Thread Dragos Rusu

Thank you.

On Jul 12, 5:33 pm, francky06l <[EMAIL PROTECTED]> wrote:
> You can your own "rules" for this into the inflections.php in your
> config directory.
>
> On Jul 12, 4:11 pm, Dragos Rusu <[EMAIL PROTECTED]> wrote:
>
> > I'm using other language for controller names and I don't know how to
> > escape the "s" separator.
> > I'd like to use as controller name the following word: 'anunturi' .
> > Where do I set the connection between model -> controller -> view ?


--~--~-~--~~~---~--~~
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: controller name ("s")

2007-07-12 Thread francky06l

You can your own "rules" for this into the inflections.php in your
config directory.

On Jul 12, 4:11 pm, Dragos Rusu <[EMAIL PROTECTED]> wrote:
> I'm using other language for controller names and I don't know how to
> escape the "s" separator.
> I'd like to use as controller name the following word: 'anunturi' .
> Where do I set the connection between model -> controller -> view ?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



controller name ("s")

2007-07-12 Thread Dragos Rusu

I'm using other language for controller names and I don't know how to
escape the "s" separator.
I'd like to use as controller name the following word: 'anunturi' .
Where do I set the connection between model -> controller -> view ?


--~--~-~--~~~---~--~~
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 conventions - controller name consists of two words

2007-06-02 Thread Preloader

Hello,

thank's for your answers.

Also a very interesting discussion regarding Google!

Thank you, Christoph


--~--~-~--~~~---~--~~
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 conventions - controller name consists of two words

2007-06-01 Thread AD7six



On 1 jun, 13:19, "Jon Bennett" <[EMAIL PROTECTED]> wrote:
> > Don't know what SEO purist would have to say though (although for example 
> > it doesn't seem
> > to affect one way or the other how you write your urls to Google).
>
> I've read/heard differently. I believe that hyphens (-) are better
> than underscores because search engines see underscored_words as
> oneword, whereas hypenated-words-are-seen as separate.
>
> what impact this has is much harder to qunatify though!

I've read/heard similar stuff too. If that were the case though I
would assume camel cased words would be even worse - since it would be
seen as a single long word, but (using some key words from a recent
blog).:

http://www.google.com/search?q=making+the+most+of+the+router
http://www.google.com/search?q=router+making+most (word order of
little importance)
http://uk.search.yahoo.com/search?p=making+the+most+of+the+router
http://uk.search.yahoo.com/search?p=router+making+most (word order of
little importance)

return almost the same results (my blog site is in page 1 of each of
those searches at the time of writing). I noticed that if you delete
one character from the end of any search term the results are vastly
different, so it seems to me that word boundaries are detected for
camel case words quite easily also.

IMO SEs are camel/dash/underscore/etc. aware and therefore it
shouldn't make any difference but as I'm not a SE developer: "purely
IMO" :).

Cheers,

AD


--~--~-~--~~~---~--~~
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 conventions - controller name consists of two words

2007-06-01 Thread Jon Bennett

> Don't know what SEO purist would have to say though (although for example it 
> doesn't seem
> to affect one way or the other how you write your urls to Google).

I've read/heard differently. I believe that hyphens (-) are better
than underscores because search engines see underscored_words as
oneword, whereas hypenated-words-are-seen as separate.

what impact this has is much harder to qunatify though!

jb


-- 


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 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 conventions - controller name consists of two words

2007-06-01 Thread AD7six



On 31 mayo, 15:54, Preloader <[EMAIL PROTECTED]> wrote:
> Helly bakers,
>
> I hope this is not a strange/stupid question, but (i think) i didn't
> find the answer in the cake manual ("conventions").
>
> I have a controller for link categories.
>
> Classname: LinkCategoriesController
> Filename: link_categories_controller.php
>
> But what's the controller name? linkCategories, LinkCategories or
> link_categories?
>
> All the three work:
>
> 1)http://mydomain.com/linkCategories/view/1
> 2)http://mydomain.com/LinkCategories/view/1
> 3)http://mydomain.com/link_categories/view/1
>
> But what is correct?

cake expects you to use lowercase and underscored urls, so you could
say that 3 is correct in that it's consistent.

I prefer 2, but I think I'm in a minority :D. Don't know what SEO
purist would have to say though (although for example it doesn't seem
to affect one way or the other how you write your urls to Google).

Cheers,

AD


--~--~-~--~~~---~--~~
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 conventions - controller name consists of two words

2007-05-31 Thread Joshua Benner

I've always used lowercase-underscore.

class ActivityTypesController is accessed at /activity_types

Preloader wrote:
> Ohh, sorry ...
>
> 'link' should be plural 
>
> LinksCategoriesController
> links_categories_controller.php
>
> :-), Christoph
>
>
> >
>   

--~--~-~--~~~---~--~~
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 conventions - controller name consists of two words

2007-05-31 Thread Preloader

Ohh, sorry ...

'link' should be plural 

LinksCategoriesController
links_categories_controller.php

:-), Christoph


--~--~-~--~~~---~--~~
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 conventions - controller name consists of two words

2007-05-31 Thread Preloader

Helly bakers,

I hope this is not a strange/stupid question, but (i think) i didn't
find the answer in the cake manual ("conventions").

I have a controller for link categories.

Classname: LinkCategoriesController
Filename: link_categories_controller.php

But what's the controller name? linkCategories, LinkCategories or
link_categories?

All the three work:

1) http://mydomain.com/linkCategories/view/1
2) http://mydomain.com/LinkCategories/view/1
3) http://mydomain.com/link_categories/view/1

But what is correct?

I'm shure that 2) is not correct, because normally in urls controller
names consisting of one word are written lowercase.


And how should an URL array look like?

$url = array('controller' => 'link_categories', 'action' => 'view',
'id' => 1); 


Thanks, Christoph


--~--~-~--~~~---~--~~
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: Plugin Controller name uniqueness. was: phpGACL installation

2007-05-10 Thread Mariano Iglesias

Again, I was just kidding around. Let it go, mate, let it go. I'll promise
I'll send you some beauty creams ;)

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de AD7six
Enviado el: Jueves, 10 de Mayo de 2007 08:24 a.m.
Para: Cake PHP
Asunto: Re: Plugin Controller name uniqueness. was: phpGACL installation

Only when I've run out of beauty creams ;). No, I don't know to what
you are referring - I should approach it how..? Obviously I wouldn't
create an enhancement ticket for something I don't agree with
(although I believe there are plans already afoot for some changes),
so ...?


--~--~-~--~~~---~--~~
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: Plugin Controller name uniqueness. was: phpGACL installation

2007-05-10 Thread AD7six



On 10 mayo, 13:17, "Mariano Iglesias" <[EMAIL PROTECTED]>
wrote:
> Oh come on, don't give me that freedom of speech BS, just kidding around.
> Sensitive day?

Only when I've run out of beauty creams ;). No, I don't know to what
you are referring - I should approach it how..? Obviously I wouldn't
create an enhancement ticket for something I don't agree with
(although I believe there are plans already afoot for some changes),
so ...?

Cheers,

AD


--~--~-~--~~~---~--~~
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: Plugin Controller name uniqueness. was: phpGACL installation

2007-05-10 Thread Mariano Iglesias

Oh come on, don't give me that freedom of speech BS, just kidding around.
Sensitive day?

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de AD7six
Enviado el: Jueves, 10 de Mayo de 2007 08:10 a.m.
Para: Cake PHP
Asunto: Re: Plugin Controller name uniqueness. was: phpGACL installation

I don't feel that expressing a different opinion is an inappropriate
approach. Or you mean something different..?


--~--~-~--~~~---~--~~
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: Plugin Controller name uniqueness. was: phpGACL installation

2007-05-10 Thread Mariano Iglesias

I'm not a core developer, I'm a contributor reporting to all-mighty nut.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Dr. Tarique Sani
Enviado el: Jueves, 10 de Mayo de 2007 08:14 a.m.
Para: cake-php@googlegroups.com
Asunto: Re: Plugin Controller name uniqueness. was: phpGACL installation

MI is just showing signs of being a core CakePHP developer - just let him be
:P


--~--~-~--~~~---~--~~
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: Plugin Controller name uniqueness. was: phpGACL installation

2007-05-10 Thread Dr. Tarique Sani

On 5/10/07, AD7six <[EMAIL PROTECTED]> wrote:
>
> I don't feel that expressing a different opinion is an inappropriate
> approach. Or you mean something different..?
>

MI is just showing signs of being a core CakePHP developer - just let him be :P


Tarique

P.S. Cheesecake shouldn't have been called a plugin in the first place
-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
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: Plugin Controller name uniqueness. was: phpGACL installation

2007-05-10 Thread AD7six



On 10 mayo, 13:00, "Mariano Iglesias" <[EMAIL PROTECTED]>
wrote:
> Now we're talking.
>
> See Andy? That's how you should approach it ;)

?

I don't feel that expressing a different opinion is an inappropriate
approach. Or you mean something different..?

cheers,

AD


--~--~-~--~~~---~--~~
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: Plugin Controller name uniqueness. was: phpGACL installation

2007-05-10 Thread Mariano Iglesias

Now we're talking.

See Andy? That's how you should approach it ;)

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Dr. Tarique Sani
Enviado el: Jueves, 10 de Mayo de 2007 07:41 a.m.
Para: cake-php@googlegroups.com
Asunto: Re: Plugin Controller name uniqueness. was: phpGACL installation

On 5/10/07, Mariano Iglesias <[EMAIL PROTECTED]> wrote:
>
> Why should I not? What's wrong about it? If I build a plugin I decide what
> is available to my application. And using requestAction() is perfectly
> acceptable and under some circumstances even recommended.
>

Agreed and that exactly is why, hell should not break loose  If in my
application I have a UsersController, and need to do a requestAction()
to a plugin's UsersController.

An enhancement ticket in trac will be an acceptable end to the thread?


--~--~-~--~~~---~--~~
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: Plugin Controller name uniqueness. was: phpGACL installation

2007-05-10 Thread Dr. Tarique Sani

On 5/10/07, Mariano Iglesias <[EMAIL PROTECTED]> wrote:
>
> Why should I not? What's wrong about it? If I build a plugin I decide what
> is available to my application. And using requestAction() is perfectly
> acceptable and under some circumstances even recommended.
>

Agreed and that exactly is why, hell should not break loose  If in my
application I have a UsersController, and need to do a requestAction()
to a plugin's UsersController.

An enhancement ticket in trac will be an acceptable end to the thread?

Cheers
Tarique
-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
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: Plugin Controller name uniqueness. was: phpGACL installation

2007-05-10 Thread AD7six



On 10 mayo, 12:23, AD7six <[EMAIL PROTECTED]> wrote:

> things which are app wide like, for example, user management or access

Oops Freudian slip there.
user management -> authentication

User management is in itself a good example of what a plugin can be
used for.

AD


--~--~-~--~~~---~--~~
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: Plugin Controller name uniqueness. was: phpGACL installation

2007-05-10 Thread Mariano Iglesias

Why should I not? What's wrong about it? If I build a plugin I decide what
is available to my application. And using requestAction() is perfectly
acceptable and under some circumstances even recommended. 

So where's the sin? 

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de AD7six
Enviado el: Jueves, 10 de Mayo de 2007 07:24 a.m.
Para: Cake PHP
Asunto: Plugin Controller name uniqueness. was: phpGACL installation

> If in my application I have a UsersController, and need to do a
> requestAction() to a plugin's UsersController, then hell breaks loose.

Why would you want to do that? Because something is a technical
possibility, I don't feel that should be the basis for giving Plugin
controllers 'unique' names. having inbuilt namespaces for plugins
would completely avoid the issue though (which of course would involve
cake expecting plugin controllers to be named differently).


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Plugin Controller name uniqueness. was: phpGACL installation

2007-05-10 Thread AD7six

HI all,

On 10 mayo, 10:49, "Mariano Iglesias" <[EMAIL PROTECTED]>
wrote:
> Fromhttp://manual.cakephp.org/chapter/plugins:
>
> "While it isn't required, it is recommended that you name your plugin
> controllers something relatively unique in order to avoid namespace
> conflicts with parent applications. Its not a stretch to think that a parent
> application might have a UsersController, OrderController, or
> ProductController: so you might want to be creative with controller names,
> or prepend the name of the plugin to the classname"

I don't feel that advice is appropriate.

The only means of normally generating a pseudo-conflict is if you have
an app controller with the same name as a plugin - in that case in the
absence of a specific route the app controller will be used for the
url /plugin_name/. but that's not really a problem - just a side
effect of bad (user) design.

> If in my application I have a UsersController, and need to do a
> requestAction() to a plugin's UsersController, then hell breaks loose.

Why would you want to do that? Because something is a technical
possibility, I don't feel that should be the basis for giving Plugin
controllers 'unique' names. having inbuilt namespaces for plugins
would completely avoid the issue though (which of course would involve
cake expecting plugin controllers to be named differently).

A plugin is supposed to be a self contained mini (although in reality
it doesn't have to be mini at all) application, in principle there
shouldn't be any intereractions such as the above between a plugin and
the app/another plugin.

If you have a controller with the same name in a plugin and in your
app, unless you
1) explicitly use loadControllers in the plugin
2) explicitly load and try to use the plugin xyz controller from the
app xyz controller
3) requestAction from app xyz controller to plugin xzy controller (why
would anyone want to do that?)
4) requestAction from plugin xyz controller to app xzy controller (why
would anyone want to do that?)
5) requestAction from one plugin xyz controller to a different plugin
xyz controller (why would anyone want to do that?)

You won't come across any issues at all.

I feel that only the misuse of requestAction can cause issues, and
that's the basis for my disagreeing with the manual page on plugin
controller name uniqueness.

I should perhaps add that I don't think any plugin should contain
things which are app wide like, for example, user management or access
control. However a shop plugin shouldn't, for example, need to care /
at all/ about having a products controller since as a user who has
just installed the 'shop' plugin why would you then either a) butcher
the plugin to look at your app controllers or b) start using request
action in your app xyz controller to look at the plugin xyz controller
or c) something else a bit wacky?

If someones app controller makes a requestAction call for all requests
that could indeed make this sort of problem apparent; But again: I'd
file that under misuse of requestAction.

All IMO of course. If I've made a mistake (i.e. not just a difference
of opinion) of any kind in my post please let me know.

To finish on a q: Has anyone had a specific problem of the type being
discussed?

Cheers,

AD
PS. Is there a consensus on top posting? I don't like it :D! (Lamby
where are you and your informative footer :))


--~--~-~--~~~---~--~~
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: Multiword Controller Name

2006-11-02 Thread 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 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
-~--~~~~--~~--~--~---



Re: Multiword Controller Name

2006-11-02 Thread 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 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
-~--~~~~--~~--~--~---



Re: Multiword Controller Name

2006-11-02 Thread Jon Bennett

> 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 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
-~--~~~~--~~--~--~---



Re: Multiword Controller Name

2006-11-02 Thread 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 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
-~--~~~~--~~--~--~---



Multiword Controller Name

2006-11-02 Thread 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 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
-~--~~~~--~~--~--~---



Re: access to controller name in helper

2006-10-14 Thread francky06l

Sorry stupid question (about the static variable access), it's quite
simple ...

Thanks


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: access to controller name in helper

2006-10-14 Thread francky06l

Thanks all for the answers. I try to avoid to use the controller into
the view, but actually I have a piece of code I use in many views (for
menus management).
I did as an helper, and I need everytime to see the parameters of the
views and eventually access some static variable define into the
app_controller. This is where I struggle a bit, so how could I do this
:

class AppController extends Controller {
public static $my_var = array( ... )
...
}

Now into the helper I want to access this static variable, what is the
syntax I could use ? I come from C++, and getting quick in PHP but not
as quick to find out the way to access this without having to write a
static function or derived it.

Thanks



On Oct 14, 12:23 pm, "AD7six" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> >> $this->view->controllerThat's not such a good idea ;). try 
> >> $this->view->name for what was
> asked, or simplly $this->name when you are in the view itself. Never
> access the controller from the view, and when at some point in the
> future the connection is removed, your code will still work.
> 
> HTH,
> 
> AD7six


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: access to controller name in helper

2006-10-14 Thread AD7six

Hi,

>> $this->view->controller

That's not such a good idea ;). try $this->view->name for what was
asked, or simplly $this->name when you are in the view itself. Never
access the controller from the view, and when at some point in the
future the connection is removed, your code will still work.

HTH,

AD7six


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: access to controller name in helper

2006-10-13 Thread [EMAIL PROTECTED]

>From the helper you can access the controller and it's properties like
this: $this->view->controller


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: access to controller name in helper

2006-10-13 Thread BlenderStyle

Controller: $this->params['controller']
Action: $this->params['action']
Url: $this->params['url']['url']

Hope that helps. Use print_r($this->params) to see everything.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



access to controller name in helper

2006-10-13 Thread francky06l

Hi All,

I have built up an helper for specific operations. In a view I need the
controller name, so I can do $this->controller->name.
I'd like to have the same "functionality" in the helper ...maybe I made
something wrong but that does not work ..
I know I can pass as parameter the controller name, but since I will
always pass it, better having the helper to grab it ..

if someone knows

Thanks


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---