Re: How I can create two instances in Cake?

2007-08-14 Thread wahyu setianto
you must place you application in app/plugins,

app/plugins/project1 and app/plugins/project2, every application in plugins
folder has controller, model and view for itself. I solved this case with
this solution, so some application managed easily in single Cake
environment.

On 8/15/07, Rahul <[EMAIL PROTECTED]> wrote:
>
>
> Thanx Ketan
>
> Well I had done exactly what U have said. My question is beyond that
> work. I need to redirect my browser to these two different
> applications by say http://localhost/project1 for the first
> application and http://localhost/project2 fro the second application..
>
> Hope U understand what I mean to say..
>
> Regards
> Rahul
>
>
> >
>


-- 
Octopus
East Java Baker

--~--~-~--~~~---~--~~
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 I can create two instances in Cake?

2007-08-14 Thread Rahul

Thanx Ketan

Well I had done exactly what U have said. My question is beyond that
work. I need to redirect my browser to these two different
applications by say http://localhost/project1 for the first
application and http://localhost/project2 fro the second application..

Hope U understand what I mean to say..

Regards
Rahul


--~--~-~--~~~---~--~~
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: Several problems with the Cake 1.2 Auth Component

2007-08-14 Thread Dr. Tarique Sani

On 8/15/07, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
> it's the action you go to when you are denied (at least is how my mind
> remembers it)
>

Which itself should be denied - else the login code in the auth
component does not execute

T

-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.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
-~--~~~~--~~--~--~---



how to pivot a table in a function in controller?

2007-08-14 Thread Wimg

how to pivot a table ?

change
a b
1 2
3 4
5 6


to


c d e
1 3 5
2 4 6
?


--~--~-~--~~~---~--~~
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: IS-A relations, Generalization

2007-08-14 Thread Pablo Viojo

Francisco (?),

I think Single Table Inheritance is what you're looking for. Try these
articles [1] [2] [3]

Regards,

-- 
Pablo Viojo
[EMAIL PROTECTED]
http://pviojo.net

[1] 
http://www.ifisgeek.com/tutorials/implementing_single_table_inheritance_in_cakephp
[2] http://www.ifisgeek.com/2006/08/19/the_joys_of_single_table_inheritance/
[3] 
http://webrocket.wordpress.com/2007/05/16/discovering-single-table-inheritance/



On 8/14/07, fcojaviermu <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I'm not sure of how can I implement in cakephp a "Is-A" Relation or in
> other words: Generalization/specialization
>
> For example, let's say I want to represent different kinds of
> accommodation such as hotels, appartments, bungalows,countryside
> hotel, inns  and some others.
>
>
> They would share common information like: town, email, phone
> number,etc
>
>
> If I had to do without cakephp, I would  use one "accomodation" table
> with common information and a specilization field, from which i could
> now what table inspect next in order to get the especific fields of
> every kind.
>
>
> But how can I do this in cakephp?, I mean, does scaffold and bake know
> how to handle this automatically?
>
>
> 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: Several problems with the Cake 1.2 Auth Component

2007-08-14 Thread Samuel DeVore

it's the action you go to when you are denied (at least is how my mind
remembers it)


On 8/14/07, Dr. Tarique Sani <[EMAIL PROTECTED]> wrote:
>
> On 8/14/07, rnpg1014 <[EMAIL PROTECTED]> wrote:
> >
> > function beforeFilter() {
> > $this->Auth->allow('login', 'register', 'recover');
>
> login should be a denied action - there is some twisted reasoning for
> it but it ultimately makes sense
>
> T
>
>
>
> --
> =
> Cheesecake-Photoblog: http://cheesecake-photoblog.org
> PHP for E-Biz: http://sanisoft.com
> =
>
> >
>


-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

--~--~-~--~~~---~--~~
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: Can I access database or execute some sql inside views ?

2007-08-14 Thread Wimg

one more question , how to pivot a table in controller?

change this table
a  b
1  2
3  4
5  6

to

c d f
1 3 5
2 4 6


--~--~-~--~~~---~--~~
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: Autocomplete in 1.2?

2007-08-14 Thread CakeSpork

I followed the tutorial today and it seemed to work... The comments
scared me a little but it seemed like a good place to start and it
seems to work, I'll fill the holes later I guess. I don't remember
doing anything different from that bakery article.

On 18 jun, 22:16, Mech7 <[EMAIL PROTECTED]> wrote:
> Can anybody post a small example how it is suposed to work in 1.2?
>
> When i use:
>
> Add Post
> link('Articles', 'index');?>
> autoComplete('title'); ?>
> end('Add Article'); ?>
>
> In my view, then it does a post with every key i type.. so it saves
> hundreds of entries :)


--~--~-~--~~~---~--~~
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: Can I access database or execute some sql inside views ?

2007-08-14 Thread Wimg

how to pivot a table ?

change
a b
1 2
3 4
5 6

to

c d e
1 3 5
2 4 6
?


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



Security component allowedActions and allowedControllers

2007-08-14 Thread joe

greetings,

i'm using the current stable release (1.1.16.5421).  i'm having some
issues with the Security component, all my posts get blackholed.

upon further investigation i found that allowedActions and
allowedControllers never get any data.  i tried to find where exactly
cake gets $this->allowedActions and $this->allowedControllers but the
only place the API showed those properties are int the Security
component.

any takers?


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



so many memory used when runing CAKEPHP

2007-08-14 Thread [EMAIL PROTECTED]

hi all

here is  Apaceh + Mysql + Cakephp in windows platform,
Apache started with 23M memory,

but when launch my Cakephp project and after 50 page-view (click
Refresh button on one page for 50 time )

that memory for Apache will up to 130M,

why?and how should i do?


--~--~-~--~~~---~--~~
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: Several problems with the Cake 1.2 Auth Component

2007-08-14 Thread Dr. Tarique Sani

On 8/14/07, rnpg1014 <[EMAIL PROTECTED]> wrote:
>
> function beforeFilter() {
> $this->Auth->allow('login', 'register', 'recover');

login should be a denied action - there is some twisted reasoning for
it but it ultimately makes sense

T



-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.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: Can I access database or execute some sql inside views ?

2007-08-14 Thread Wimg

really helps me a lot , thx


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



IS-A relations, Generalization

2007-08-14 Thread fcojaviermu

Hello,

I'm not sure of how can I implement in cakephp a "Is-A" Relation or in
other words: Generalization/specialization

For example, let's say I want to represent different kinds of
accommodation such as hotels, appartments, bungalows,countryside
hotel, inns  and some others.


They would share common information like: town, email, phone
number,etc


If I had to do without cakephp, I would  use one "accomodation" table
with common information and a specilization field, from which i could
now what table inspect next in order to get the especific fields of
every kind.


But how can I do this in cakephp?, I mean, does scaffold and bake know
how to handle this automatically?


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: query problems

2007-08-14 Thread Langdon Stevenson

Hi rtanz

In your query you don't need to specify the relationship:

  AND Membership.role_id = TaskTemplate.role_id

If you have this relation defined between the Membership, Role, and Task 
models, then Cake will retrieve the related data for you (assuming you 
allow it to retrieve related data two levels down).

Just select the Membership that you want and Cake will do the rest.

If for some reason this produces too many queries for your liking, 
Google the "expects()" function to help unbind unneeded models, or as a 
last resort run the query from MySQL using $this->ModelName->query();

Regards,
Langdon


rtanz wrote:
> hi i am having problems obtaining results for a query through cakephp,
> i posted the relevant code in this link
> http://bin.cakephp.org/view/1874003220
> 
> note that the first part is the query as constructed through the mysql
> query builder which correctly returns the results, while the second
> part is what i did through cake, which is not returning any results.
> 
> thanks for any help

--~--~-~--~~~---~--~~
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: Is it reasonably easy to do this sort of inline editing with CakePHP

2007-08-14 Thread walterbyrd



On Aug 6, 3:58 pm, nate <[EMAIL PROTECTED]> wrote:
> through Aqua.  And with VLC, it's not about "installing yet another
> player".  IMO, VLC is *the* media player, even on OSX.
>

But, as far as I can tell: VLC does not work as a firefox plugin; and
the cakephp screencasts can not be downloaded. So for me, there is no
way to watch the screencasts. BTW: you do realize that apple changed
everything last July?


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



query problems

2007-08-14 Thread rtanz

hi i am having problems obtaining results for a query through cakephp,
i posted the relevant code in this link
http://bin.cakephp.org/view/1874003220

note that the first part is the query as constructed through the mysql
query builder which correctly returns the results, while the second
part is what i did through cake, which is not returning any results.

thanks for any help


--~--~-~--~~~---~--~~
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: 1.2 Authentication

2007-08-14 Thread francky06l

I also add my experience with Auth component :
http://groups.google.com/group/cake-php/browse_thread/thread/deb393fc04849829/1e83613ea09bbac3?lnk=gst&q=auth+francky06l&rnum=1#1e83613ea09bbac3

I haven't tested the empty password but will try soon.

I had to set some work around, but you can post an enhancement ticket
on trac :-)


On Aug 14, 11:38 pm, thebrillopuff <[EMAIL PROTECTED]> wrote:
> I was having the hardest time getting Auth and ACL working in the
> latest Cake 1.2.  The several helpful tutorials I found got me set up
> but then I ran into a problem.  Any login data (username and password)
> would authenticate, even if it was blank!
>
> I dug around in the Auth component and found what was causing the
> problem.  The startup function of the component was recognizing it was
> on the login page automatically like i wanted and then passing the
> inputted data to the login function.  The login function then calls
> the identify function which returns the user or null if there is an
> error.  Identify was returning a user even on empty data.
>
> The identify function (simplified) works like this:
>
> if(user is array) {
>  if(user in form user[fieldname] {
>   if(user is blank or password is blank) {
>return false;
>   }
>   create find conditions
>  } else if( user in form user[user.fieldname] {
>   if(user is blank or password is blank) {
>return false;
>   }
>   create find conditions
>  }
> user = find
>
> }
>
> I knew that when I entered a blank username and password I was
> reaching that return false code after checking that that the username
> was blank, but it wasn't returning out of the function.  What it would
> do is just exit the if statement without setting the find conditions.
> The find conditions would then be an empty array and would
> authenticate on my userScope, pulling the first active user.
>
> To fix this I added an else statement to the if else group that checks
> the form of the user input.
>
> if(user in form user[fieldname]) {
>   ...
>
> } else if(user in form user[user.fieldname]) {
>  ...
> } ELSE {
>   return null;
> }
>
> Then when it finds a blank username or password it returns false,
> control then enters the new else statement which returns null out of
> identify, failing login as expected.
>
> Maybe someone can better explain why the return false in the if
> statement that checks to see if the username or password is blank
> doesn't return out of the function, but this worked for me.
>
> Another couple weird things I noticed.
>
> 1) The startup controller adds an equal sign before fields when saving
> them to the data array, so $data[User.login] = '= username';  And then
> the checks look for a an equal sign to see if the username is blank,
> it seems redundant and you could just check for empty if it was a
> blank string.
>
> 2) The automatic login worked for me, but like Brian in his super
> helpful 
> guidehttp://realm3.com/articles/setting_up_users_groups_withacl_and_auth_i...
> , the flash notification wasn't working.  This is because the setFlash
> isn't keyed to the default 'flash', getting rid of the specific keying
> works, or you can set your layout to look for the proper key.  I just
> changed mine to $this->Session->setFlash($this->loginError); There
> isn't a flash set for a successful login, this would be simple to add
> to the component just another var set, but for now I just use user
> login function to handle it.
>
> function login() {
> if($this->Session->check('AuthenticatedUser')) {
> $this->Session->setFlash('You are already logged in.');
> $this->redirect('/admin', null, true);
> } else {
> if(!empty($this->data)){
> if($this->Auth->login()) {
> $this->Session->setFlash('Login successful.');
> }
> }
> }
>
> }
>
> 3) Mentioned before but in the setDefaults function it incorrectly
> checks to see if logoutAction is set instead of checking for
> logoutRedirect.
>
> Anyway that's my first foray into understanding the 1.2 Auth
> component, hope it helps =D.
>
> -thebrillopuff


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



1.2 Authentication

2007-08-14 Thread thebrillopuff

I was having the hardest time getting Auth and ACL working in the
latest Cake 1.2.  The several helpful tutorials I found got me set up
but then I ran into a problem.  Any login data (username and password)
would authenticate, even if it was blank!

I dug around in the Auth component and found what was causing the
problem.  The startup function of the component was recognizing it was
on the login page automatically like i wanted and then passing the
inputted data to the login function.  The login function then calls
the identify function which returns the user or null if there is an
error.  Identify was returning a user even on empty data.

The identify function (simplified) works like this:

if(user is array) {
 if(user in form user[fieldname] {
  if(user is blank or password is blank) {
   return false;
  }
  create find conditions
 } else if( user in form user[user.fieldname] {
  if(user is blank or password is blank) {
   return false;
  }
  create find conditions
 }
user = find
}

I knew that when I entered a blank username and password I was
reaching that return false code after checking that that the username
was blank, but it wasn't returning out of the function.  What it would
do is just exit the if statement without setting the find conditions.
The find conditions would then be an empty array and would
authenticate on my userScope, pulling the first active user.

To fix this I added an else statement to the if else group that checks
the form of the user input.

if(user in form user[fieldname]) {
  ...
} else if(user in form user[user.fieldname]) {
 ...
} ELSE {
  return null;
}

Then when it finds a blank username or password it returns false,
control then enters the new else statement which returns null out of
identify, failing login as expected.

Maybe someone can better explain why the return false in the if
statement that checks to see if the username or password is blank
doesn't return out of the function, but this worked for me.

Another couple weird things I noticed.

1) The startup controller adds an equal sign before fields when saving
them to the data array, so $data[User.login] = '= username';  And then
the checks look for a an equal sign to see if the username is blank,
it seems redundant and you could just check for empty if it was a
blank string.

2) The automatic login worked for me, but like Brian in his super
helpful guide 
http://realm3.com/articles/setting_up_users_groups_withacl_and_auth_in_cake_1.2.php
, the flash notification wasn't working.  This is because the setFlash
isn't keyed to the default 'flash', getting rid of the specific keying
works, or you can set your layout to look for the proper key.  I just
changed mine to $this->Session->setFlash($this->loginError); There
isn't a flash set for a successful login, this would be simple to add
to the component just another var set, but for now I just use user
login function to handle it.

function login() {
if($this->Session->check('AuthenticatedUser')) {
$this->Session->setFlash('You are already logged in.');
$this->redirect('/admin', null, true);
} else {
if(!empty($this->data)){
if($this->Auth->login()) {
$this->Session->setFlash('Login successful.');
}
}
}
}

3) Mentioned before but in the setDefaults function it incorrectly
checks to see if logoutAction is set instead of checking for
logoutRedirect.

Anyway that's my first foray into understanding the 1.2 Auth
component, hope it helps =D.

-thebrillopuff


--~--~-~--~~~---~--~~
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: SSL support through .htaccess

2007-08-14 Thread francky06l

rewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*) http://yoursite/shared_ssl_subdir [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]


Just a hint .. I actually do the opposit for one site ...

On Aug 14, 2:53 pm, "lalit kumar" <[EMAIL PROTECTED]> wrote:
> hi,
>
> How can i implement this in my site.
>
> i wanna to redirect the different url when  port 443(https) is is occur in
> the url through htaccess.
>
> We have recently switched to Drupal from a proprietary content management
> system for a lot of client projects. Shared SSL support is a big cost saver
> for clients, and our old system dealt with it fairly elegantly. The tricky
> part from a mod_rewrite perspective is the fact that you can't have more
> than one RewriteBase. However I was able to get around this by stripping the
> base if the port is 80. This should help, but true, robust secure pages
> support in Drupal may require core changes...
> # ALL EXCEPT SOME FILE EXTENSIONS TO "index.php" FILE.
> RewriteBase /shared_ssl_subdir
> RewriteCond %{SCRIPT_FILENAME} !-f
> RewriteCond %{SCRIPT_FILENAME} !-d
> RewriteRule .* index.php
>
> # STRIP THE REWRITEBASE RULE FROM NON-SSL CONNECTIONS.
> RewriteCond %{SERVER_PORT} 80
> RewriteCond %{REQUEST_URI} ^/shared_ssl_subdir
> RewriteRule .* /index.php
>
> --
> Lalit Kumar
> Software Engg.
> Netsolutions
> Chandigarh
> 09888711687


--~--~-~--~~~---~--~~
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: Model "inheritance"?

2007-08-14 Thread rtconner

you'll need to put loadModel at top of files also, just in case Class
is not available.

On Aug 14, 3:32 pm, "Pablo Viojo" <[EMAIL PROTECTED]> wrote:
> In short, use PHP OO inheritance
>
> Let's say
>
> class Model1 extends CommonFunctionalityModel{
> 
>
> }
>
> class CommonFunctionalityModel extends AppModel{
> //common functionality to some of your models
>
> }
>
> --
> Pablo Viojo
> [EMAIL PROTECTED]://pviojo.net
>
> On 8/14/07, tinder01 <[EMAIL PROTECTED]> wrote:
>
>
>
> > Fairly new user with Cake, been experimenting with it for a couple of
> > days, now about ready to get some real work done - I'm currently using
> > the inheritance feature included in Postgresql 8.1. My database
> > contains several hundred tables inheriting from a set of parent
> > tables. Since I'd rather not implement and maintain several hundred
> > models and controllers, is there someway to implement some sort of
> > inheritance architecture to Models so that any changes made to a
> > "parent model" automatically propagates to "child models"? I'm mainly
> > concerned with data validation as well as custom view code associated
> > with shared columns.
>
> > Thanks.
>
> > -Ben


--~--~-~--~~~---~--~~
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: Autocomplete in 1.2?

2007-08-14 Thread Mech7

Here is what i have: article_controller.php

/**
 * Renders unorderd list for autocomplete tags
 *
 */
function autocompleteTags ()
{
// Set tags var
$this->set('tags',
// Get all tags which start whith same characters
$this->Tag->findAll("tag LIKE '{$this->data['Tag']['tag']}%' 
LIMIT
30"));
// Use ajax layout
$this->layout = "ajax";
}


autocomplete_tags.ctp







And in my add view i call the autocomplete:


new 
Ajax.Autocompleter('TagTag',
'TagTag_autoComplete',
'webroot;?>/articles/autocompleteTags',
{afterUpdateElement:addExistingTags, 
indicator:'spinner'});





On Aug 14, 11:11 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> umm... anyone have a solution and want to share? i too am having
> problems with cakephp 1.2 with autocomplete
>
> On Jun 25, 12:11 am, "Jonathan Langevin" <[EMAIL PROTECTED]> wrote:
>
> > When I attempt it, I'm seeing autocomplete=off as well. What did you do to
> > fix this issue?
>
> > On 6/24/07, Mech7 <[EMAIL PROTECTED]> wrote:
>
> > > Ok i have it working i made a little error :D
>
> > > But how can i get it to work like the example on scriptaculous:
> > >http://demo.script.aculo.us/ajax/autocompleter
> > > Here you can use the arrow buttons to select a value which is not on
> > > default with the helper :(


--~--~-~--~~~---~--~~
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: Model "inheritance"?

2007-08-14 Thread Pablo Viojo

In short, use PHP OO inheritance

Let's say

class Model1 extends CommonFunctionalityModel{

}

class CommonFunctionalityModel extends AppModel{
//common functionality to some of your models
}

-- 
Pablo Viojo
[EMAIL PROTECTED]
http://pviojo.net



On 8/14/07, tinder01 <[EMAIL PROTECTED]> wrote:
>
> Fairly new user with Cake, been experimenting with it for a couple of
> days, now about ready to get some real work done - I'm currently using
> the inheritance feature included in Postgresql 8.1. My database
> contains several hundred tables inheriting from a set of parent
> tables. Since I'd rather not implement and maintain several hundred
> models and controllers, is there someway to implement some sort of
> inheritance architecture to Models so that any changes made to a
> "parent model" automatically propagates to "child models"? I'm mainly
> concerned with data validation as well as custom view code associated
> with shared columns.
>
> Thanks.
>
> -Ben
>
>
> >
>

--~--~-~--~~~---~--~~
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: Autocomplete in 1.2?

2007-08-14 Thread [EMAIL PROTECTED]

umm... anyone have a solution and want to share? i too am having
problems with cakephp 1.2 with autocomplete

On Jun 25, 12:11 am, "Jonathan Langevin" <[EMAIL PROTECTED]> wrote:
> When I attempt it, I'm seeing autocomplete=off as well. What did you do to
> fix this issue?
>
> On 6/24/07, Mech7 <[EMAIL PROTECTED]> wrote:
>
>
>
> > Ok i have it working i made a little error :D
>
> > But how can i get it to work like the example on scriptaculous:
> >http://demo.script.aculo.us/ajax/autocompleter
> > Here you can use the arrow buttons to select a value which is not on
> > default with the helper :(


--~--~-~--~~~---~--~~
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: Find Condition Problem

2007-08-14 Thread Pablo Viojo

Try:

$this->Country->find(array('LangCountry.id' => 1, 'Country.id' =>
1);

(Note LangCountry instead of LangCountries)

-- 
Pablo Viojo
[EMAIL PROTECTED]
http://pviojo.net




On 8/14/07, starkey <[EMAIL PROTECTED]> wrote:
>
> Because LangCountry belongsTo Country the find should pull associated
> records.  Try setting the recursive parameter to 1.
>
> Shawn
>
> On Aug 14, 2:21 pm, farphadet <[EMAIL PROTECTED]> wrote:
> > Thanks for the reponse, but is not the solution. I want the
> > informations in according to the Language too.
> >
> > On 14 août, 19:10, starkey <[EMAIL PROTECTED]> wrote:
> >
> > > Try this in your controller:
> >
> > > $data = $this->Country->find('id = ' . $id); // where $id is your
> > > country id
> > > pr($data);
> >
> > > Shawn
> >
> > > On Aug 14, 11:28 am, farphadet <[EMAIL PROTECTED]> wrote:
> >
> > > > Hy
> >
> > > > I have this 3 models, and i try to retreive all informations about a
> > > > country
> > > > according to the id of a country, and according to a language id (to
> > > > get the
> > > > name of the country in the correct language).
> >
> > > > In my countries controller :
> >
> > > > $this->Country->find(array('LangCountries.id' => 1, 
> > > > 'Country.id' =>
> > > > 1);
> >
> > > > Bu t This doesn't work, it send me an error, because LangCountries is
> > > > unknown.
> >
> > > > This is my models :
> >
> > > > class Currency extends AppModel {
> > > > var $name = 'Currency';
> > > > var $hasMany = array('Country');
> >
> > > > }
> >
> > > > class Country extends AppModel {
> >
> > > >   var $name = 'Country';
> > > >   var $belongsTo = array('Currency');
> > > >   var $hasMany = array('LangCountry');
> >
> > > > }
> >
> > > > class LangCountry extends AppModel {
> >
> > > >   public $name = 'LangCountry';
> > > >   public $belongsTo = array('Country');
> >
> > > > }
> >
> > > > This is my tables in Database:
> >
> > > >Table "public.countries"
> > > > Column|  Type  |
> > > > Modifiers
> > > > --+
> > > > +
> > > >  id   | integer| not null default
> > > > nextval('countries_id_seq'::regclass)
> > > >  currency_id  | integer|
> > > >  countries_iso_code_2 | character varying(255) |
> > > >  countries_iso_code_3 | character varying(255) |
> > > >  tel_regexp   | character varying(255) |
> > > >  zip_code_regexp  | character varying(255) |
> > > > Indexes:
> > > > "countries_pkey" PRIMARY KEY, btree (id)
> > > > Foreign-key constraints:
> > > > "currencies_id_fkey" FOREIGN KEY (currency_id) REFERENCES
> > > > currencies(id)
> >
> > > >  Table "public.currencies"
> > > >  Column |  Type  |
> > > > Modifiers
> > > > +
> > > > +-
> > > >  id | integer| not null default
> > > > nextval('currencies_id_seq'::regclass)
> > > >  title  | character varying(255) |
> > > >  code   | character varying(255) |
> > > >  symbol | character varying(255) |
> > > > Indexes:
> > > > "currencies_pkey" PRIMARY KEY, btree (id)
> >
> > > >Table "public.lang_countries"
> > > >Column   |  Type  |
> > > > Modifiers
> > > > +
> > > > +-
> > > >  id | integer| not null default
> > > > nextval('lang_countries_id_seq'::regclass)
> > > >  country_id | integer|
> > > >  name   | character varying(255) |
> > > >  diminutive | character varying(255) |
> > > > Indexes:
> > > > "lang_countries_pkey" PRIMARY KEY, btree (id)
> > > > Foreign-key constraints:
> > > > "lang_countries_id_fkey" FOREIGN KEY (country_id) REFERENCES
> > > > countries(id)
>
>
> >
>

--~--~-~--~~~---~--~~
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: uploading files

2007-08-14 Thread Pablo Viojo

As said before:

"You shouldnt put anything else than app/webroot, as they are not, in
theory, accessible by the browser."

Try  using app/webroot/uploads and then the file will be accesible
from http://yoururl/uploads

-- 
Pablo Viojo
[EMAIL PROTECTED]
http://pviojo.net


On 8/14/07, rtanz <[EMAIL PROTECTED]> wrote:
>
> therefore i should be adding my uploads folder in www/cake/app/uploads
> since my /app folder is the main folder where im acessing the site
> i.e. i type localhost/cake/
>
> am i right in that?
>
>
> >
>

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



View this page "Cake Apps/Sites In The Wild"

2007-08-14 Thread rtconner

Added my latest site, Intermountain Anti-Reflective Coating

Click on http://groups.google.com/group/cake-php/web/cake-apps-sites-in-the-wild
- or copy & paste it into your browser's address bar if that doesn't
work.


--~--~-~--~~~---~--~~
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: uploading files

2007-08-14 Thread rtanz

therefore i should be adding my uploads folder in www/cake/app/uploads
since my /app folder is the main folder where im acessing the site
i.e. i type localhost/cake/

am i right in that?


--~--~-~--~~~---~--~~
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: RSS feeds with Cake

2007-08-14 Thread R. Rajesh Jeba Anbiah

On Aug 15, 12:21 am, CakeMan <[EMAIL PROTECTED]> wrote:
> Hello Bakers,
>
> i am developing an blog type of website where i show the aricles
> according to the categories and their subcaegory.
>
> I want to create an RSS feeds based on the categories. Is there any
> component or any thing else in cake with the help of which i can
> create Rss feeds.

* http://groups.google.com/group/cake-php/web/frequent-discussions
* http://groups.google.com/group/cake-php/msg/3baf7b8e7256aae1

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.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: uploading files

2007-08-14 Thread LS

You shouldnt put anything else than app/webroot, as they are not, in
theory, accessible by the browser.
If you create a folder say 'images' in 'app/webroot', you can access
the image 'abc.png' at /images/abc.png

hope it helps.

Regards...

On Aug 5, 11:05 am, rtanz <[EMAIL PROTECTED]> wrote:
> Ok fixed the PEAR problem, now it seems to work without problem,
> however the file is not being uploaded for some reason. Where should i
> be adding the upload folder? Am i correct in putting the folder as
> cake/app/uploads? thanks
>
> View:
>
>  method="post" enctype="multipart/form-data">
> 
> submit('Add');?>
> 
>
> Controller:
>
> function addfile() {
> vendor('Upload');
>
> $upload = new HTTP_Upload("en");
> $file = $upload->getFiles("userfile");
>
> if ($file->isValid()) {
> $moved = $file->moveTo("uploads/");
> if (!PEAR::isError($moved)) {
> $this->flash("File was moved to uploads ", 
> '/uploads/');
> exit;}
> else if (PEAR::isError($moved)) {
> $this->flash("File not successful", null);
> exit;
>
> }
>
> }
>
> }


--~--~-~--~~~---~--~~
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: uploading files

2007-08-14 Thread rtanz

any help on this?


--~--~-~--~~~---~--~~
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: RSS feeds with Cake

2007-08-14 Thread starkey

I've seen some articles in the Bakery on this... you may want to check
there.  For example,
http://bakery.cakephp.org/articles/view/rss-feed-them-cake

Shawn


On Aug 14, 3:21 pm, CakeMan <[EMAIL PROTECTED]> wrote:
> Hello Bakers,
>
> i am developing an blog type of website where i show the aricles
> according to the categories and their subcaegory.
>
> I want to create an RSS feeds based on the categories. Is there any
> component or any thing else in cake with the help of which i can
> create Rss feeds.
>
> 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
-~--~~~~--~~--~--~---



RSS feeds with Cake

2007-08-14 Thread CakeMan

Hello Bakers,

i am developing an blog type of website where i show the aricles
according to the categories and their subcaegory.

I want to create an RSS feeds based on the categories. Is there any
component or any thing else in cake with the help of which i can
create Rss feeds.

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: One Install, Multiple Apps

2007-08-14 Thread starkey

Joel,

That looks like what I need to do.  Fantastic! Thanks!

Shawn

For future reference:
http://manual.cakephp.org/chapter/configuration (section 3)
http://webexpose.org/2007/05/09/cakephp-routes/
http://bakery.cakephp.org/articles/view/custom-urls-from-the-site-root


On Aug 14, 2:52 pm, Joel Stein <[EMAIL PROTECTED]> wrote:
> You could simply make the following controllers:
>
> NewsController
> StoriesController
> AlertsController
> SectionsController
> PollController
> QuestionsController
> AnswersController
>
> And then configure your controller routes in /app/config/routes.php:
>
> Router::connect('/news/stories/:action/*', array('controller' =>
> 'stories'));
> Router::connect('/news/alerts/:action/*', array('controller' =>
> 'alerts'));
> Router::connect('/news/sections/:action/*', array('controller' =>
> 'sections'));
> Router::connect('/poll/questions/:action/*', array('controller' =>
> 'questions'));
> Router::connect('/poll/answers/:action/*', array('controller' =>
> 'answers'));


--~--~-~--~~~---~--~~
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: problem in default.thtml

2007-08-14 Thread [EMAIL PROTECTED]

Thanks Chris,

I will review my code and will let u know if i got something to ask.

Thanks again !!!

On Aug 14, 11:53 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 8/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > Thanks Chris,
> > can we use requestAction()  in the default.thtml ? and how ?
>
> > if we use something like this view->controller->requestAction()  as i
> > found this in one of the article in the bakery.
>
> > then what  "Controller" means here.
>
> http://groups.google.com/group/cake-php/browse_thread/thread/3563ab54...
>
> --
> Chris Hartjes
> Senior Developer
> Cake Development Corporation
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


--~--~-~--~~~---~--~~
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: One Install, Multiple Apps

2007-08-14 Thread Joel Stein

You could simply make the following controllers:

NewsController
StoriesController
AlertsController
SectionsController
PollController
QuestionsController
AnswersController

And then configure your controller routes in /app/config/routes.php:

Router::connect('/news/stories/:action/*', array('controller' =>
'stories'));
Router::connect('/news/alerts/:action/*', array('controller' =>
'alerts'));
Router::connect('/news/sections/:action/*', array('controller' =>
'sections'));
Router::connect('/poll/questions/:action/*', array('controller' =>
'questions'));
Router::connect('/poll/answers/:action/*', array('controller' =>
'answers'));


--~--~-~--~~~---~--~~
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: problem in default.thtml

2007-08-14 Thread Chris Hartjes

On 8/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Thanks Chris,
> can we use requestAction()  in the default.thtml ? and how ?
>
> if we use something like this view->controller->requestAction()  as i
> found this in one of the article in the bakery.
>
> then what  "Controller" means here.

http://groups.google.com/group/cake-php/browse_thread/thread/3563ab54d59d78ce/a18951f795b99c59?lnk=gst&q=elements+default.thtml&rnum=1#a18951f795b99c59

-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  "Just build it, damnit!"

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: Pagination without model

2007-08-14 Thread Ketan Patel

You will need a model to use the Pagination Function in Cake. However,
to do what you want to do, there are two options:

1. Create your own pagination.
2. Create a model and override the pagination method in there.

If you are familiar with cake, then I would recommend you to go with
Option 2, else option 1 is probably what you want to do.

Cheers,
Ketan

Feris Thia wrote:
> Hi All,
>
> How do I have a custom pagination by sending a subset array of data,
> total count of data, and current page ?
>
> Thanks !
>
> Feris


--~--~-~--~~~---~--~~
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: problem in default.thtml

2007-08-14 Thread [EMAIL PROTECTED]

Thanks Chris,
can we use requestAction()  in the default.thtml ? and how ?

if we use something like this view->controller->requestAction()  as i
found this in one of the article in the bakery.

then what  "Controller" means here.

Pls suggest

On Aug 14, 11:44 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 8/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > Thanks for you reply, sure i need to use the elements but for those
> > elements from where i will get the data extracted from the database.
>
> > For accessing the database for any layout or element we needs to have
> > an controller and model. But for default.thtml's elements from where i
> > can access the controller and models ?
>
> This has already been answered in this mailing list before:
>
> http://groups.google.com/group/cake-php/browse_thread/thread/5d13cf50...
>
> --
> Chris Hartjes
> Senior Developer
> Cake Development Corporation
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


--~--~-~--~~~---~--~~
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: problem in default.thtml

2007-08-14 Thread Chris Hartjes

On 8/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Thanks for you reply, sure i need to use the elements but for those
> elements from where i will get the data extracted from the database.
>
> For accessing the database for any layout or element we needs to have
> an controller and model. But for default.thtml's elements from where i
> can access the controller and models ?

This has already been answered in this mailing list before:

http://groups.google.com/group/cake-php/browse_thread/thread/5d13cf50b352ac34/da0b23aed45c8621?lnk=st&q=elements+default.thtml&rnum=5#da0b23aed45c8621

-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  "Just build it, damnit!"

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: problem in default.thtml

2007-08-14 Thread [EMAIL PROTECTED]

Thanks for you reply, sure i need to use the elements but for those
elements from where i will get the data extracted from the database.

For accessing the database for any layout or element we needs to have
an controller and model. But for default.thtml's elements from where i
can access the controller and models ?

Thanks


On Aug 14, 11:32 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 8/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > I have some menus that are stored in the database. I want to show that
> > menus in all the pages. In other pages we have controllers etc. within
> > those i can use the logic for menus. but how to deal with  that in
> > default.thtml as it does not have any controller.
>
> You want to create elements for those menu items.
>
> * read the manual section on elements
> * go to the amazing IBM tutorial about 
> CakePHPhttp://www-128.ibm.com/developerworks/edu/os-dw-os-php-cake1.html
>
> Register for an IBM id if you do not already have one and go through
> that tutorial.
>
> --
> Chris Hartjes
> Senior Developer
> Cake Development Corporation
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


--~--~-~--~~~---~--~~
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: Find Condition Problem

2007-08-14 Thread starkey

Because LangCountry belongsTo Country the find should pull associated
records.  Try setting the recursive parameter to 1.

Shawn

On Aug 14, 2:21 pm, farphadet <[EMAIL PROTECTED]> wrote:
> Thanks for the reponse, but is not the solution. I want the
> informations in according to the Language too.
>
> On 14 août, 19:10, starkey <[EMAIL PROTECTED]> wrote:
>
> > Try this in your controller:
>
> > $data = $this->Country->find('id = ' . $id); // where $id is your
> > country id
> > pr($data);
>
> > Shawn
>
> > On Aug 14, 11:28 am, farphadet <[EMAIL PROTECTED]> wrote:
>
> > > Hy
>
> > > I have this 3 models, and i try to retreive all informations about a
> > > country
> > > according to the id of a country, and according to a language id (to
> > > get the
> > > name of the country in the correct language).
>
> > > In my countries controller :
>
> > > $this->Country->find(array('LangCountries.id' => 1, 'Country.id' 
> > > =>
> > > 1);
>
> > > Bu t This doesn't work, it send me an error, because LangCountries is
> > > unknown.
>
> > > This is my models :
>
> > > class Currency extends AppModel {
> > > var $name = 'Currency';
> > > var $hasMany = array('Country');
>
> > > }
>
> > > class Country extends AppModel {
>
> > >   var $name = 'Country';
> > >   var $belongsTo = array('Currency');
> > >   var $hasMany = array('LangCountry');
>
> > > }
>
> > > class LangCountry extends AppModel {
>
> > >   public $name = 'LangCountry';
> > >   public $belongsTo = array('Country');
>
> > > }
>
> > > This is my tables in Database:
>
> > >Table "public.countries"
> > > Column|  Type  |
> > > Modifiers
> > > --+
> > > +
> > >  id   | integer| not null default
> > > nextval('countries_id_seq'::regclass)
> > >  currency_id  | integer|
> > >  countries_iso_code_2 | character varying(255) |
> > >  countries_iso_code_3 | character varying(255) |
> > >  tel_regexp   | character varying(255) |
> > >  zip_code_regexp  | character varying(255) |
> > > Indexes:
> > > "countries_pkey" PRIMARY KEY, btree (id)
> > > Foreign-key constraints:
> > > "currencies_id_fkey" FOREIGN KEY (currency_id) REFERENCES
> > > currencies(id)
>
> > >  Table "public.currencies"
> > >  Column |  Type  |
> > > Modifiers
> > > +
> > > +-
> > >  id | integer| not null default
> > > nextval('currencies_id_seq'::regclass)
> > >  title  | character varying(255) |
> > >  code   | character varying(255) |
> > >  symbol | character varying(255) |
> > > Indexes:
> > > "currencies_pkey" PRIMARY KEY, btree (id)
>
> > >Table "public.lang_countries"
> > >Column   |  Type  |
> > > Modifiers
> > > +
> > > +-
> > >  id | integer| not null default
> > > nextval('lang_countries_id_seq'::regclass)
> > >  country_id | integer|
> > >  name   | character varying(255) |
> > >  diminutive | character varying(255) |
> > > Indexes:
> > > "lang_countries_pkey" PRIMARY KEY, btree (id)
> > > Foreign-key constraints:
> > > "lang_countries_id_fkey" FOREIGN KEY (country_id) REFERENCES
> > > countries(id)


--~--~-~--~~~---~--~~
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: problem in default.thtml

2007-08-14 Thread Chris Hartjes

On 8/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I have some menus that are stored in the database. I want to show that
> menus in all the pages. In other pages we have controllers etc. within
> those i can use the logic for menus. but how to deal with  that in
> default.thtml as it does not have any controller.

You want to create elements for those menu items.

* read the manual section on elements
* go to the amazing IBM tutorial about CakePHP
http://www-128.ibm.com/developerworks/edu/os-dw-os-php-cake1.html

Register for an IBM id if you do not already have one and go through
that tutorial.

-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  "Just build it, damnit!"

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: Find Condition Problem

2007-08-14 Thread farphadet

Thanks for you response but it's not the solution. I want the result
accordind to a language id too.





On 14 août, 19:10, starkey <[EMAIL PROTECTED]> wrote:
> Try this in your controller:
>
> $data = $this->Country->find('id = ' . $id); // where $id is your
> country id
> pr($data);
>
> Shawn
>
> On Aug 14, 11:28 am, farphadet <[EMAIL PROTECTED]> wrote:
>
> > Hy
>
> > I have this 3 models, and i try to retreive all informations about a
> > country
> > according to the id of a country, and according to a language id (to
> > get the
> > name of the country in the correct language).
>
> > In my countries controller :
>
> > $this->Country->find(array('LangCountries.id' => 1, 'Country.id' =>
> > 1);
>
> > Bu t This doesn't work, it send me an error, because LangCountries is
> > unknown.
>
> > This is my models :
>
> > class Currency extends AppModel {
> > var $name = 'Currency';
> > var $hasMany = array('Country');
>
> > }
>
> > class Country extends AppModel {
>
> >   var $name = 'Country';
> >   var $belongsTo = array('Currency');
> >   var $hasMany = array('LangCountry');
>
> > }
>
> > class LangCountry extends AppModel {
>
> >   public $name = 'LangCountry';
> >   public $belongsTo = array('Country');
>
> > }
>
> > This is my tables in Database:
>
> >Table "public.countries"
> > Column|  Type  |
> > Modifiers
> > --+
> > +
> >  id   | integer| not null default
> > nextval('countries_id_seq'::regclass)
> >  currency_id  | integer|
> >  countries_iso_code_2 | character varying(255) |
> >  countries_iso_code_3 | character varying(255) |
> >  tel_regexp   | character varying(255) |
> >  zip_code_regexp  | character varying(255) |
> > Indexes:
> > "countries_pkey" PRIMARY KEY, btree (id)
> > Foreign-key constraints:
> > "currencies_id_fkey" FOREIGN KEY (currency_id) REFERENCES
> > currencies(id)
>
> >  Table "public.currencies"
> >  Column |  Type  |
> > Modifiers
> > +
> > +-
> >  id | integer| not null default
> > nextval('currencies_id_seq'::regclass)
> >  title  | character varying(255) |
> >  code   | character varying(255) |
> >  symbol | character varying(255) |
> > Indexes:
> > "currencies_pkey" PRIMARY KEY, btree (id)
>
> >Table "public.lang_countries"
> >Column   |  Type  |
> > Modifiers
> > +
> > +-
> >  id | integer| not null default
> > nextval('lang_countries_id_seq'::regclass)
> >  country_id | integer|
> >  name   | character varying(255) |
> >  diminutive | character varying(255) |
> > Indexes:
> > "lang_countries_pkey" PRIMARY KEY, btree (id)
> > Foreign-key constraints:
> > "lang_countries_id_fkey" FOREIGN KEY (country_id) REFERENCES
> > countries(id)


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



Model "inheritance"?

2007-08-14 Thread tinder01

Fairly new user with Cake, been experimenting with it for a couple of
days, now about ready to get some real work done - I'm currently using
the inheritance feature included in Postgresql 8.1. My database
contains several hundred tables inheriting from a set of parent
tables. Since I'd rather not implement and maintain several hundred
models and controllers, is there someway to implement some sort of
inheritance architecture to Models so that any changes made to a
"parent model" automatically propagates to "child models"? I'm mainly
concerned with data validation as well as custom view code associated
with shared columns.

Thanks.

-Ben


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



Several problems with the Cake 1.2 Auth Component

2007-08-14 Thread rnpg1014

I searched around trying to find similar problems but I didn't run
into any. If I missed a relevant discussion, pointing me in their
direction would be much obliged.

The first two problems are both with AuthComponent::Allow(). Here's a
snippet from my Users Controller:

function beforeFilter() {
$this->Auth->allow('login', 'register', 'recover');
$this->set('auth_status', $this->Auth->isAuthorized());
}

The first line is to allow access to certain actions of the users
controller that any user (logged in or not) can access. The second
line sets a variable in my view that is used to determine the contents
of the horizontal menu bar of the default layout (so that I can show
the links "Control Panel" and "Logout" instead of "Login" and
"Register").

The first problem is with the first line. As long as that line is in
the beforeFilter() method, logging in will always be unsucessful,
irrespective of what the user inputs. The solution was to move it to
the beforeFilter() method of the AppController class, which worked.
However, I would prefer to have it set in the UsersController class to
ease maintenance. If anybody has a solution, please share. Here's my
AppController class:

 '*', '');

function beforeFilter() {
if(isset($this->Auth)) {
$this->Auth->loginAction = '/users/login';
$this->Auth->loginRedirect = '/users/manage';
$this->Auth->logoutRedirect = '/';

$this->Auth->allow($this->allowed);
}

$this->Auth->allow('login', 'register', 'recover');
}
}
?>

The second problem comes from the second line of the UsersController's
beforeFilter() method. I wanted to have that line in the
AppController's beforeFilter() method, so it would work for any
controller and any action, but it only works for the root page and
nothing more. Thus, I have to include the same line in all my
controllers. This probably only has to do with my understanding of how
Cake PHP implements the MVC pattern, but an explanation would be
appreciated.

My third and final problem is allowing the home page to those who are
not logged in. I've figured how to grant access to any controller or
any individual action EXCEPT the home page. Again, help appreciated.

Thanks,
-Nick


--~--~-~--~~~---~--~~
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: Find Condition Problem

2007-08-14 Thread farphadet

Thanks for the reponse, but is not the solution. I want the
informations in according to the Language too.

On 14 août, 19:10, starkey <[EMAIL PROTECTED]> wrote:
> Try this in your controller:
>
> $data = $this->Country->find('id = ' . $id); // where $id is your
> country id
> pr($data);
>
> Shawn
>
> On Aug 14, 11:28 am, farphadet <[EMAIL PROTECTED]> wrote:
>
> > Hy
>
> > I have this 3 models, and i try to retreive all informations about a
> > country
> > according to the id of a country, and according to a language id (to
> > get the
> > name of the country in the correct language).
>
> > In my countries controller :
>
> > $this->Country->find(array('LangCountries.id' => 1, 'Country.id' =>
> > 1);
>
> > Bu t This doesn't work, it send me an error, because LangCountries is
> > unknown.
>
> > This is my models :
>
> > class Currency extends AppModel {
> > var $name = 'Currency';
> > var $hasMany = array('Country');
>
> > }
>
> > class Country extends AppModel {
>
> >   var $name = 'Country';
> >   var $belongsTo = array('Currency');
> >   var $hasMany = array('LangCountry');
>
> > }
>
> > class LangCountry extends AppModel {
>
> >   public $name = 'LangCountry';
> >   public $belongsTo = array('Country');
>
> > }
>
> > This is my tables in Database:
>
> >Table "public.countries"
> > Column|  Type  |
> > Modifiers
> > --+
> > +
> >  id   | integer| not null default
> > nextval('countries_id_seq'::regclass)
> >  currency_id  | integer|
> >  countries_iso_code_2 | character varying(255) |
> >  countries_iso_code_3 | character varying(255) |
> >  tel_regexp   | character varying(255) |
> >  zip_code_regexp  | character varying(255) |
> > Indexes:
> > "countries_pkey" PRIMARY KEY, btree (id)
> > Foreign-key constraints:
> > "currencies_id_fkey" FOREIGN KEY (currency_id) REFERENCES
> > currencies(id)
>
> >  Table "public.currencies"
> >  Column |  Type  |
> > Modifiers
> > +
> > +-
> >  id | integer| not null default
> > nextval('currencies_id_seq'::regclass)
> >  title  | character varying(255) |
> >  code   | character varying(255) |
> >  symbol | character varying(255) |
> > Indexes:
> > "currencies_pkey" PRIMARY KEY, btree (id)
>
> >Table "public.lang_countries"
> >Column   |  Type  |
> > Modifiers
> > +
> > +-
> >  id | integer| not null default
> > nextval('lang_countries_id_seq'::regclass)
> >  country_id | integer|
> >  name   | character varying(255) |
> >  diminutive | character varying(255) |
> > Indexes:
> > "lang_countries_pkey" PRIMARY KEY, btree (id)
> > Foreign-key constraints:
> > "lang_countries_id_fkey" FOREIGN KEY (country_id) REFERENCES
> > countries(id)


--~--~-~--~~~---~--~~
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: One Install, Multiple Apps

2007-08-14 Thread starkey

Ketan,

I apologize for not being clear; this is what I meant:

http://www.domain.edu/news/
http://www.domain.edu/news/stories/edit/1
http://www.domain.edu/news/alerts/edit/1
http://www.domain.edu/news/sections/edit/1
http://www.domain.edu/poll/
http://www.domain.edu/poll/questions/edit/1
http://www.domain.edu/poll/answers/edit/1

Where 'news' and 'poll' would be two different applications.

Right now I've got this:

http://www.domain.edu/news/
http://www.domain.edu/news_stories/edit/1
http://www.domain.edu/news_alerts/edit/1
http://www.domain.edu/news_sections/edit/1
http://www.domain.edu/poll/
http://www.domain.edu/poll_questions/edit/1
http://www.domain.edu/poll_answers/edit/1

I am hoping there is a better way.  Thanks!
Shawn


On Aug 14, 2:14 pm, Ketan Patel <[EMAIL PROTECTED]> wrote:
> Shawn,
>
> I think you have to read the manual first. Edit is not a controller,
> it is an action for the controller. So for your case, poll, news are
> the controller.
>
> Cheers,
> Ketan
>
> starkey wrote:
> > On Aug 14, 11:13 am, Joel Stein <[EMAIL PROTECTED]> wrote:
> > > Why not just make these all in one application, but with several
> > > controllers?  Then you can tie them together with AppController.
>
> > Thanks for your reply. I don't think I can because I need my URLs to
> > be similar to:
> >http://www.domain.edu/news/edit/1
> >http://www.domain.edu/poll/edit/1
>
> > Can I have two "edit" controllers/views if everything is in one
> > application?  Would you have a moment to explain how?  I sure would
> > appreciate it!  Keep in mind that there are about a dozen programs
> > planned so putting all "edit" logic in one controller would not be
> > practical.
>
> > Thanks!
> > Shawn


--~--~-~--~~~---~--~~
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: One Install, Multiple Apps

2007-08-14 Thread MrTufty

Shawn,

As Ketan says, you've slightly misunderstood how Cake's URLs map to
controllers.

In your case:
/news/edit/1
would point to (unless using routing to achieve a different result):
News Controller > Edit Action > Parameter 1 (whether that's an
article, or an item, or whatever)

/poll/edit/1
would point to: Poll Controller > Edit Action > Parameter 1

There's more to it, but that's the core of URLs in Cake.

Steve

On Aug 14, 7:14 pm, Ketan Patel <[EMAIL PROTECTED]> wrote:
> Shawn,
>
> I think you have to read the manual first. Edit is not a controller,
> it is an action for the controller. So for your case, poll, news are
> the controller.
>
> Cheers,
> Ketan
>
> starkey wrote:
> > On Aug 14, 11:13 am, Joel Stein <[EMAIL PROTECTED]> wrote:
> > > Why not just make these all in one application, but with several
> > > controllers?  Then you can tie them together with AppController.
>
> > Thanks for your reply. I don't think I can because I need my URLs to
> > be similar to:
> >http://www.domain.edu/news/edit/1
> >http://www.domain.edu/poll/edit/1
>
> > Can I have two "edit" controllers/views if everything is in one
> > application?  Would you have a moment to explain how?  I sure would
> > appreciate it!  Keep in mind that there are about a dozen programs
> > planned so putting all "edit" logic in one controller would not be
> > practical.
>
> > Thanks!
> > Shawn


--~--~-~--~~~---~--~~
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 can I updated table using checkboxes and button

2007-08-14 Thread Ketan Patel

Do pr($this->data) in your controller action after you post the form,
this will give you all the information about what variables you have
available to save. Start from there.

Cheers,
Ketan
http://www.eclassifieds4u.com

nirmal wrote:
> Hi,
>
> I want to update a column in table using checkboxes and button.
> I have a template it showing me table data with checkboxes.
> When i will select checkbox and then i will click on a button. I want
> to update all the values for selected checkboxes.
>
> Please help me its urgent.
>
> --
> Nirmal


--~--~-~--~~~---~--~~
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 I can create two instances in Cake?

2007-08-14 Thread Ketan Patel

What you are looking for is, two applications and a single cake
installation. This is what is told in the manual. You will need two
separate 'APP' directories for two separate 'APPLICATIONS' and a
common cake folder. In the two separate app, you have individual
webroot directories, which you can modify at your free will without
affecting the other app.

Cheers,
Ketan
http://www.eclassifieds4u.com

Rahul wrote:
> Hi
>
> Suppose I have to do two different project in a single Cake
> environment.
> Then what modifications are needed ..
> ..and where these modifications should be...
> ..if I want to create two different instances in one CakePHP
> framework.
> Please help me out of this issue...!!
> I dont want to change the "documentroot" or the .htaccess file each
> and every time.
> What I need to do is just type
> http://localhost/project1 for the first one and
> http://localhost/project1 for the 2nd
>
> Regards
> Rahul


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



problem in default.thtml

2007-08-14 Thread [EMAIL PROTECTED]

hi,
can anyone help me out. Really i am getting very frustrated  with
this.

I have some menus that are stored in the database. I want to show that
menus in all the pages. In other pages we have controllers etc. within
those i can use the logic for menus. but how to deal with  that in
default.thtml as it does not have any controller.

Also i have to use two models say model1 and model2 to use for
extracting those menus.

Pls help

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



Yet another checkbox question (v1.1)

2007-08-14 Thread starkey

Hello all,

In the view, if I set the value to 0 (zero) the checkbox displays as
populated.  For example, I have this:

echo $html->checkbox('Model/column', null, array('value'=>$ind)); //
ind == 0

then the checkbox will display as checked because the below (from
html.php helper) evaluates to true (note the == instead of ===):

$htmlAttributes['checked'] = ($htmlAttributes['value'] == $value) ?
'checked' : null;

This doesn't seem like it is correct to me...  I didn't see anything
in the API that really defines how to set it checked/unchecked using
the htmlAttributes['value'] element.

Is it worth sending the value in the checkbox method call?  I noticed
that it will populate the checkbox correctly if I do not send the
value, however, I do not know how expensive the below code is (that
populates the checkbox):

$model = new $this->model;
$db =& ConnectionManager::getDataSource($model->useDbConfig);
$value = $db->boolean($value);
$htmlAttributes['checked'] = $value ? 'checked' : null;


--~--~-~--~~~---~--~~
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: One Install, Multiple Apps

2007-08-14 Thread Ketan Patel

Shawn,

I think you have to read the manual first. Edit is not a controller,
it is an action for the controller. So for your case, poll, news are
the controller.

Cheers,
Ketan

starkey wrote:
> On Aug 14, 11:13 am, Joel Stein <[EMAIL PROTECTED]> wrote:
> > Why not just make these all in one application, but with several
> > controllers?  Then you can tie them together with AppController.
>
> Thanks for your reply. I don't think I can because I need my URLs to
> be similar to:
> http://www.domain.edu/news/edit/1
> http://www.domain.edu/poll/edit/1
>
> Can I have two "edit" controllers/views if everything is in one
> application?  Would you have a moment to explain how?  I sure would
> appreciate it!  Keep in mind that there are about a dozen programs
> planned so putting all "edit" logic in one controller would not be
> practical.
>
> Thanks!
> Shawn


--~--~-~--~~~---~--~~
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: Find Condition Problem

2007-08-14 Thread starkey

Try this in your controller:

$data = $this->Country->find('id = ' . $id); // where $id is your
country id
pr($data);

Shawn


On Aug 14, 11:28 am, farphadet <[EMAIL PROTECTED]> wrote:
> Hy
>
> I have this 3 models, and i try to retreive all informations about a
> country
> according to the id of a country, and according to a language id (to
> get the
> name of the country in the correct language).
>
> In my countries controller :
>
> $this->Country->find(array('LangCountries.id' => 1, 'Country.id' =>
> 1);
>
> Bu t This doesn't work, it send me an error, because LangCountries is
> unknown.
>
> This is my models :
>
> class Currency extends AppModel {
> var $name = 'Currency';
> var $hasMany = array('Country');
>
> }
>
> class Country extends AppModel {
>
>   var $name = 'Country';
>   var $belongsTo = array('Currency');
>   var $hasMany = array('LangCountry');
>
> }
>
> class LangCountry extends AppModel {
>
>   public $name = 'LangCountry';
>   public $belongsTo = array('Country');
>
> }
>
> This is my tables in Database:
>
>Table "public.countries"
> Column|  Type  |
> Modifiers
> --+
> +
>  id   | integer| not null default
> nextval('countries_id_seq'::regclass)
>  currency_id  | integer|
>  countries_iso_code_2 | character varying(255) |
>  countries_iso_code_3 | character varying(255) |
>  tel_regexp   | character varying(255) |
>  zip_code_regexp  | character varying(255) |
> Indexes:
> "countries_pkey" PRIMARY KEY, btree (id)
> Foreign-key constraints:
> "currencies_id_fkey" FOREIGN KEY (currency_id) REFERENCES
> currencies(id)
>
>  Table "public.currencies"
>  Column |  Type  |
> Modifiers
> +
> +-
>  id | integer| not null default
> nextval('currencies_id_seq'::regclass)
>  title  | character varying(255) |
>  code   | character varying(255) |
>  symbol | character varying(255) |
> Indexes:
> "currencies_pkey" PRIMARY KEY, btree (id)
>
>Table "public.lang_countries"
>Column   |  Type  |
> Modifiers
> +
> +-
>  id | integer| not null default
> nextval('lang_countries_id_seq'::regclass)
>  country_id | integer|
>  name   | character varying(255) |
>  diminutive | character varying(255) |
> Indexes:
> "lang_countries_pkey" PRIMARY KEY, btree (id)
> Foreign-key constraints:
> "lang_countries_id_fkey" FOREIGN KEY (country_id) REFERENCES
> countries(id)


--~--~-~--~~~---~--~~
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: One Install, Multiple Apps

2007-08-14 Thread starkey

On Aug 14, 11:13 am, Joel Stein <[EMAIL PROTECTED]> wrote:
> Why not just make these all in one application, but with several
> controllers?  Then you can tie them together with AppController.

Thanks for your reply. I don't think I can because I need my URLs to
be similar to:
http://www.domain.edu/news/edit/1
http://www.domain.edu/poll/edit/1

Can I have two "edit" controllers/views if everything is in one
application?  Would you have a moment to explain how?  I sure would
appreciate it!  Keep in mind that there are about a dozen programs
planned so putting all "edit" logic in one controller would not be
practical.

Thanks!
Shawn


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



Translate behavior - finding by translated fields (1.2)

2007-08-14 Thread Pillow

Hi,

I wonder is there any better way of finding records by translated
fields than this:

$this -> Page -> find(array('I18n__url.content' => $url));

I've fields title, url and content translated. I want to search page
not by its id, but by url, which is different for every locale.

Pillow


--~--~-~--~~~---~--~~
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: Multiple field values in select box?

2007-08-14 Thread Beertigger


Excellent!

Contrary to my earlier post, http://php-coding-practices.com/
cakephp-specific/how-to-put-combined-fields-into-cakephps-model-
generatelist/">myGenerateList does work across Models!



Tim Koschützki has really come up with a great one here.

Thanks to all who helped me out with this one!



Beertigger


On Aug 14, 6:34 am, Beertigger <[EMAIL PROTECTED]> wrote:
> Not... enough... caffeine...
>
> Thanks 
>
> On Aug 14, 4:11 am, "Geoff Ford" <[EMAIL PROTECTED]> wrote:
>
> > Try $listdata[$data['Team']['team']] = $data['Sport']['sport'] . '-' .
> > $data['Team']['team'];
>
> > This missing square bracket you put in the wrong place.
>
> > Geoff
>
> > On 8/14/07, Beertigger <[EMAIL PROTECTED]> wrote:
>
> > > Thanks, Geoff,
>
> > > I caught that one earlier, also found what I think was a missing ] to
> > > close the
>
> > > $listdata[$data['Team']['team'] = $data['Sport']['sport'] . '-' .
> > > $data['Team']['team'];
>
> > > now: $listdata[$data['Team']['team'] = $data['Sport']['sport'] . '-' .
> > > $data['Team']['team']];
>
> > > Still no smiles from heaven for this one
>
> > > Beertigger
>
> > > On Aug 13, 7:30 pm, "Geoff Ford" <[EMAIL PROTECTED]> wrote:
> > > > You've got a error in the getListData function - remove the curly barce
> > > > between the end of the query and $listdata = array();
>
> > > > Geoff
>
> > > > On 8/14/07, Beertigger <[EMAIL PROTECTED]> wrote:
>
> > > > > Found this one earlier. What myGenerateList does, it does very well,
> > > > > much easier than using an afterFind to concat things. But, from what I
> > > > > can tell thus far, it has the same limitation, in that it can't
> > > > > combine data across two models and display it in a third.
>
> > > > > On Aug 13, 2:58 pm, cdomigan <[EMAIL PROTECTED]> wrote:
>
> > >http://php-coding-practices.com/cakephp-specific/how-to-put-combined-...
>
> > > > --http://lemoncake.wordpress.com
>
> > --http://lemoncake.wordpress.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: app absolute url

2007-08-14 Thread R. Rajesh Jeba Anbiah

On Aug 14, 6:07 pm, "lalit kumar" <[EMAIL PROTECTED]> wrote:
> $doc_root = dirname(__FILE__).DIRECTORY_SEPARATOR;
> $position_uri = strrpos($_SERVER['REQUEST_URI'],'/')+1;
> $request_uri= substr($_SERVER['REQUEST_URI'],0,$position_uri);
> $url_root = "http://"; . $_SERVER['SERVER_NAME'] . $request_uri;
   

   This PHP--not CakePHP.

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.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
-~--~~~~--~~--~--~---



Pagination without model

2007-08-14 Thread Feris Thia

Hi All,

How do I have a custom pagination by sending a subset array of data,
total count of data, and current page ?

Thanks !

Feris

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



Find Condition Problem

2007-08-14 Thread farphadet

Hy

I have this 3 models, and i try to retreive all informations about a
country
according to the id of a country, and according to a language id (to
get the
name of the country in the correct language).

In my countries controller :

$this->Country->find(array('LangCountries.id' => 1, 'Country.id' =>
1);

Bu t This doesn't work, it send me an error, because LangCountries is
unknown.



This is my models :

class Currency extends AppModel {
var $name = 'Currency';
var $hasMany = array('Country');

}

class Country extends AppModel {

  var $name = 'Country';
  var $belongsTo = array('Currency');
  var $hasMany = array('LangCountry');

}

class LangCountry extends AppModel {

  public $name = 'LangCountry';
  public $belongsTo = array('Country');

}



This is my tables in Database:

   Table "public.countries"
Column|  Type  |
Modifiers
--+
+
 id   | integer| not null default
nextval('countries_id_seq'::regclass)
 currency_id  | integer|
 countries_iso_code_2 | character varying(255) |
 countries_iso_code_3 | character varying(255) |
 tel_regexp   | character varying(255) |
 zip_code_regexp  | character varying(255) |
Indexes:
"countries_pkey" PRIMARY KEY, btree (id)
Foreign-key constraints:
"currencies_id_fkey" FOREIGN KEY (currency_id) REFERENCES
currencies(id)


 Table "public.currencies"
 Column |  Type  |
Modifiers
+
+-
 id | integer| not null default
nextval('currencies_id_seq'::regclass)
 title  | character varying(255) |
 code   | character varying(255) |
 symbol | character varying(255) |
Indexes:
"currencies_pkey" PRIMARY KEY, btree (id)


   Table "public.lang_countries"
   Column   |  Type  |
Modifiers
+
+-
 id | integer| not null default
nextval('lang_countries_id_seq'::regclass)
 country_id | integer|
 name   | character varying(255) |
 diminutive | character varying(255) |
Indexes:
"lang_countries_pkey" PRIMARY KEY, btree (id)
Foreign-key constraints:
"lang_countries_id_fkey" FOREIGN KEY (country_id) REFERENCES
countries(id)


--~--~-~--~~~---~--~~
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: One Install, Multiple Apps

2007-08-14 Thread Joel Stein

Why not just make these all in one application, but with several
controllers?  Then you can tie them together with AppController.


--~--~-~--~~~---~--~~
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: exposing $var from bootstrap to default.ctp layout

2007-08-14 Thread Joel Stein

On Aug 13, 6:04 pm, "Howard Glynn" <[EMAIL PROTECTED]> wrote:
> various DEFINE's in this file are used in default
> already,
> but define won't look after an array obviously. I suppose it must be a
> variance in how
> defines are treated versus variables in php somethin i'm not familiar with.

Can you use the global keyword?

http://us.php.net/global


--~--~-~--~~~---~--~~
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: display data

2007-08-14 Thread Wimg

thx man,,

On Aug 14, 9:37 pm, starkey <[EMAIL PROTECTED]> wrote:
> I suggest you follow the excellent Blog tutorial in the manual.  It
> will help you out a lot (it did for me!).
>
> Shawn
>
> On Aug 14, 5:40 am, Wimg <[EMAIL PROTECTED]> wrote:
>
>
>
> > i have problem with display data, for example , i have a database like
> > this
>
> > a  b  c
> > 1  2  3
> > 1  3  4
>
> > i wanna display result of select a, c where b = 2  in a table.
> > how would my controller and view looks like ?
>
> > i am a new at cakephp
> > thx a lot!- Hide quoted text -
>
> - Show quoted text -


--~--~-~--~~~---~--~~
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: Security component and forms

2007-08-14 Thread Timo Derstappen

probably to make searches linkable.

On 8/14/07, Chris Hartjes <[EMAIL PROTECTED]> wrote:
>
> On 8/14/07, Timo Derstappen <[EMAIL PROTECTED]> wrote:
> >
> > I admit that there are very few use cases, but there is one already
> > mentioned by sergerod: searches. Have a look at google's search box.
>
> So because Google uses a GET form for doing searches, that is somehow
> the accepted way to do it?  The *real* question is *why* Google chose
> to do it as a GET request as opposed to a POST request.  Perhaps
> something to do with the amount of data submitted as part of a POST?
>
> I have no idea, but it's an interesting (and totally offtopic) thought.
>
>
> --
> Chris Hartjes
> Senior Developer
> Cake Development Corporation
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark - http://www.littlehart.net/attheballpark
> @TheKeyboard - http://www.littlehart.net/atthekeyboard
>
> >
>


-- 
Timo Derstappen

http://teemow.com
mailto:[EMAIL PROTECTED]

--~--~-~--~~~---~--~~
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: value attribute in html->file helper

2007-08-14 Thread dardosordi

You can put the image next to the file input in edit view, just put it
like any other image, then on submit replace that. But you can't set
the value of an file input field, just imagine .

On Aug 14, 7:57 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hello
>
> I want to view the image Path (country flag ) from my database when
> i'm edititing my language but the value attribute dont show.
>
> I want to have something like this :
> 
>
> in my view i try to do this :
>
> file('File', array('value' => 'Language/picture')); ?
>
>
>
> languages table have 3 fields id , name and picture . I want to edit
> my picture field in my file upload tag.
>
> function edit($id = null)
> {
> $category = $this->Language->findById($id);
> $this->set('language', $language);
>
> if (empty($this->data))
> {
> $this->Language->id = $id;
> $this->data = $this->Language->read();
> }
> else
> {
> if ($this->Language->save($this->data['Language']))
> {
> $this->flash('Jezyk zostala zaktualizowany','/languages/
> language_list');
> }
> }
>
> }
>
> Any ideas ?
>
> Stanley


--~--~-~--~~~---~--~~
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: Efficiency of database driven sessions

2007-08-14 Thread Marcus

I've set up a MEMORY table in my MySQL database with following
columns:

user_id INT UNSIGNED,
lastactivity DATETIME,
position VARCHAR(255)

In AppController for every user which is logged in I do a SQL REPLACE
into this table on every request. Because this is table is kept in the
RAM of the database machine the overhead for accessing it (read and
write) is very small.

I can use this table for calculating the number of current online
users or display the current locations of the users on my site.

Unfortunately MySQL doesn't allow TEXT columns on MEMORY tables - in
this case it would be possible to use the MEMORY storage engine as a
very performant session storage (Cake serializes the session data into
a string).

Marcus

On 14 Aug., 10:52, Pillow <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm going to implement some online users counter on my website. The
> simplest way of doing it is counting sessions active for instance for
> last 3 minutes.
>
> I've tried using CAKE_SESSION_SAVE set to cake, and counting files in /
> app/tmp/sessions/ which last modification time was greater than
> time()-3*60. But it was very slow because of that gc is running very
> rarely, and there are too many files to check (my website has up to
> 3 uniq visits per day).
>
> So, another idea is to have database driven sessions, and counting
> records modified not longer than 3 minutes ago by sql query.
>
> However, it also have disadvantages - each $this -> Session -> read/
> write(); equals one database query. I use sessions very often, so
> number of queries to database on every request has risen rapidly.
>
> What do you think, is it going to slow down my website? Do you have
> better ideas on how to implement online counter?
>
> Thx,
> Pillow


--~--~-~--~~~---~--~~
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: html->link and router->url adding /bare/ to the url if action is index

2007-08-14 Thread stripes1980

FYI: I've got exactly the same issue. I didn't find any solutions yet.

On Aug 13, 9:16 pm, LunarDraco <[EMAIL PROTECTED]> wrote:
> I'm using the latest (5501) from 1.2 branch of the repository.
>
> I baked my app with scaffolding and the associated actions at the
> bottom of the page are generating two different result urls.
>
> link(__('List', true).' '.__('Recipes', true),
> array('controller'=> 'recipes', 'action'=>'index')); ?> 
> link(__('New', true).' '.__('Recipe', true),
> array('controller'=> 'recipes', 'action'=>'add')); ?> 
>
> The first html->link will generate a url as 
> 'http://localhost/recipes/bare/recipes/index' with the addition of the /bare, 
> This is
> unexpected.
>
> The second html->link will generate the url as 'http://localhost/
> recipes/recipes/add' without thebarewhich is what I expected.
>
> I've spent sometime digging in the helpers\html.php , helper.php and
> router.php, I believe the problem is in either the mapRouteElements
> function or the built up list of routes in __connectDefaultRoutes,
> there are two lines added to the routes map:
>
> $_this->connect('/bare/:controller/:action/*', array('bare' =>
> '1'));
> $_this->connect('/ajax/:controller/:action/*', array('bare' =>
> '1'));
>
> If I comment these out then all works, except for if I wanted to usebareor 
> ajax.
>
> The mapRouteElements iterates over the possible routes and exits upon
> the first match. I'm not sure if the problem is the routes array is in
> the wrong order or the matching is failing.
>
> any help would be great.
> I guess for me its time to spruce up my regex skills to see if I can
> figure out the matching conditions and why this specific route is
> chosen over the more generic route.
>
> LunarDraco


--~--~-~--~~~---~--~~
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 I can create two instances in Cake?

2007-08-14 Thread Rahul

Hi

Suppose I have to do two different project in a single Cake
environment.
Then what modifications are needed ..
..and where these modifications should be...
..if I want to create two different instances in one CakePHP
framework.
Please help me out of this issue...!!
I dont want to change the "documentroot" or the .htaccess file each
and every time.
What I need to do is just type
http://localhost/project1 for the first one and
http://localhost/project1 for the 2nd

Regards
Rahul


--~--~-~--~~~---~--~~
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: Security component and forms

2007-08-14 Thread Chris Hartjes

On 8/14/07, Timo Derstappen <[EMAIL PROTECTED]> wrote:
>
> I admit that there are very few use cases, but there is one already
> mentioned by sergerod: searches. Have a look at google's search box.

So because Google uses a GET form for doing searches, that is somehow
the accepted way to do it?  The *real* question is *why* Google chose
to do it as a GET request as opposed to a POST request.  Perhaps
something to do with the amount of data submitted as part of a POST?

I have no idea, but it's an interesting (and totally offtopic) thought.


-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  "Just build it, damnit!"

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: Security component and forms

2007-08-14 Thread Timo Derstappen

I admit that there are very few use cases, but there is one already
mentioned by sergerod: searches. Have a look at google's search box.

On 8/14/07, Chris Hartjes <[EMAIL PROTECTED]> wrote:
>
> On 8/14/07, teemow <[EMAIL PROTECTED]> wrote:
> >
> > What's the security difference between GET and POST. This has nothing
> > to do with security.
>
> My fault for not fully explaining myself.  You are correct that GET
> and POST have nothing to do with security.
>
> > Semantically and for the sake of REST: If you use a form to retrieve
> > something from your application, it may even more make sense to use a
> > GET. On the other hand if you change something (add/update) with your
> > form you should definitely use a POST.
>
> Interesting advice, but I've made it a personal practice to never
> create a form that uses GET.  I'd love to hear a good, constructive
> reason for when a GET is preferred to a POST when creating a form that
> submits information somewhere.  I don't see any reason to use GET for
> a form.
>
> --
> Chris Hartjes
> Senior Developer
> Cake Development Corporation
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark - http://www.littlehart.net/attheballpark
> @TheKeyboard - http://www.littlehart.net/atthekeyboard
>
> >
>


-- 
Timo Derstappen

http://teemow.com
mailto:[EMAIL PROTECTED]

--~--~-~--~~~---~--~~
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: Security component and forms

2007-08-14 Thread Chris Hartjes

On 8/14/07, teemow <[EMAIL PROTECTED]> wrote:
>
> What's the security difference between GET and POST. This has nothing
> to do with security.

My fault for not fully explaining myself.  You are correct that GET
and POST have nothing to do with security.

> Semantically and for the sake of REST: If you use a form to retrieve
> something from your application, it may even more make sense to use a
> GET. On the other hand if you change something (add/update) with your
> form you should definitely use a POST.

Interesting advice, but I've made it a personal practice to never
create a form that uses GET.  I'd love to hear a good, constructive
reason for when a GET is preferred to a POST when creating a form that
submits information somewhere.  I don't see any reason to use GET for
a form.

-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  "Just build it, damnit!"

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



RequestAction and Breadcrumbs in a Layout

2007-08-14 Thread joe

Hi,

I am using a RequestAction call to ensure my URI remains clean/
modular.
e.g.

index()
{
$this->set('output',
$this->requestAction('/complex_controller/complex_method/',
array('return')));

}

For some reason If I set my variables from within the 'redirected'
Action Method called via requestAction, e.g:

function complex_method()
{
$this->set('somevar' array('my'=>'/link'));
}

The Layout which handles the 'somevar' Element fails to get the
'somevar'  Array.

However, if I call the complex method directly via the URI avoiding
the requestAction redirection it works - 'somevar' is accessible in
the Layout.


Any ideas?

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: Can I access database or execute some sql inside views ?

2007-08-14 Thread fr3nch13

If you have your models setup correctly:

hasAndBelongsToMany if the user can be a part of many groups, or

User belongsTo Group | Group hasMany User if they only belong to one.

Then in the method your controller:
class GroupsController extends AppController
{
function index()
{
$this->Group->recursive = 2;
$this->set('groups', $this->Group->findAll()); // sets $groups 
for
your view to access it hint: in your view, look at pr($groups); i'll
bet you find your users
}
}


in View:


   

   
  
   




This isn't tested but it should give you a point in the right
direction


On Aug 14, 8:49 am, Wimg <[EMAIL PROTECTED]> wrote:
> The problem is like this, i have a database as below:
>
> user_id , group_id
>
> 1  1
> 2  1
> 3  2
> 4  2
>
> i wanna display users in the same group as a row in  a table
>
> group1  group2
> 12
> 34
>
> i was thinking that I get group_id first, then use group_ id to get
> users belong to the same group_id. but i donot know how to do this in
> controller .
>
> any ideas ? thx in front


--~--~-~--~~~---~--~~
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: display data

2007-08-14 Thread starkey

I suggest you follow the excellent Blog tutorial in the manual.  It
will help you out a lot (it did for me!).

Shawn

On Aug 14, 5:40 am, Wimg <[EMAIL PROTECTED]> wrote:
> i have problem with display data, for example , i have a database like
> this
>
> a  b  c
> 1  2  3
> 1  3  4
>
> i wanna display result of select a, c where b = 2  in a table.
> how would my controller and view looks like ?
>
> i am a new at cakephp
> thx a lot!


--~--~-~--~~~---~--~~
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: Can I access database or execute some sql inside views ?

2007-08-14 Thread starkey

In your controller get the data and pivot it, then send it to the
view.

Shawn

On Aug 14, 8:49 am, Wimg <[EMAIL PROTECTED]> wrote:
> The problem is like this, i have a database as below:
>
> user_id , group_id
>
> 1  1
> 2  1
> 3  2
> 4  2
>
> i wanna display users in the same group as a row in  a table
>
> group1  group2
> 12
> 34
>
> i was thinking that I get group_id first, then use group_ id to get
> users belong to the same group_id. but i donot know how to do this in
> controller .
>
> any ideas ? thx in front


--~--~-~--~~~---~--~~
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: Multiple field values in select box?

2007-08-14 Thread Beertigger


Not... enough... caffeine...

Thanks 




On Aug 14, 4:11 am, "Geoff Ford" <[EMAIL PROTECTED]> wrote:
> Try $listdata[$data['Team']['team']] = $data['Sport']['sport'] . '-' .
> $data['Team']['team'];
>
> This missing square bracket you put in the wrong place.
>
> Geoff
>
> On 8/14/07, Beertigger <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Thanks, Geoff,
>
> > I caught that one earlier, also found what I think was a missing ] to
> > close the
>
> > $listdata[$data['Team']['team'] = $data['Sport']['sport'] . '-' .
> > $data['Team']['team'];
>
> > now: $listdata[$data['Team']['team'] = $data['Sport']['sport'] . '-' .
> > $data['Team']['team']];
>
> > Still no smiles from heaven for this one
>
> > Beertigger
>
> > On Aug 13, 7:30 pm, "Geoff Ford" <[EMAIL PROTECTED]> wrote:
> > > You've got a error in the getListData function - remove the curly barce
> > > between the end of the query and $listdata = array();
>
> > > Geoff
>
> > > On 8/14/07, Beertigger <[EMAIL PROTECTED]> wrote:
>
> > > > Found this one earlier. What myGenerateList does, it does very well,
> > > > much easier than using an afterFind to concat things. But, from what I
> > > > can tell thus far, it has the same limitation, in that it can't
> > > > combine data across two models and display it in a third.
>
> > > > On Aug 13, 2:58 pm, cdomigan <[EMAIL PROTECTED]> wrote:
>
> >http://php-coding-practices.com/cakephp-specific/how-to-put-combined-...
>
> > > --http://lemoncake.wordpress.com
>
> --http://lemoncake.wordpress.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: What's the view cache story in cake 1.2?

2007-08-14 Thread Kimble



On 13 Aug, 07:37, Geoff Ford <[EMAIL PROTECTED]> wrote:
> Does the cache folder have write permissions?
>
> Geoff
> --http://lemoncake.wordpress.com
>
> On Aug 13, 9:28 am, Kimble <[EMAIL PROTECTED]> wrote:
>
> > On 10 Aug, 17:56, "Feris Thia" <[EMAIL PROTECTED]> wrote:
>
> > > Have you added :
>
> > > var $cacheAction = array(
> > > 'Your action/view URL'  => secondsofcache
> > > );
>
> > > in your controller ?
>
> > > for example :
>
> > > var $cacheAction = array(
> > > 'cat/'  => 21600
> > > );
>
> > > Regards,
>
> > > Feris
>
> > It did'nt work! My cache folder is still empty

Sorry for the short post last time, I was in to much of a rush.

Yes, the cache folder is writeable, Cache is added to the helper array
and strangest of all Cache::write works just fine!

Any more Ideas?


--~--~-~--~~~---~--~~
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: app absolute url

2007-08-14 Thread lalit kumar
hi,

Try this one.

$doc_root = dirname(__FILE__).DIRECTORY_SEPARATOR;
$position_uri = strrpos($_SERVER['REQUEST_URI'],'/')+1;
$request_uri= substr($_SERVER['REQUEST_URI'],0,$position_uri);
$url_root = "http://"; . $_SERVER['SERVER_NAME'] . $request_uri;

Thanks
Lalit


On 8/14/07, R. Rajesh Jeba Anbiah <[EMAIL PROTECTED]> wrote:
>
>
> On Aug 13, 8:50 pm, nitifixis <[EMAIL PROTECTED]> wrote:
> > I'd like to set up a rss feed for my cake app and I need a way to get
> > the absolute url of my app (http://www.domain.com/...) to fill the
> >  and  tags of my feed. Can anyone help me,
> > please?
>
>   $rss->url('/', true);
>
>   If using Html helper, then $html, Xml helper, then $xml...
>
> --
>   
> Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.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: value attribute in html->file helper

2007-08-14 Thread Claudia

Hi there

as far as I know you cannot set the value attribute of a file
attribute as this would pose quite a security issue (after all you
could upload arbitrary files without letting the user know).

More info here:
http://www.cs.tut.fi/~jkorpela/forms/file.html#value

Claudia


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



SSL support through .htaccess

2007-08-14 Thread lalit kumar
hi,


How can i implement this in my site.


i wanna to redirect the different url when  port 443(https) is is occur in
the url through htaccess.


We have recently switched to Drupal from a proprietary content management
system for a lot of client projects. Shared SSL support is a big cost saver
for clients, and our old system dealt with it fairly elegantly. The tricky
part from a mod_rewrite perspective is the fact that you can't have more
than one RewriteBase. However I was able to get around this by stripping the
base if the port is 80. This should help, but true, robust secure pages
support in Drupal may require core changes...
# ALL EXCEPT SOME FILE EXTENSIONS TO "index.php" FILE.
RewriteBase /shared_ssl_subdir
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule .* index.php

# STRIP THE REWRITEBASE RULE FROM NON-SSL CONNECTIONS.
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} ^/shared_ssl_subdir
RewriteRule .* /index.php




-- 
Lalit Kumar
Software Engg.
Netsolutions
Chandigarh
09888711687

--~--~-~--~~~---~--~~
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: Can I access database or execute some sql inside views ?

2007-08-14 Thread Wimg

The problem is like this, i have a database as below:

user_id , group_id

1  1
2  1
3  2
4  2

i wanna display users in the same group as a row in  a table

group1  group2
12
34

i was thinking that I get group_id first, then use group_ id to get
users belong to the same group_id. but i donot know how to do this in
controller .

any ideas ? thx in front


--~--~-~--~~~---~--~~
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: Auth1.2 component not showing methods.

2007-08-14 Thread Charlie

Great! thnx!


--~--~-~--~~~---~--~~
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: Auth1.2 component not showing methods.

2007-08-14 Thread Dr. Tarique Sani

On 8/14/07, Charlie <[EMAIL PROTECTED]> wrote:
> I was looking in the groups and on the cakePHP website but I can't
> find the svn repository of 'the' branch.

Start here https://trac.cakephp.org/browser


T

-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.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: Auth1.2 component not showing methods.

2007-08-14 Thread Charlie

ah! the branch! :)
I was looking in the groups and on the cakePHP website but I can't
find the svn repository of 'the' branch.
Can someone give me that?

thnx!
- Charlie


On Aug 14, 11:13 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On 8/14/07, Charlie <[EMAIL PROTECTED]> wrote:
>
>
>
> > But if I check the current source code of the AuthComponent there is
> > no type 'controller' (anymore?)
> > So what would then be the type in $this->Auth->authorize =  ?
>
> You are probably looking at the trunk - it is very much there in the
> branch - thats where the things are moving
>
> Tarique
>
> --
> =
> Cheesecake-Photoblog:http://cheesecake-photoblog.org
> PHP for E-Biz:http://sanisoft.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: Multiple field values in select box?

2007-08-14 Thread Geoff Ford
Try $listdata[$data['Team']['team']] = $data['Sport']['sport'] . '-' .
$data['Team']['team'];

This missing square bracket you put in the wrong place.

Geoff

On 8/14/07, Beertigger <[EMAIL PROTECTED]> wrote:
>
>
> Thanks, Geoff,
>
> I caught that one earlier, also found what I think was a missing ] to
> close the
>
> $listdata[$data['Team']['team'] = $data['Sport']['sport'] . '-' .
> $data['Team']['team'];
>
> now: $listdata[$data['Team']['team'] = $data['Sport']['sport'] . '-' .
> $data['Team']['team']];
>
> Still no smiles from heaven for this one
>
>
> Beertigger
>
> On Aug 13, 7:30 pm, "Geoff Ford" <[EMAIL PROTECTED]> wrote:
> > You've got a error in the getListData function - remove the curly barce
> > between the end of the query and $listdata = array();
> >
> > Geoff
> >
> > On 8/14/07, Beertigger <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Found this one earlier. What myGenerateList does, it does very well,
> > > much easier than using an afterFind to concat things. But, from what I
> > > can tell thus far, it has the same limitation, in that it can't
> > > combine data across two models and display it in a third.
> >
> > > On Aug 13, 2:58 pm, cdomigan <[EMAIL PROTECTED]> wrote:
> > > >
> http://php-coding-practices.com/cakephp-specific/how-to-put-combined-...
> >
> > --http://lemoncake.wordpress.com
>
>
> >
>


-- 
http://lemoncake.wordpress.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
-~--~~~~--~~--~--~---



Error 404 when using ACL $aro->create

2007-08-14 Thread [EMAIL PROTECTED]

Hello,

i am trying the IBM tutorial no 2 and have a problem, when using the
function $aro->create(...) in my register action.
After clicking the "register" button, I get an Error 404. If I comment
out the $aro->create() the redirect is successful.
Here's the code:

class UsersController extends AppController
{
var $components = array('Acl');

function register() {

$this->set('username_error', 'Username must be between 6 and 40
characters.');
if(!empty($this->data)){
if($this->User->validates($this->data)){

if($this->User->findByUsername($this->data['User']['username'])) {
$this->User->invalidate('username');
$this->set('username_error', 'User 
already exists.');
} else {
$this->data['User']['password'] = 
md5($this->data['User']
['password']);
$this->data['User']['last_login'] = 
date("Y-m-d H:i:s");
if($this->User->save($this->data)){
$aro = new Aro();
//$user_id = 
$this->User->getLastInsertID();
$aro->create($this->User->id, 
'Users', $this->data['User']
['username']);
$this->Session->write('user', 
$this->data['User']['username']);

$this->Session->write('last_login', 'You are logged in first
time');
$this->redirect('/users/index');
} else {
$this->flash('There was a 
problem saving this information', '/
users/register');
}

}
} else {
$this->User->validateErrors($this->User);
}
}
}

function knownusers() {

$this->set('knownusers', $this->User->findAll(null, array('id',
'username', 'first_name', 'last_name', 'last_login'), 'id DESC'));
}

function login(){

$this->set('error', false);
if($this->data){
$results = 
$this->User->findByUsername($this->data['User']
['username']);
if($results && $results['User']['password'] == 
md5($this-
>data['User']['password'])){
$this->Session->write('user', 
$this->data['User']['username']);
$this->Session->write('last_login', 
$results['User']
['last_login']);
$results['User']['last_login'] = date("Y-m-d 
H:i:s");
$this->User->save($results);
$this->redirect('/users/index');
} else {
$this->set('error', true);
}
}
}

function logout() {

$this->Session->delete('user');
$this->Session->delete('last_login');
$this->redirect('/users/login');
}

function index() {

$username = $this->Session->read('user');
if($username){
$results = $this->User->findByUsername($username);
$this->set('User', $results['User']);
$this->set('last_login', 
$this->Session->read('last_login'));
} else {
$this->redirect('/users/login');
}
}
}


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



value attribute in html->file helper

2007-08-14 Thread [EMAIL PROTECTED]

Hello

I want to view the image Path (country flag ) from my database when
i'm edititing my language but the value attribute dont show.

I want to have something like this :


in my view i try to do this :

file('File', array('value' => 'Language/picture')); ?
>

languages table have 3 fields id , name and picture . I want to edit
my picture field in my file upload tag.

function edit($id = null)
{
$category = $this->Language->findById($id);
$this->set('language', $language);

if (empty($this->data))
{
$this->Language->id = $id;
$this->data = $this->Language->read();
}
else
{
if ($this->Language->save($this->data['Language']))
{
$this->flash('Jezyk zostala zaktualizowany','/languages/
language_list');
}
}
}

Any ideas ?

Stanley


--~--~-~--~~~---~--~~
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: Security component and forms

2007-08-14 Thread teemow

What's the security difference between GET and POST. This has nothing
to do with security.

Semantically and for the sake of REST: If you use a form to retrieve
something from your application, it may even more make sense to use a
GET. On the other hand if you change something (add/update) with your
form you should definitely use a POST.

Cheers,
Timo

On Aug 13, 2:09 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 8/13/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > A small request for developers of Security component. :-) Please make
> > an ability to switch off form data validation and autocreation of
> > hidden '__Token' fields when using Security and form/ajax helper in
> > Cake 1.2.
>
> > I know about Controller->disableFields. But automatically generated
> > __Tokens are inserted into the form anyway. This is not good for forms
> > with GET method.
>
> Why would you EVER use a form that uses the GET method.  That's like
> PHP security 101.
>
> --
> Chris Hartjes
> Senior Developer
> Cake Development Corporation
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


--~--~-~--~~~---~--~~
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: Can I access database or execute some sql inside views ?

2007-08-14 Thread RichardAtHome

Post the problem and lets see if we can help you out :-)

On Aug 14, 10:29 am, Wimg <[EMAIL PROTECTED]> wrote:
> correct,, i just have a problem do not how to solve


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



display data

2007-08-14 Thread Wimg

i have problem with display data, for example , i have a database like
this

a  b  c
1  2  3
1  3  4

i wanna display result of select a, c where b = 2  in a table.
how would my controller and view looks like ?

i am a new at cakephp
thx a lot!


--~--~-~--~~~---~--~~
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: Can I access database or execute some sql inside views ?

2007-08-14 Thread Wimg

correct,, i just have a problem do not how to solve

On Aug 14, 5:01 pm, Langdon Stevenson <[EMAIL PROTECTED]>
wrote:
>  > Can I access database or execute some sql inside views ?
>
> Given that this is PHP, yes I dare say you can.
>
> The point though is that you shouldn't.  Perform your queries and
> business logic in your Controller and Model.  Pass the resulting data to
> your view to render.  That is all that your view should be doing.
>
> If you really want to break this rule, then why use Cake?  You may as
> well just use vanilla PHP.
>
> Regards,
> Langdon


--~--~-~--~~~---~--~~
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: Auth1.2 component not showing methods.

2007-08-14 Thread Dr. Tarique Sani

On 8/14/07, Charlie <[EMAIL PROTECTED]> wrote:
>
> But if I check the current source code of the AuthComponent there is
> no type 'controller' (anymore?)
> So what would then be the type in $this->Auth->authorize =  ?
>

You are probably looking at the trunk - it is very much there in the
branch - thats where the things are moving


Tarique


-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.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: Defining a relationship using Cake's models

2007-08-14 Thread Langdon Stevenson

Hi Andrea

Andrea Spadaccini wrote:
> Ciao Langdon,
> 
>>> In a "traditional" way, I would create a N-N relationships, with an
>>> intermediate table that contains a worker_id, a site_id, a date and
>>> the number of hours. In fact, I already created this table, adding the
>>> mandatory "id" field that Cake wants, but I can't translate it to a
>>> Model.
>> I would set it up this way:
>>
>> Three models:
>>
>> - worker
>> - presence
>> - site
>>
>> worker -> hasMany -> presence
>>
>> presence -> belongsTo -> site
>> presence -> belongsTo -> worker
>>
>> site -> hasMany -> presence
>>
>> It sounds like you already have the foreign keys worked out.
>>
>> This should cover your needs.  Now you can create a "presence" instance
>> and assign a site and a worker to it.  Presences can be looked up by
>> site, or worker, or site, or worker can be looked up by presence.
> 
> Thanks a lot, I'll go implement my models using your suggestion!
> In fact, this blog post also suggests to do as you told me:
> 
> http://www.thinkingphp.org/2006/10/26/modeling-relationships-in-cakephp-faking-rails-throughassociation/
> 
> .. but being new at CakePHP I thought to model it as an HABTM
> relationship.
> So please correct me: I shouldn't use a HABTM relationship because in
> that way
> I couldn't set up other attributes for the relationship itself (the
> presence),
> right?

That is correct.  Just use hasMany and belongsTo relationships with 
three models, instead of HABTM relationships with two models.

Regards,
Langdon

--~--~-~--~~~---~--~~
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 put one view into another?

2007-08-14 Thread Wimg

thx a lot

On Aug 6, 12:47 am, Lokke <[EMAIL PROTECTED]> wrote:
> You can use requestAction or make your view an element and call
> renderElement.


--~--~-~--~~~---~--~~
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: Can I access database or execute some sql inside views ?

2007-08-14 Thread Langdon Stevenson

 > Can I access database or execute some sql inside views ?

Given that this is PHP, yes I dare say you can.

The point though is that you shouldn't.  Perform your queries and 
business logic in your Controller and Model.  Pass the resulting data to 
your view to render.  That is all that your view should be doing.

If you really want to break this rule, then why use Cake?  You may as 
well just use vanilla PHP.

Regards,
Langdon

--~--~-~--~~~---~--~~
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: Auth1.2 component not showing methods.

2007-08-14 Thread Charlie

But if I check the current source code of the AuthComponent there is
no type 'controller' (anymore?)
So what would then be the type in $this->Auth->authorize =  ?

thnx again.
- Charlie


On Aug 13, 3:58 pm, Gwoo <[EMAIL PROTECTED]> wrote:
> You you want to check on based on the action then you should use the
> controller based auth. Model based auth gets the action based on how
> the action is mapped to the CRUD. So, in the model that is all you
> deal with, create, read, update, delete.


--~--~-~--~~~---~--~~
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: MySQL replication master / slave setup does not work

2007-08-14 Thread Masao

Thanks for the response, but i checked, and that's not the problem.

   'connect' => 'mysql_connect',



On Aug 13, 5:09 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> make sure that you are using
>
> 'connect'  => 'mysql_connect'
>
> not pconnect in your db config
>
> On 8/13/07, Masao <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I've setup a simple Users table with scaffolding to test the master/
> > slave setup suggested in this thread:
>
> >http://groups.google.com/group/cake-php/browse_thread/thread/58ea010f...
>
> > But it does not work for me either (as I've read someone else is
> > having the same problem)
>
> > The INSERT's and UPDATE's still go to the 'default' database config.
>
> > Anyone else having this problem?
>
> > Masao
>
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/


--~--~-~--~~~---~--~~
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: Defining a relationship using Cake's models

2007-08-14 Thread Andrea Spadaccini

Ciao Langdon,

> > In a "traditional" way, I would create a N-N relationships, with an
> > intermediate table that contains a worker_id, a site_id, a date and
> > the number of hours. In fact, I already created this table, adding the
> > mandatory "id" field that Cake wants, but I can't translate it to a
> > Model.
>
> I would set it up this way:
>
> Three models:
>
> - worker
> - presence
> - site
>
> worker -> hasMany -> presence
>
> presence -> belongsTo -> site
> presence -> belongsTo -> worker
>
> site -> hasMany -> presence
>
> It sounds like you already have the foreign keys worked out.
>
> This should cover your needs.  Now you can create a "presence" instance
> and assign a site and a worker to it.  Presences can be looked up by
> site, or worker, or site, or worker can be looked up by presence.

Thanks a lot, I'll go implement my models using your suggestion!
In fact, this blog post also suggests to do as you told me:

http://www.thinkingphp.org/2006/10/26/modeling-relationships-in-cakephp-faking-rails-throughassociation/

.. but being new at CakePHP I thought to model it as an HABTM
relationship.
So please correct me: I shouldn't use a HABTM relationship because in
that way
I couldn't set up other attributes for the relationship itself (the
presence),
right?

Thanks again!
Regards,

--
[ Andrea Spadaccini - a.k.a. lupino3 - GLUGCT - from Catania - ICQ :
91528290 ]
[ GPG ID: 5D41ABF0 - key on keyservers - Debian GNU / Linux - Kernel
2.6.18.4 ]
[ Linux Registered User 313388 -
a(dot)spadaccini(at)catania(dot)linux(dot)it ]
[ Error, no keyboard -- press F1 to
continue. ]


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



Can I access database or execute some sql inside views ?

2007-08-14 Thread Wimg

thx!


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



  1   2   >