Re: constant for base app URL?

2014-01-31 Thread Reuben
And what I forgot to mention, from a View template, you should use 
$this->Html->url('/', true) to generate a full URL.  It will use 
Router::url() anyway, but will save you the hassle of doing an App::uses() 
in the .ctp.

On Saturday, 1 February 2014 16:22:54 UTC+10, Reuben wrote:
>
> To get a full URL, you can use Router::url('/', true).  That will give you 
> the full URL to the application.
>
> For applications running behind a load balancer, you may wish to specify 
> the BASE_URL, but I see you've already found that.
>
> Regards
> Reuben Helms
>
> On Monday, 13 March 2006 13:20:32 UTC+10, Dave wrote:
>>
>> Sorry, I should clarify further. By URL I mean the URL path. So, for
>> example, if my Cake app can be reached at
>> http://my.domain/subdir/cake/, then this constant would be
>> '/subdir/cake'.
>>
>>

-- 
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/groups/opt_out.


Re: constant for base app URL?

2014-01-31 Thread Reuben
To get a full URL, you can use Router::url('/', true).  That will give you 
the full URL to the application.

For applications running behind a load balancer, you may wish to specify 
the BASE_URL, but I see you've already found that.

Regards
Reuben Helms

On Monday, 13 March 2006 13:20:32 UTC+10, Dave wrote:
>
> Sorry, I should clarify further. By URL I mean the URL path. So, for
> example, if my Cake app can be reached at
> http://my.domain/subdir/cake/, then this constant would be
> '/subdir/cake'.
>
>

-- 
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/groups/opt_out.


Adding authentication to REST API server?

2014-01-31 Thread Sam
I would like to add authentication to a REST API server developed with 
cakephp. Are there any links or tips that I can use for a start?

-- 
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/groups/opt_out.


Re: constant for base app URL?

2014-01-31 Thread Stephen S
Do you mean the APP_DIR constant?

http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#core-definition-constants

These constants can be useful when working with files for example, when
needing an absolute path APP is good, or even WWW_ROOT / WEBROOT_DIR when
uploading images to a public directory.

Just pr() each of these constants and if you'll see the output... If you're
not sure what the use is, it's likely you don't need to use it right now.

p.s. I often use these constant with Configure::write() to define new paths
for use within my application.


On 31 January 2014 06:54, Sayam Abbas  wrote:

> what is the use of APP_URL costant?
>
>  --
> 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/groups/opt_out.
>



-- 
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/groups/opt_out.


Re: constant for base app URL?

2014-01-31 Thread Sayam Abbas
what is the use of APP_URL costant?

-- 
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/groups/opt_out.


CakePHP's naming conventions on hasMany through (The Join Model)

2014-01-31 Thread Sam Clauw
After struggling with this inconvenience for a couple of weeks now, I've 
decided to open en now topic here. A topic that can help me, but I'm sure 
it will help some others with this same problem too!

I wonder how I should name the tables, controllers and models of a hasMany 
through table (thus with additional fields) and it's coupled tables. I 
tried to stick on the CakePHP naming conventions as discribed in it's 
cookbook, but this constantly gave me some "Object not found" errors. For 
practical reason, I'll show you my problem with a many-words table. Perhaps 
that could be the reason of the problem? ;)

*Situation*

I have a fansite of a themepark and as you now, a themepark has many 
attractions. To ride an attraction, you must have a minimal height. 
Sometimes, small people can only ride it with an adult companion. But most 
of the time: you are allowed to ride the attraction because you just are 
tall enough ;)
Now I want to show the information of a specific attraction on my website. 
Name, content, photos, and so on. In addition to that information, I want 
to display my guests if they (or their kids) are tall enough to ride that 
attraction. It should appear like this way:

0m00 -> 1m00: not allowed
1m00 -> 1m30: allowed with an adult companion
1m30 -> 1m90: allowed

*Database*

I have two tables that are representing two objects: "attractions" & 
"attraction_accessibilities". In this case, I'm 100% sure the database 
names are correct. Secondly, I should have another table between 
"attractions" and "attraction_accessibilities". This table should contain:


   - an id specific for each record
   - a link to the id of the "attractions" table (attraction_id)
   - a link to the id of the "attraction_accessibilities" table 
   (attraction_accessibility_id)
   - the additional information like "min-height" and "max-height"

I *think* I should name that table 
"attraction_accessibilities_attractions". It's a constriction of the two 
other tables, and I did it that way because CakePHP proposed it when you're 
making a HABTM association (
http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#hasandbelongstomany-habtm).

But unfortunately, when I do call it that way, I've never succeeded to link 
those models in my application together.

*Question*

Is there anybody who've had the same problem but found a solution for it? 
If "yes": how should I name my database tables then and also important: how 
should I name my controller and model .php files?
Many thanks for the one who could help me and some other hopeless 
programmers ;)

-- 
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/groups/opt_out.