Re: W3C validation

2008-04-18 Thread Mech7

You can call the helper in only the views where they are needed.

On Apr 19, 6:29 am, Lakshmi <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Thanks for this.
>
> The head, body and footer have been seperated in our portal.  Hence if the
> script is called in the head, it would be called in all pages (even where
> the script is not required) which would make it very heavy.  We want a way
> where it is called in the body, but where we can ensure that we are  W3C
> validated.
>
> Any suggestions are welcome and thanks in advance.
>
> Regards,
> Lakshmi
>
> On 4/19/08, b logica <[EMAIL PROTECTED]> wrote:
>
>
>
> > If you're using $javascript->link('some_script') change it to
> > $javascript->link('some_script', false) so that the script tag is
> > written to the head rather than inline within the body.
>
> > Of course, whether or not this breaks your scripts depends on how they
> > were written. If they do break, you should re-write them properly
> > handle DOM load rather than depending upon where they fall in the
> > document.
>
> > As for page load/execution time, this may be related more to poor code
> > rather than where the script lies in the doc, though the code be poor
> > because it was written to run in the middle of the doc. If you know
> > what I mean ...
>
> > On Fri, Apr 18, 2008 at 11:22 PM, Lakshmi <[EMAIL PROTECTED]> wrote:
> > > Hi,
>
> > > We are trying to achieve W3C valid pages and have minimal errors on the
> > > pages on our portal.  We are using javascript and cakephp.  What happens
> > is
> > > due to the script tags being embedded we get many W3C validation errors.
> > > The page gets slower due to this and throughput is low.  Could someone
> > help
> > > in giving tips how we could avoid such errors and get our pages W3C
> > > validated.
>
> > > Are there any particular rules to be followed to achieve this?
>
> > > Thanks in advance for the help.
>
> > > Regards,
> > > Lakshmi
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



@Sliv: One link is missing in "FAQ" page?

2008-04-18 Thread R. Rajesh Jeba Anbiah

One link seems to be missing in the FAQ page 
http://groups.google.com/group/cake-php/web/faq
under "How to handle tricky HasAndBelongsToMany situations?". If you
have access to the previous Frequent Discussions page, can you check
what link it is?

--
  
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: W3C validation

2008-04-18 Thread Lakshmi
Hi,

Thanks for this.

The head, body and footer have been seperated in our portal.  Hence if the
script is called in the head, it would be called in all pages (even where
the script is not required) which would make it very heavy.  We want a way
where it is called in the body, but where we can ensure that we are  W3C
validated.

Any suggestions are welcome and thanks in advance.

Regards,
Lakshmi

On 4/19/08, b logica <[EMAIL PROTECTED]> wrote:
>
>
> If you're using $javascript->link('some_script') change it to
> $javascript->link('some_script', false) so that the script tag is
> written to the head rather than inline within the body.
>
> Of course, whether or not this breaks your scripts depends on how they
> were written. If they do break, you should re-write them properly
> handle DOM load rather than depending upon where they fall in the
> document.
>
> As for page load/execution time, this may be related more to poor code
> rather than where the script lies in the doc, though the code be poor
> because it was written to run in the middle of the doc. If you know
> what I mean ...
>
> On Fri, Apr 18, 2008 at 11:22 PM, Lakshmi <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > We are trying to achieve W3C valid pages and have minimal errors on the
> > pages on our portal.  We are using javascript and cakephp.  What happens
> is
> > due to the script tags being embedded we get many W3C validation errors.
> > The page gets slower due to this and throughput is low.  Could someone
> help
> > in giving tips how we could avoid such errors and get our pages W3C
> > validated.
> >
> > Are there any particular rules to be followed to achieve this?
> >
> > Thanks in advance for the help.
> >
> > Regards,
> > Lakshmi
> >  >
> >
>
> >
>

--~--~-~--~~~---~--~~
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: Controllers without Views

2008-04-18 Thread Fred Hirsch

This is just opinion (I am not a core developer), please take it with a 
grain of salt:

The framework includes the view functionality, testing it as a benchmark 
without the view is not a valid test (in my opinion). The only thing you 
are testing by doing this within a controller is to test the overhead of 
loading the framework itself. Excluding the view could skew this 
significantly. You could just create a view with "Hello World" and this 
would ensure you are testing the framework as it is "normally" utilized. 
Are you truly exploring using the framework without views? Perhaps your 
needs might be better served with a different solution. A framework may 
not be what you need.

Some other questions:
- If your purpose is to define overhead issues, would you include 
components, helpers, etc?
- Will you also attempt this test with a round trip to the database?
- How about attempting to somehow execute a controller method without 
loading the DB modules?
- Where do you stop in excluding framework components before its no 
longer a framework?

Good luck with you test,
Fred

Wizardry wrote:
> Is it possible to have a controller that prints a simple 'Hello World'
> without having an underlying index view?
>
> In case anyone is wondering why would I want such a thing, well I
> wanted to test the performance of the CakePHP framework and wished to
> know the differences in response time for the controller making a call
> to the view to do an action and correspondingly doing it itself.
>
> >
>
>   


--~--~-~--~~~---~--~~
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 with $ajax->submit

2008-04-18 Thread b logica

Are you sure that 'loaded' is appropriate? Are you loading anything
into the page? Try 'success' instead.

On Fri, Apr 18, 2008 at 9:55 PM, MB <[EMAIL PROTECTED]> wrote:
>
>  Here is my submit button --
>
>  print $ajax->submit('Save', array('url' => '/klasses/addlink',
>  'loaded'=>'closesubject()'));
>
>  The save works but the 'closesubject()' function which is a javascript
>  doesnt ever seem to get called.
>
>  Here is the javascript:
>
>  
>  function closesubject(form)
>  {
> window.opener.parent.location.reload();
> window.close();
> return false;
>  }
>  
>
>  >
>

--~--~-~--~~~---~--~~
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: CakePHP with directory password protection?

2008-04-18 Thread b logica

Assuming the grades directory is outside the app directory then it
should suffice to change just  the one .htaccess file as the others
won't be seen if a request for /grades arrives (it won't be redirected
into /app).

On Fri, Apr 18, 2008 at 10:59 PM, Sourabh Sharma
<[EMAIL PROTECTED]> wrote:
>
>  In app folder of cake PHp we have 3 .htaccess files one is in root,
>  second is in app folder and third is in webroot folder. if you are
>  changing one .htaccess file then you have to change other also
>  accordingly i think so .
>
>  Thanks & Regards
>  Sourabh sharma
>
>
>  On Apr 19, 7:16 am, "b logica" <[EMAIL PROTECTED]> wrote:
>  > You shouldn't use 2 blocks like that. Try this:
>  >
>  > 
>  >RewriteEngine On
>  >RewriteBase /
>  >RewriteRule ^/grades - [L]
>  >RewriteRule ^$ app/webroot/[L]
>  >RewriteRule (.*) app/webroot/$1 [L]
>  > 
>  >
>
>
> > On Fri, Apr 18, 2008 at 4:15 PM, Jon <[EMAIL PROTECTED]> wrote:
>  >
>  > >  I have CakePHP installed, and naturally it uses mod_rewrite to make
>  > >  the URLs clean.  I made a modification to the htaccess file to allow
>  > >  me to ignore it for a certain directory.  But then within that
>  > >  directory, I have an htaccess that defines password protection of that
>  > >  directory.  Now I get a 404 error.  How can I keep password
>  > >  protection, but allow it to function as normal?  Here are my files:
>  >
>  > >  .htaccess in document root:
>  > >  
>  > > RewriteEngine On
>  > > RewriteBase /
>  > > RewriteCond %{REQUEST_URI} grades
>  > > RewriteRule ^.*$ - [L]
>  >
>  > >  
>  >
>  > >  
>  > >RewriteEngine on
>  > >RewriteRule^$ app/webroot/[L]
>  > >RewriteRule(.*) app/webroot/$1 [L]
>  > >  
>  >
>  > >  .htaccess in the directory I want to protect:
>  > >  AuthType Basic
>  > >  AuthName "Restricted Area"
>  > >  AuthUserFile "/home/username/.htpasswds/public_html/grades/csv/passwd"
>  > >  require valid-user
>
>  >
>

--~--~-~--~~~---~--~~
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: W3C validation

2008-04-18 Thread b logica

If you're using $javascript->link('some_script') change it to
$javascript->link('some_script', false) so that the script tag is
written to the head rather than inline within the body.

Of course, whether or not this breaks your scripts depends on how they
were written. If they do break, you should re-write them properly
handle DOM load rather than depending upon where they fall in the
document.

As for page load/execution time, this may be related more to poor code
rather than where the script lies in the doc, though the code be poor
because it was written to run in the middle of the doc. If you know
what I mean ...

On Fri, Apr 18, 2008 at 11:22 PM, Lakshmi <[EMAIL PROTECTED]> wrote:
> Hi,
>
> We are trying to achieve W3C valid pages and have minimal errors on the
> pages on our portal.  We are using javascript and cakephp.  What happens is
> due to the script tags being embedded we get many W3C validation errors.
> The page gets slower due to this and throughput is low.  Could someone help
> in giving tips how we could avoid such errors and get our pages W3C
> validated.
>
> Are there any particular rules to be followed to achieve this?
>
> Thanks in advance for the help.
>
> Regards,
> Lakshmi
>  >
>

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



debug save() failure

2008-04-18 Thread b logica

The add() method of one of my controllers has stopped working. I've
tried logging $this->data immediately after the save failure and it
looks fine. There's nothing different about the database--this was
working great. I have a feeling that this is related to a behavior
(Attachment, I'm looking at you) but can't prove it.

At this point, I can't even rule out a database-related failure
because I'm not absolutely confident that the failed query would show
up on the page before my exit();

I'd like to at least log whatever steps Cake is taking to save the
model but realise that that's an awful lot. I'd appreciate any
pointers on where to start with 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
-~--~~~~--~~--~--~---



W3C validation

2008-04-18 Thread Lakshmi
Hi,

We are trying to achieve W3C valid pages and have minimal errors on the
pages on our portal.  We are using javascript and cakephp.  What happens is
due to the script tags being embedded we get many W3C validation errors.
The page gets slower due to this and throughput is low.  Could someone help
in giving tips how we could avoid such errors and get our pages W3C
validated.

Are there any particular rules to be followed to achieve this?

Thanks in advance for the help.

Regards,
Lakshmi

--~--~-~--~~~---~--~~
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: CakePHP with directory password protection?

2008-04-18 Thread Sourabh Sharma

In app folder of cake PHp we have 3 .htaccess files one is in root,
second is in app folder and third is in webroot folder. if you are
changing one .htaccess file then you have to change other also
accordingly i think so .

Thanks & Regards
Sourabh sharma

On Apr 19, 7:16 am, "b logica" <[EMAIL PROTECTED]> wrote:
> You shouldn't use 2 blocks like that. Try this:
>
> 
>RewriteEngine On
>RewriteBase /
>RewriteRule ^/grades - [L]
>RewriteRule ^$ app/webroot/[L]
>RewriteRule (.*) app/webroot/$1 [L]
> 
>
> On Fri, Apr 18, 2008 at 4:15 PM, Jon <[EMAIL PROTECTED]> wrote:
>
> >  I have CakePHP installed, and naturally it uses mod_rewrite to make
> >  the URLs clean.  I made a modification to the htaccess file to allow
> >  me to ignore it for a certain directory.  But then within that
> >  directory, I have an htaccess that defines password protection of that
> >  directory.  Now I get a 404 error.  How can I keep password
> >  protection, but allow it to function as normal?  Here are my files:
>
> >  .htaccess in document root:
> >  
> > RewriteEngine On
> > RewriteBase /
> > RewriteCond %{REQUEST_URI} grades
> > RewriteRule ^.*$ - [L]
>
> >  
>
> >  
> >RewriteEngine on
> >RewriteRule^$ app/webroot/[L]
> >RewriteRule(.*) app/webroot/$1 [L]
> >  
>
> >  .htaccess in the directory I want to protect:
> >  AuthType Basic
> >  AuthName "Restricted Area"
> >  AuthUserFile "/home/username/.htpasswds/public_html/grades/csv/passwd"
> >  require valid-user

--~--~-~--~~~---~--~~
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: Controllers without Views

2008-04-18 Thread Sourabh Sharma

yeah you can create a controller without any view, you can easy put
the view in the controller also. But that is the bad practice and then
what is the benifit of MVC structure. We can do anything of own with
cakePHP but if we follow the instruction of structure then performance
of our application is best.

Thanks & Regards
Sourabh Sharma

On Apr 19, 5:51 am, Wizardry <[EMAIL PROTECTED]> wrote:
> Is it possible to have a controller that prints a simple 'Hello World'
> without having an underlying index view?
>
> In case anyone is wondering why would I want such a thing, well I
> wanted to test the performance of the CakePHP framework and wished to
> know the differences in response time for the controller making a call
> to the view to do an action and correspondingly doing it itself.

--~--~-~--~~~---~--~~
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: Best practice for setting current user variable?

2008-04-18 Thread Sourabh Sharma

I don't understand the question but if you want to say that you want
to access the which user sis logged in then you have to create
afunction for log in the APP Controller file, then you can access
easily in the whole controller because we extends the very controller
to APPController.

Please explain your question so we easily provide the best solution.

Thanks & Regards
Sourabh Sharma

On Apr 19, 6:44 am, "b logica" <[EMAIL PROTECTED]> wrote:
> I store a $user array in the Session upon login and then read() it in
> whichever methods I need some bit of info (mostly the ID, of course).
>
> On Fri, Apr 18, 2008 at 7:39 PM, John R <[EMAIL PROTECTED]> wrote:
>
> >  How do you all set the current user per controller?

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



Problem with $ajax->submit

2008-04-18 Thread MB

Here is my submit button --

print $ajax->submit('Save', array('url' => '/klasses/addlink',
'loaded'=>'closesubject()'));

The save works but the 'closesubject()' function which is a javascript
doesnt ever seem to get called.

Here is the javascript:


function closesubject(form)
{
window.opener.parent.location.reload();
window.close();
return false;
}


--~--~-~--~~~---~--~~
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: CakePHP with ExtJS

2008-04-18 Thread Timmy Crawford

I've built my CMS back-end using extjs and cake as well.  Like those
above, I leverage the model quite a bit, and have a helper that does
all the grunt work for creating grids, tab panels, etc.

I personally don't use the ext forms at all as I have run into some
scenarios where they limit my abilities to do a few things.

On Apr 18, 7:35 am, hydra12 <[EMAIL PROTECTED]> wrote:
> I've used extjs with cake, too.  It's not exactly easy (there aren't a
> lot of resources for integrating the two), but it can be done.  The
> trick is that cake wants things done a certain way, and you have to
> figure out how to get extjs to play nice in a cakey kind of way
> (forms, for instance).  I've written a few tutorials on my 
> blog:www.ntatd.org/mark.  I don't use any helpers.
>
> I hope that helps some!
> hydra12
>
> On Apr 18, 6:59 am, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > ExtJS and Cake do indeed work quite nicely together. Having used them
> > together for several projects now, I have started working on a
> > component and a helper to try and produce some of the more common Ext
> > bits in a sort of scaffolded automagic way. The main things I see the
> > helper helping with would be Ext forms (based on the form helper) and
> > things like stores (who wants to re-type all those field: properties
> > and grid column models when you already have the schema in the cake
> > model? I also have a view which I use to return data to the
> > JsonReader, which does things like handle the totalProperty column
> > integrated with Cake's pager. I'm thinking it might be worth batching
> > some stuff into a component which intercepts scafolding stuff, so you
> > can effectively use your cake scafolded controllers with an all ext
> > frontend and save implementing any crud actions.
>
> > This is coming along nicely, but I'm not quite ready to release it to
> > everyone just yet. As soon as I have something worth contributing, I
> > will GPL it and put it up on the ext forums, and the bakery if they'll
> > have it.
>
> > Just some ideas. They'll be backed up with code shortly.
>
> > Simonhttp://www.simonellistonball.com/
>
> > On Apr 18, 12:39 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
>
> > > Works very well - just finishing a fairly large project with it but there
> > > are no helpers and perhaps you are better off that way
>
> > > T
>
> > > On Fri, Apr 18, 2008 at 1:18 PM, inma <[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
>
> > > > I'm interested to know how many people are using ExtJS with CakePHP.
>
> > > --
> > > =
> > > 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
-~--~~~~--~~--~--~---



Controllers without Views

2008-04-18 Thread Wizardry

Is it possible to have a controller that prints a simple 'Hello World'
without having an underlying index view?

In case anyone is wondering why would I want such a thing, well I
wanted to test the performance of the CakePHP framework and wished to
know the differences in response time for the controller making a call
to the view to do an action and correspondingly doing it itself.

--~--~-~--~~~---~--~~
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: CakePHP with directory password protection?

2008-04-18 Thread b logica

You shouldn't use 2 blocks like that. Try this:


   RewriteEngine On
   RewriteBase /
   RewriteRule ^/grades - [L]
   RewriteRule ^$ app/webroot/[L]
   RewriteRule (.*) app/webroot/$1 [L]



On Fri, Apr 18, 2008 at 4:15 PM, Jon <[EMAIL PROTECTED]> wrote:
>
>  I have CakePHP installed, and naturally it uses mod_rewrite to make
>  the URLs clean.  I made a modification to the htaccess file to allow
>  me to ignore it for a certain directory.  But then within that
>  directory, I have an htaccess that defines password protection of that
>  directory.  Now I get a 404 error.  How can I keep password
>  protection, but allow it to function as normal?  Here are my files:
>
>  .htaccess in document root:
>  
> RewriteEngine On
> RewriteBase /
> RewriteCond %{REQUEST_URI} grades
> RewriteRule ^.*$ - [L]
>
>  
>
>  
>RewriteEngine on
>RewriteRule^$ app/webroot/[L]
>RewriteRule(.*) app/webroot/$1 [L]
>  
>
>
>  .htaccess in the directory I want to protect:
>  AuthType Basic
>  AuthName "Restricted Area"
>  AuthUserFile "/home/username/.htpasswds/public_html/grades/csv/passwd"
>  require valid-user
>
>  >
>

--~--~-~--~~~---~--~~
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 HABTM - Anyone actually get this working in a real world application with additional fields in the link table?

2008-04-18 Thread b logica

On Fri, Apr 18, 2008 at 5:54 PM, James K <[EMAIL PROTECTED]> wrote:
>
>  I've been bashing my skull against the wall all day trying to get a
>  HABTM relationship to save correctly...

Welcome to CakePHP. I think this is the single most frustrating thing
to get done right. However, it works great once you have it set up
correctly. And the source is some very clever PHP.

Having said that, I still can't write 2 controller/model sets in a row
without spending a good long time gnashing my teeth in despair.

>  Here's the setup:
>
>  Member hasOne Account
>  Member hasAndBelongsToMany Address
>
>  This is set up so a member may specify both a permanent address and a
>  mailing address (if "different than above"). Therefore I have an
>  address_type in my join table.

My $.02: save yourself some grief and put those addresses in the same
row in the accounts table. I doubt you'll ever have a need for the
addresses to be separate. Your application can then simply look to see
if the mailing address IS NULL and, if so, shoot the package or
whatever to the billing address.

Yes, you'll often have empty columns but a decent (from this decade)
database engine can optimise that.

>  ...ok... that's odd. Same thing, but a little different. It also finds
>  two rows as it should. Next comes the kicker
>
>  DELETE FROM [addresses_members] WHERE [member_id] IN (NULL, NULL)
>
>  ...wait, WHAT? Why in the world are you trying to delete my
>  relationships? Even worse is why are you trying to delete
>  relationships with NULL member ids?
>
>  INSERT INTO [addresses_prospects] ([prospect_id],[address_id]) VALUES
>  (25,'2')
>  INSERT INTO [addresses_prospects] ([prospect_id],[address_id]) VALUES
>  (25,'3')
>
>  ...ok, you wanted to re-insert them for some reason. That's all well
>  and good, but these queries fail because it's missing my address_type.
>  It seems it doesn't pick up the address_type I passed in, but I don't
>  know how else to populate the field since the HABTM relationship is
>  automagic'd (it knows there's an extra field on the read, but not on
>  the save).
>
>  I've been combing the net for days now, updated to the latest
>  nightlys, dug through trac and this group and have come up totally
>  empty handed. It seems no one has actually figured out how to use this
>  properly outside of really simple applications, or maybe I'm just
>  running into bugs?

Actually, it's a feature, apparently.

>  I COULD model the link table myself and do it all by hand, but the
>  problem with that is then Cake does a separate Select statement for
>  each model on the other side of the link table which might not be a
>  problem on a page that only has 2 related records, but what happens
>  when I'm editing a record with dozens or hundreds? There must be
>  someone out there who has gotten HABTM working with a more complex
>  link table.
>
>  I'm torn between whether this is something I should be filing in Trac,
>  or whether I'm just not understanding how it works. Help?
>

There are some posts about this (with fix) and I've just tried to
locate them for you. Sorry, I can't remember quite what the terms to
search on would be.

Have you had a go through these links?
(How to handle tricky HasAndBelongsToMany situations?)
http://groups.google.com/group/cake-php/web/faq

Also, look at this:
http://bakery.cakephp.org/articles/view/add-delete-habtm-behavior

--~--~-~--~~~---~--~~
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 prevent escaping of numbers for ORDER BY?

2008-04-18 Thread Fred Hirsch

I think someone may have answered this, but its better to use a column 
alias in the select clause and then utilize that alias for your ordering.

An example:
select id, (count_something * 0.1) + (something_else * 0.8) as 
count_order
from my_table
where blah = 'blah'
order by count_order;

This is actually a bit easier for the SQL parser to manage as well, and 
if you decide to change the count_order algorithm, its in a place that 
is easier to manipulate in the future. I don't know offhand if Cake will 
manage this somehow with its automagic. Might be worth a try though.

Cheers,
Fred

hks wrote:
> In my query, I want to use  'order' => "( (thread.views * 0.1) +
> (thread.messages * 0.8) ) DESC"
>
> But cakephp will escape the fields and turn the number 0.1 into
> `0`.`1` causing error in SQL.
> I tried using the -! but it doesn't work.
>
> Any suggestions?
>
> >
>
>   


--~--~-~--~~~---~--~~
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: Best practice for setting current user variable?

2008-04-18 Thread b logica

I store a $user array in the Session upon login and then read() it in
whichever methods I need some bit of info (mostly the ID, of course).

On Fri, Apr 18, 2008 at 7:39 PM, John R <[EMAIL PROTECTED]> wrote:
>
>  How do you all set the current user per controller?
>  >
>

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



Re: More of an SQL question ... having a hard time with this statement

2008-04-18 Thread b logica

No need for a timestamp if the revision_id is a SERIAL (or
AUTO_INCREMENT or whatever).

I think you're thinking of something more along the lines of:

SELECT user_id, revision_id FROM the_table ORDER BY revision_id,
user_id DESC LIMIT 15;

Including the user_id in ORDER BY clause allows for overlap in the revision_id.

But John wants the latest revision--and only the latest--per user.
IOW, he doesn't want more than one revision_id for each user.

On Fri, Apr 18, 2008 at 6:32 PM, Robert <[EMAIL PROTECTED]> wrote:
>
>  I would add a time field to the database record for each revision.
>  Then order by descending time and limit your query to 15 rows.  (You
>  can order by descending revision_id also, but once you have many users
>  you could easily have more than 15 records where the greatest
>  revision_id's are equal, and they won't be useful for showing only the
>  most recent revisions.)
>
>
>
>  On Apr 18, 4:10 pm, John R <[EMAIL PROTECTED]> wrote:
>  > In this app, users can upload photos, and then revise them.
>  >
>  > The app stores a log of all revisions so they can easily go back to
>  > them.
>  >
>  > The database has: user_id and revision_id
>  >
>  > I am trying to write a statement that grabs only the 15 latest
>  > (highest #) revisions for all users.
>  >
>  > So .. if the table looks like:
>  >
>  > user_id   revision_id
>  > 11
>  > 12
>  > 21
>  > 3 1
>  > 13
>  > 14
>  > 32
>  >
>  > It would grab three records: user 1 revision 4, user 2 revision 1 and
>  > user 3 revision 2
>  >
>  > 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: More of an SQL question ... having a hard time with this statement

2008-04-18 Thread b logica

SELECT user_id, MAX(revision_id) FROM YOUR_TABLE GROUP BY user_id LIMIT 15;

On Fri, Apr 18, 2008 at 6:10 PM, John R <[EMAIL PROTECTED]> wrote:
>
>  In this app, users can upload photos, and then revise them.
>
>  The app stores a log of all revisions so they can easily go back to
>  them.
>
>  The database has: user_id and revision_id
>
>  I am trying to write a statement that grabs only the 15 latest
>  (highest #) revisions for all users.
>
>  So .. if the table looks like:
>
>  user_id   revision_id
>  11
>  12
>  21
>  3 1
>  13
>  14
>  32
>
>  It would grab three records: user 1 revision 4, user 2 revision 1 and
>  user 3 revision 2
>
>  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: model query indexes by a letter

2008-04-18 Thread Fred Hirsch

Your column prefixes are used by the record parser to build the result 
set array.

If you changed it as follows (formatting added for clarity only):

SELECT i.id, 
i.client_id, 
ifnull(total,'0') as i.total_due,
ifnull(i.due,'NA') as i.due_date, 
ifnull(sum(p.amount),0) as i.total_paid,
ifnull(i.total - sum(p.amount),i.total) as i.total_still_due
FROM invoices LEFT JOIN payments  ON p.invoice_id = i.id
WHERE i.total > 0
GROUP BY p.client_id
ORDER BY due_date";

Then, everything gets put in the [i] array. You could change [i] above 
to give it more meaning.

Was this what you needed?
Fred

hutchic wrote:
> With the following function
>
>   function calculate_due(){
>   $query = "
>   SELECT i.id, i.client_id, ifnull(total,'0') as 
> total_due,
> ifnull(i.due,'NA') as due_date, ifnull(sum(p.amount),0) as total_paid,
> ifnull(i.total - sum(p.amount),i.total) as total_still_due
>   FROM invoices i LEFT JOIN payments p ON p.invoice_id = 
> i.id
>   WHERE total > 0
>   GROUP BY p.client_id
>   ORDER BY due_date";
>   $ret = $this->query($query);
>   pr($ret);
>   die('');
>   }
>
> The output I get is
>
> Array
> (
> [0] => Array
> (
> [i] => Array
> (
> [id] => 8
> [client_id] => 1
> )
>
> [0] => Array
> (
> [total_due] => 3.250
> [due_date] => NA
> [total_paid] => 0.00
> [total_still_due] => 3.250
> )
>
> )
>
> )
>
> In version 1.1.19.6305
>
> Help is greatly appreciated
> >
>
>   


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



Methods of serving images from plugins

2008-04-18 Thread Max

>From last few days, I was trying to create plugins which will have CSS/
JS/Images inside them.

I tried .htaccess way, it might work, but that is something which I
dont want to implement as that would be a hack. So basically, I am not
able to find any good solution for the same.

Is anybody here who is already doing it? Please suggest.
--~--~-~--~~~---~--~~
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: Question about Model::save() and its beforeSave and afterSave callbacks

2008-04-18 Thread Fred Hirsch

I dug a bit deeper and found this buried in the save:

if (!empty($joined) && $success === true) {
$this->__saveMulti($joined, $this->id);
}

What this does is prior to the main record save, an array called $joined is 
populated with your relationships from the calling model (I believe it was 
Project), so your ProjectTasks are auto saved if they exist in the data array
that is saved. 

You can manage this though. There few options I suppose:
1) Unbind your relationships prior to Project->save() and manage the 
saves manually in your afterSave as you want to do now. This should
force the saves to happen as you expect. This is a bit kludgy but 
workable under your current code base.
2) Copy the ProjectTask data out of the data you pass to Project->save
and put it somewhere you will play with later. Not the cleanest approach.
3) This might be tricky, but is probably most ideal and complies best 
with the framework architecture: Call the ProjectTask beforeSave() inside
the Project beforeSave and pass/assign the array of ProjectTask data to it.
The ProjectTask beforeSave needs to be able to detect the array vs. a
single value, but otherwise this is probably the best solution.

Good luck,
Fred


Joshua McFarren wrote:
>> Have you tried deleting all the files that have accumulated in my app/
>> tmp/cache directory.  Sometimes when I have had these kinds of strange
>> problems it was because of an outdated cached model file.
>> 
>
> Hi Aran,
>
> I deleted the cache and unfortunately that didn't help. I'm pretty
> sure the wrong Model:save() is being called. I need to figure why
> ProjectTask::save() is not handling this. Still stumped and its
> probably something very obvious.
>
> Best,
> Joshua
>
>   
>> sparked an idea to override ProjectTask::save() to see if that's even
>> being called and its not!
>>
>> class ProjectTask extends AppModel {
>> var $name = 'ProjectTask';
>> function save() {
>> echo "ProjectTask::save()";
>> exit;
>> }
>> }
>>
>> Yet the data is being stored in the DB. So it must be saving through
>> Schedule::save(). ProjectTask and Schedule are associated models so I
>> guess that's possible right? How can I force ProjectTask::save() to
>> handle 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
-~--~~~~--~~--~--~---



Best practice for setting current user variable?

2008-04-18 Thread John R

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



Re: More of an SQL question ... having a hard time with this statement

2008-04-18 Thread Robert

I would add a time field to the database record for each revision.
Then order by descending time and limit your query to 15 rows.  (You
can order by descending revision_id also, but once you have many users
you could easily have more than 15 records where the greatest
revision_id's are equal, and they won't be useful for showing only the
most recent revisions.)

On Apr 18, 4:10 pm, John R <[EMAIL PROTECTED]> wrote:
> In this app, users can upload photos, and then revise them.
>
> The app stores a log of all revisions so they can easily go back to
> them.
>
> The database has: user_id and revision_id
>
> I am trying to write a statement that grabs only the 15 latest
> (highest #) revisions for all users.
>
> So .. if the table looks like:
>
> user_id       revision_id
> 1                1
> 1                2
> 2                1
> 3                 1
> 1                3
> 1                4
> 3                2
>
> It would grab three records: user 1 revision 4, user 2 revision 1 and
> user 3 revision 2
>
> 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
-~--~~~~--~~--~--~---



1.2 HABTM - Anyone actually get this working in a real world application with additional fields in the link table?

2008-04-18 Thread James K

I've been bashing my skull against the wall all day trying to get a
HABTM relationship to save correctly...

Here's the setup:

Member hasOne Account
Member hasAndBelongsToMany Address

This is set up so a member may specify both a permanent address and a
mailing address (if "different than above"). Therefore I have an
address_type in my join table.

When I do $this->Member->read() to populate the form with the existing
data, $this->data is returned as expected:

Array
(
[Member] => Array
(
[id] => 25
[account_id] => 31
)

[Account] => Array
(
[id] => 31
[email] => [EMAIL PROTECTED]
[password] => 5311d17f957e0358b72a697ff92d7c5d224905e9
[first_name] => John
[last_name] => Doe
)

[Address] => Array
(
[0] => Array
(
[id] => 2
[address1] => 999 Bank Street
[address2] => suite 100
[city] => Ottawa
[province_id] => 29
[country] => Canada
[postal_code] => K2B 8L3
[AddressesMember] => Array
(
[address_id] => 2
[member_id] => 25
[address_type] => 1
)

)

[1] => Array
(
[id] => 3
[address1] => 999 knaB teertS
[address2] => abc
[city] => awattO
[province_id] => 29
[country] => Canada Still
[postal_code] => K2B 9L4
[AddressesMember] => Array
(
[address_id] => 3
[member_id] => 25
[address_type] => 2
)

)

)

)

Beautiful! Wonderful! Perfect - everything is retrieved nicely in some
fairly intelligent automagic queries with joins and all.

The pain comes when I try to save...

The data that gets passed to the action from the form looks like this:

Array
(
[Account] => Array
(
[first_name] => Jimmy
[last_name] => King!
[gender] => 16
[preferred_language] => 12
[id] => 31
)

[Member] => Array
(
[citizenship] => 17
[id] => 25
)

[Address] => Array
(
[0] => Array
(
[id] => 2
[address1] => 999 Bank Street
[address2] => changed some stuff
[city] => Ottawa
[province_id] => 29
[postal_code] => K2B 8L3
[AddressesMember] => Array
(
[address_type] => 1
)

)

[1] => Array
(
[id] => 3
[address1] => 999 knaB teertS
[address2] => ...
[city] => awattO
[province_id] => 29
[postal_code] => K2B 9L4
[AddressesMember] => Array
(
[address_type] => 2
)

)

[Address] => Array
(
[0] => 2
[1] => 3
)

)

)

You'll notice the $data['Address']['Address'] has the ids of the
addresses I wish to save - straight out of the docs.

But it doesn't like this at all... here are some of the queries it
tries to run:

SELECT COUNT(*) AS [count] FROM [addresses] AS [Address] WHERE
[Address].[id] = '2'
UPDATE [addresses] SET [address1] = '999 Bank Street', [address2] =
'changed some stuff', [city] = 'Ottawa', [province_id] = '29',
[postal_code] = 'K2B 8L3' WHERE [addresses].[id] = '2'
SELECT COUNT(*) AS [count] FROM [addresses] AS [Address] WHERE
[Address].[id] = '3'
UPDATE [addresses] SET [address1] = '999 knaB teertS', [address2] =
'...', [city] = 'awattO', [province_id] = '29', [postal_code] = 'K2B
9L4' WHERE [addresses].[id] = '3'

Ok, I'm saving each of my addresses, one by one... that's fine. Moving
on...

SELECT [AddressesMember].[member_id] AS [AddressesMember__0] FROM
[addresses_members] AS [AddressesMember] LEFT JOIN [addresses] AS
[Address] ON ([AddressesMembers].[address_id] = [Address].[id]) LEFT
JOIN [members] AS [Member] ON ([AddressesMember].[member_id] =
[Member].[id]) WHERE [AddressesMember].[member_id] = '25'

Finds two rows as it should, then right after it runs this:

SELECT [AddressesMember].[member_id] AS [AddressesMember__0] FROM
[addresses_members] AS [AddressesProspect] LEFT JOIN [addresses] AS
[Addres

Re: More of an SQL question ... having a hard time with this statement

2008-04-18 Thread jonknee

> Any help?

SELECT user_id, MAX(revision_id) FROM your_table GROUP BY user_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: More of an SQL question ... having a hard time with this statement

2008-04-18 Thread jonknee

 > Any help?

SELECT user_id, MAX(revision_id) FROM ck GROUP BY user_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
-~--~~~~--~~--~--~---



More of an SQL question ... having a hard time with this statement

2008-04-18 Thread John R

In this app, users can upload photos, and then revise them.

The app stores a log of all revisions so they can easily go back to
them.

The database has: user_id and revision_id

I am trying to write a statement that grabs only the 15 latest
(highest #) revisions for all users.

So .. if the table looks like:

user_id   revision_id
11
12
21
3 1
13
14
32

It would grab three records: user 1 revision 4, user 2 revision 1 and
user 3 revision 2

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: Wierd Parse error

2008-04-18 Thread R. Rajesh Jeba Anbiah



On Apr 19, 2:23 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Can someone help me out, the following code gives me a parse error but
> I don't know why
>
> class Benefactor extends AppModel {
> var $name = 'Benefactor';
> //var $testA =strtotime(date("n/1/Y"));
> var $hasMany = array(
> 'Picture', 'Blog',
> 'QuestionTo' => array(
> 'className' => 'Question',
> 'foreignKey'=> 'benefactor_id',
> 'conditions'=> 'Question.foruser = 1 AND Question.time>= 
> '.strtotime(date('n/1/Y')).' ',
>
> 'order'=> 'Comment.created DESC',
> 'limit'=> '5',
> 'dependent'=> true
> )
> );'
>
> }
>
> it is this line:
> 'conditions'=> 'Question.foruser = 1 AND Question.time
>
> >= '.strtotime(date('n/1/Y')).' ',
>
> I have no idea why, it seems to not like the "." concatenation but
> that should be valid in PHP yes?

  Declarations cannot have expressions (here strtotime(date('n/1/
Y'))). You'd want to set property in __construct() method--where you
can use expressions. This is a basic PHP and you may want to improve
that.

--
  
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: CakePHP ACL and database naming conventions

2008-04-18 Thread Jee

> "Because they are" probably isn't the answer you had in mind, right?
>
> The tables used by the ACL have been named that as long as I can
> remember, and I guess you're right when you state that they don't seem
> to follow the standard for alphabetical precedence in join tables.
>
> Does it really matter that the ACL component doesn't seem to follow
> this rule?  I ask not to be flippant but to understand why it's
> important to you.

I have two teenagers.  "Because they are" and "Because I said so" are
perfectly useful answers!
:)

It doesn't really matter, I just used to be a proofreader and I notice
things like that.
Thanks for satisfying the curiosity.
Jee
--~--~-~--~~~---~--~~
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: CakePHP ACL and database naming conventions

2008-04-18 Thread R. Rajesh Jeba Anbiah

On Apr 19, 2:22 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Fri, Apr 18, 2008 at 5:15 PM, R. Rajesh Jeba Anbiah
>
> <[EMAIL PROTECTED]> wrote:
>
> >  > So, why are the tables named thus?
> >  > acos
> >  > aros
> >  > aros_acos
>
> "Because they are" probably isn't the answer you had in mind, right?
>
> The tables used by the ACL have been named that as long as I can
> remember, and I guess you're right when you state that they don't seem
> to follow the standard for alphabetical precedence in join tables.
>
> Does it really matter that the ACL component doesn't seem to follow
> this rule?  I ask not to be flippant but to understand why it's
> important to you.

Since you quoted me... I'll be happy if you have an answer.

--
  
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: Session : Single Sign on from other application

2008-04-18 Thread Nelson Cysneros

have you looked at this thread?

getting cake DB session to an external application:

http://groups.google.com/group/cake-php/browse_thread/thread/5a868ad24cff1c83/3127e7971078becf?lnk=gst&q=cysneros#3127e7971078becf

On Apr 18, 1:40 am, acl68 <[EMAIL PROTECTED]> wrote:
> Hello everybody,
>
> I was programming an application with Cake and all was well ;-)
> Then my colleague and I had the idea to share the login procedure with
> the applications he is maintining, so that the login in his
> application and the information should be passed on to my cake
> application -> Single Sign On for our users!
>
> Now I have deep trouble to get those two applications to work
> together. Using the user table from the other database was simple, but
> checking whether somebody has already logged on is what I don't get to
> work. The Userinformation is in the common user table, but how can I
> load the userinformation in my application without an additional
> login?
>
> Has anyone an idea?
>
> My ideas are:
> 1. Switch Cake session handling completely off and use the session
> objects of the general application. But how can I do that?
>
> 2. Transfer the information from Object/Session_otheraplication to
> Object/Session_myCakeapplication . But how can I achieve this? To make
> things worse, both varaiable in which teh Sessiondata ist stored are
> called $session.
>
> The Non-Cake application is the leading application so I cannot change
> anything / much there.
>
> Thanks in advance for any hints and ideas!
>
> Anja
--~--~-~--~~~---~--~~
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: Grails madness??

2008-04-18 Thread R. Rajesh Jeba Anbiah

On Apr 19, 2:16 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I've been learning grails and I came across the following code that I
> assume is standard because it's auto-generated by grails "bake"
> equivalent:
>
>  name="user.id" value="${post?.user?.id}" >
>
> This is basically groovy's equivalent of $form->input where from is
> the "options" tag in cake. The thing that really seems like bad news
> is that User is the actual model object and it's list() function
> (similar to findAll) is being called directly from the view without
> the controller ever even knowing about it. So I was wondering what
> other people thought about this. It seems to me like there's not much
> point to structuring your framework in an MVC architecture if you are
> going to encourage your users to blatantly disregard it's conventions.

What I have concluded lately is that the MVC is a myth for real
projects. If you strictly follow the standards, you'll end up
duplicating the codes (say for example, in cakephp; most of the times,
you'd want to reuse the code of a Component in Helper). Also, sending
model object even in Cake is necessary for certain cases
http://groups.google.com/group/cake-php/browse_frm/thread/5f8ca538868298d0/440ff5f5eafb47e1?#440ff5f5eafb47e1

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



Wierd Parse error

2008-04-18 Thread [EMAIL PROTECTED]

Can someone help me out, the following code gives me a parse error but
I don't know why

class Benefactor extends AppModel {
var $name = 'Benefactor';
//var $testA =strtotime(date("n/1/Y"));
var $hasMany = array(
'Picture', 'Blog',
'QuestionTo' => array(
'className' => 'Question',
'foreignKey'=> 'benefactor_id',
'conditions'=> 'Question.foruser = 1 AND Question.time
>= '.strtotime(date('n/1/Y')).' ',
'order'=> 'Comment.created DESC',
'limit'=> '5',
'dependent'=> true
)
);'
}


it is this line:
'conditions'=> 'Question.foruser = 1 AND Question.time
>= '.strtotime(date('n/1/Y')).' ',

I have no idea why, it seems to not like the "." concatenation but
that should be valid in PHP yes?
--~--~-~--~~~---~--~~
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: CakePHP ACL and database naming conventions

2008-04-18 Thread Chris Hartjes

On Fri, Apr 18, 2008 at 5:15 PM, R. Rajesh Jeba Anbiah
<[EMAIL PROTECTED]> wrote:
>  >
>  > So, why are the tables named thus?
>  > acos
>  > aros
>  > aros_acos

"Because they are" probably isn't the answer you had in mind, right?

The tables used by the ACL have been named that as long as I can
remember, and I guess you're right when you state that they don't seem
to follow the standard for alphabetical precedence in join tables.

Does it really matter that the ACL component doesn't seem to follow
this rule?  I ask not to be flippant but to understand why it's
important to you.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@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: Session : Single Sign on from other application

2008-04-18 Thread R. Rajesh Jeba Anbiah

On Apr 18, 1:40 pm, acl68 <[EMAIL PROTECTED]> wrote:
> Hello everybody,
>
> I was programming an application with Cake and all was well ;-)
> Then my colleague and I had the idea to share the login procedure with
> the applications he is maintining, so that the login in his
> application and the information should be passed on to my cake
> application -> Single Sign On for our users!
>
> Now I have deep trouble to get those two applications to work
> together. Using the user table from the other database was simple, but
> checking whether somebody has already logged on is what I don't get to
> work. The Userinformation is in the common user table, but how can I
> load the userinformation in my application without an additional
> login?
>
> Has anyone an idea?
>
> My ideas are:
> 1. Switch Cake session handling completely off and use the session
> objects of the general application. But how can I do that?
>
> 2. Transfer the information from Object/Session_otheraplication to
> Object/Session_myCakeapplication . But how can I achieve this? To make
> things worse, both varaiable in which teh Sessiondata ist stored are
> called $session.
>
> The Non-Cake application is the leading application so I cannot change
> anything / much there.
>
> Thanks in advance for any hints and ideas!

 You may want to reset the Session cookie name from CAKEPHP to
PHPSESSID or anything that the other application is using. Look at
core.php

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



Grails madness??

2008-04-18 Thread [EMAIL PROTECTED]

I've been learning grails and I came across the following code that I
assume is standard because it's auto-generated by grails "bake"
equivalent:



This is basically groovy's equivalent of $form->input where from is
the "options" tag in cake. The thing that really seems like bad news
is that User is the actual model object and it's list() function
(similar to findAll) is being called directly from the view without
the controller ever even knowing about it. So I was wondering what
other people thought about this. It seems to me like there's not much
point to structuring your framework in an MVC architecture if you are
going to encourage your users to blatantly disregard it's conventions.

--~--~-~--~~~---~--~~
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: CakePHP ACL and database naming conventions

2008-04-18 Thread R. Rajesh Jeba Anbiah

On Apr 19, 1:56 am, Jee <[EMAIL PROTECTED]> wrote:
> According to the Cake 1.2 manual: "Join tables, used in
> hasAndBelongsToMany relationships between models should be named after
> the model tables they will join, in alphabetical order (apples_zebras
> rather than zebras_apples). If your application features this type of
> relationship between your Tag and Post models, the table name would be
> posts_tags."
>
> So, why are the tables named thus?
> acos
> aros
> aros_acos
>
> Probably missing something obvious, but I am new to Cake.
> Just scratching my head on this one...

If you ask smart questions, you may not get answer except an
advice to post a ticket.

--
  
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: How to view all Cake queries?

2008-04-18 Thread R. Rajesh Jeba Anbiah

On Apr 18, 8:05 pm, grigri <[EMAIL PROTECTED]> wrote:
> Write the sql queries to a text log file.
>
> I created a custom datasource to allow syntax hilighting of the sql
> log and file-based logging.
>
> More details in this 
> thread:http://groups.google.com/group/cake-php/browse_thread/thread/9609699b...
>
> Code here:http://openpaste.org/en/6181/

I know, it's dumb; but, where to put this file?

--
  
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: i18n in cakephp

2008-04-18 Thread R. Rajesh Jeba Anbiah

On Apr 18, 10:19 pm, "b logica" <[EMAIL PROTECTED]> wrote:
> 2008/4/17 robert123 <[EMAIL PROTECTED]>:
> >  Hi, I want to develop website using cakephp in Chinese and English
> >  using utf8 encoding  I am trying to use cakephp 1.2 version, I have
> >  been searching around the web on the docs on i18n, but it is rather
> >  scatter, below are a few problems where I have difficulties, hopefully
> >  anyone can help me, thank you
>
> >  1." .po files should be encoded using ISO-8859-1", this is a nightmare
> >  maintenance for Chinese character, reason being once it is in
> >  iso-8859-1 format, if you want to change any messages, the messages
> >  cannot be seen easily, example 我 is me in chinese, but if you store it
> >  in  ISO-8859-1 encoding it is \u6211, hence it becomes very hard to
> >  hunt down the words in message file, but it will be different if it is
> >  store in UTF8 encoding, as the Chinese character can be store, edit,
> >  view naturally as it is, anyone can highlight any solution to this ?
> >  like A good editor to convert these eastern characters to the correct
> >  encoding, or making cakephp read utf8 encoding po file?

There is no such restriction; you can use utf8. po/mo based i18n
solution is hectic for client projects; every clients prefer to edit
the language contents. Apparently i18n in Cake has more miles to go,
IM*H*O.

> >  2. Another problem , take an example a product table that has
> >  id, title and description field
> >  there is a product in english and chinese, how do you with the chosen
> >  language pick up the correct product in database in that language,
> >  other than using another lookup table.
>
> Have a look at this implementation by ros (Rostislav):
>
> http://www.palivoda.eu/2008/04/i18n-in-cakephp-12-database-content-tr...
>
> In a nutshell, you create multiple columns per language. So, instead
> of "name" you'd have "name_eng" & ("name_" + whichever code you need
> for your Chinese).

   I second this solution. But, I'd want to avoid the unnecessary lang
code suffix on default field.

> Actually, that should really be "name_en" for English, but CakePHP
> goes against the ISO spec on this.

ISO spec has lot of revisions and versions
http://www.loc.gov/standards/iso639-2/php/code_list.php

> Anyway, this looks like a better implementation than the default,
> which is to dump everything, regardless of the model, into a single
> "i18n" table.

 I strongly believe that no one would use default implementation

> >  3. Lastly is the error message for validation of users inputs, I
> >  search the  new Forms built in helper, doesnt seem to tell us how to
> >  show the different language depending on the user locale

 http://groups.google.com/group/cake-php/web/faq

> >  4. I am thinking also does caching actually works with i18n, reason
> >  being you execute
>
> >  $this->L10n = new L10n();
> >  $this->L10n->get("en");
> >   Configure::write('Config.language', "en");
> >  , but let say you have the webpage cache seperately english and
> >  chinese, how does it recognize which one to pickup?
>
> I hope you find the answer to this. I've asked the same question here
> without a response. There's a mechanism, apparently, to prefix the
> cache filename but I could not get it to play nice.

 Look for the second param in $this->element()--when used, it
might be sufficient (though not reserved for that purpose).

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



CakePHP ACL and database naming conventions

2008-04-18 Thread Jee

According to the Cake 1.2 manual: "Join tables, used in
hasAndBelongsToMany relationships between models should be named after
the model tables they will join, in alphabetical order (apples_zebras
rather than zebras_apples). If your application features this type of
relationship between your Tag and Post models, the table name would be
posts_tags."

So, why are the tables named thus?
acos
aros
aros_acos

Probably missing something obvious, but I am new to Cake.
Just scratching my head on this one...
Thanks,
Jee
--~--~-~--~~~---~--~~
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: Paginate on the other model?

2008-04-18 Thread Mech7

Ok i have found a way posted on the bin..
http://bin.cakephp.org/saved/21775

THe problem is when i know do a paginate on the Tag model itself this
function will override the deault thus i wont get any result back :(

On Apr 16, 2:32 pm, MonkeyGirl <[EMAIL PROTECTED]> wrote:
> > but how can ipaginatethe articles and not the categories?
>
> Try linking to /articles/index/categories:category-slug instead of /
> categories/view/category-slug
>
> This will go to the index function in your articles controller. Try
> printing out $this->params['named'] - notice how it's an array with
> things before colons as keys, and things after them as values. So you
> can make something like this:
>
> function index() {
>   $categorySlug = $this->params['named']['category'];
>   $category = $this->Article->Category->findBySlug($categorySlug);
>   $scope = array('Article.category_id' => $colour['Colour']['id']);
>   $paginatedList = $this->paginate(NULL, $scope);
>
> }
>
> (This is mentioned in another 
> thread:http://groups.google.com/group/cake-php/browse_thread/thread/cf11aefa...
> )
>
> This is all well and good if categories have many articles... I'm not
> so sure about HABTM. findAll doesn't seem to play so well with HABTM
> relationships, and it looks like the paginator's using findAll...
>
> (This looks relevant:https://trac.cakephp.org/ticket/1209)
>
> So, yes, good question. Does anyone else know if the paginator can
> work with HABTM conditions?
>
> Sorry I couldn't be of more help!
> Zoe.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $form->input() takes 'label' argument, what about $form->textarea()?

2008-04-18 Thread 703designs

Nevermind, that's automatically managed.

On Apr 18, 4:05 pm, 703designs <[EMAIL PROTECTED]> wrote:
> OK, great. Also, how do I assign a value to $form->hidden? I'd like to
> update the "created" time of my tasks to NOW()...
>
> On Apr 18, 3:51 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
> > $form->input('field', array('type'=>'textarea'));
>
> > On Apr 18, 3:47 pm, 703designs <[EMAIL PROTECTED]> wrote:
>
> > > Oh, OK, that makes sense (I suspected that once I noticed that
> > > textarea also didn't use an 'error' key). The API doesn't make this
> > > clear: How do I draw a textarea using $form->input?
>
> > > On Apr 18, 3:40 pm, nate <[EMAIL PROTECTED]> wrote:
>
> > > > It's not an inconsistency.  FormHelper::input() is a *wrapper
> > > > method*.  It generates an input field (which is automagically
> > > > determined based on column type), a label, a wrapper div, and an error
> > > > message, where applicable.  FormHelper::textarea() just renders a
> > > > textarea.  In fact, if you call $form->input() on a text-type column,
> > > > it calls $form->textarea().
>
> > > > On Apr 18, 3:19 pm, 703designs <[EMAIL PROTECTED]> wrote:
>
> > > > > I'm having trouble with one inconsistency I've found while building a
> > > > > small app. $form->input accepts a 'label' key in the options array,
> > > > > but $form->textarea doesn't. Why is this? Is there another key that
> > > > > will work like input's "label"?
--~--~-~--~~~---~--~~
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: Rendering element from controller

2008-04-18 Thread Andrew Assarattanakul

With CakePHP v1.2.0.6311 you can do $this-
>render(null,null,DS.'elements'.DS.'example'); to use the default
layout along with your element.

On Apr 15, 3:33 am, chanon <[EMAIL PROTECTED]> wrote:
> I've found the workaround, just use the $file parameter:
> $this->render(null, 'ajax', VIEW . /elements/example.ctp);
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



CakePHP with directory password protection?

2008-04-18 Thread Jon

I have CakePHP installed, and naturally it uses mod_rewrite to make
the URLs clean.  I made a modification to the htaccess file to allow
me to ignore it for a certain directory.  But then within that
directory, I have an htaccess that defines password protection of that
directory.  Now I get a 404 error.  How can I keep password
protection, but allow it to function as normal?  Here are my files:

.htaccess in document root:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} grades
RewriteRule ^.*$ - [L]




   RewriteEngine on
   RewriteRule^$ app/webroot/[L]
   RewriteRule(.*) app/webroot/$1 [L]



.htaccess in the directory I want to protect:
AuthType Basic
AuthName "Restricted Area"
AuthUserFile "/home/username/.htpasswds/public_html/grades/csv/passwd"
require valid-user

--~--~-~--~~~---~--~~
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: Custom SQL call problem (Solved! => My mistake)

2008-04-18 Thread Defranco

Solved!

It was my mistake, not a bug: I had a user permission problem so it
returned null for [Create Procedure]

Thanks for your help Clark

/defranco
--~--~-~--~~~---~--~~
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: $form->input() takes 'label' argument, what about $form->textarea()?

2008-04-18 Thread 703designs

OK, great. Also, how do I assign a value to $form->hidden? I'd like to
update the "created" time of my tasks to NOW()...

On Apr 18, 3:51 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> $form->input('field', array('type'=>'textarea'));
>
> On Apr 18, 3:47 pm, 703designs <[EMAIL PROTECTED]> wrote:
>
> > Oh, OK, that makes sense (I suspected that once I noticed that
> > textarea also didn't use an 'error' key). The API doesn't make this
> > clear: How do I draw a textarea using $form->input?
>
> > On Apr 18, 3:40 pm, nate <[EMAIL PROTECTED]> wrote:
>
> > > It's not an inconsistency.  FormHelper::input() is a *wrapper
> > > method*.  It generates an input field (which is automagically
> > > determined based on column type), a label, a wrapper div, and an error
> > > message, where applicable.  FormHelper::textarea() just renders a
> > > textarea.  In fact, if you call $form->input() on a text-type column,
> > > it calls $form->textarea().
>
> > > On Apr 18, 3:19 pm, 703designs <[EMAIL PROTECTED]> wrote:
>
> > > > I'm having trouble with one inconsistency I've found while building a
> > > > small app. $form->input accepts a 'label' key in the options array,
> > > > but $form->textarea doesn't. Why is this? Is there another key that
> > > > will work like input's "label"?
--~--~-~--~~~---~--~~
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: $form->input() takes 'label' argument, what about $form->textarea()?

2008-04-18 Thread [EMAIL PROTECTED]

$form->input('field', array('type'=>'textarea'));

On Apr 18, 3:47 pm, 703designs <[EMAIL PROTECTED]> wrote:
> Oh, OK, that makes sense (I suspected that once I noticed that
> textarea also didn't use an 'error' key). The API doesn't make this
> clear: How do I draw a textarea using $form->input?
>
> On Apr 18, 3:40 pm, nate <[EMAIL PROTECTED]> wrote:
>
> > It's not an inconsistency.  FormHelper::input() is a *wrapper
> > method*.  It generates an input field (which is automagically
> > determined based on column type), a label, a wrapper div, and an error
> > message, where applicable.  FormHelper::textarea() just renders a
> > textarea.  In fact, if you call $form->input() on a text-type column,
> > it calls $form->textarea().
>
> > On Apr 18, 3:19 pm, 703designs <[EMAIL PROTECTED]> wrote:
>
> > > I'm having trouble with one inconsistency I've found while building a
> > > small app. $form->input accepts a 'label' key in the options array,
> > > but $form->textarea doesn't. Why is this? Is there another key that
> > > will work like input's "label"?
--~--~-~--~~~---~--~~
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: $form->input() takes 'label' argument, what about $form->textarea()?

2008-04-18 Thread 703designs

Oh, OK, that makes sense (I suspected that once I noticed that
textarea also didn't use an 'error' key). The API doesn't make this
clear: How do I draw a textarea using $form->input?

On Apr 18, 3:40 pm, nate <[EMAIL PROTECTED]> wrote:
> It's not an inconsistency.  FormHelper::input() is a *wrapper
> method*.  It generates an input field (which is automagically
> determined based on column type), a label, a wrapper div, and an error
> message, where applicable.  FormHelper::textarea() just renders a
> textarea.  In fact, if you call $form->input() on a text-type column,
> it calls $form->textarea().
>
> On Apr 18, 3:19 pm, 703designs <[EMAIL PROTECTED]> wrote:
>
> > I'm having trouble with one inconsistency I've found while building a
> > small app. $form->input accepts a 'label' key in the options array,
> > but $form->textarea doesn't. Why is this? Is there another key that
> > will work like input's "label"?
--~--~-~--~~~---~--~~
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: $form->input() takes 'label' argument, what about $form->textarea()?

2008-04-18 Thread nate

It's not an inconsistency.  FormHelper::input() is a *wrapper
method*.  It generates an input field (which is automagically
determined based on column type), a label, a wrapper div, and an error
message, where applicable.  FormHelper::textarea() just renders a
textarea.  In fact, if you call $form->input() on a text-type column,
it calls $form->textarea().

On Apr 18, 3:19 pm, 703designs <[EMAIL PROTECTED]> wrote:
> I'm having trouble with one inconsistency I've found while building a
> small app. $form->input accepts a 'label' key in the options array,
> but $form->textarea doesn't. Why is this? Is there another key that
> will work like input's "label"?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



$form->input() takes 'label' argument, what about $form->textarea()?

2008-04-18 Thread 703designs

I'm having trouble with one inconsistency I've found while building a
small app. $form->input accepts a 'label' key in the options array,
but $form->textarea doesn't. Why is this? Is there another key that
will work like input's "label"?
--~--~-~--~~~---~--~~
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: Create a MySQL database with cakephp

2008-04-18 Thread Juan Luis Baptiste

On Fri, Apr 18, 2008 at 1:32 AM, Atomic Guava <[EMAIL PROTECTED]> wrote:
>
>
>  Is there a way to do this in the model as it instantiates?
>
>  I had a dig through the API, but couldn't find anything similar to the
>  beforeFilter() controller method - does anything exist like that for
>  models?
>
>  Basically, I've love to be able to automatically create a table the
>  first time the controller gets requested :)
>
>

Maybe beforeSave() is what you need ?


Cheers,
-- 
Juan Luis Baptiste

--~--~-~--~~~---~--~~
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: Default template: Turn off CakePHP header and SQL debug? Also, $html->?

2008-04-18 Thread 703designs

Never mind again, things are up and running well.

On Apr 18, 1:36 pm, 703designs <[EMAIL PROTECTED]> wrote:
> Never mind the first two questions; I was able to turn off SQL output
> by setting debug to 1, and I made my own copy of default.ctp as a new
> template, choosing to remove the header and footer regions.
>
> On Apr 18, 1:22 pm, 703designs <[EMAIL PROTECTED]> wrote:
>
> > First, I've begun building my own pages for a small To Do list app,
> > which I'm making while following the old blog tutorial, in the Beta.
> > How do I get rid of the CakePHP header bar? And how can I turn off the
> > SQL query debug message at the bottom?
>
> > Finally, I did figure this out before, but I've forgotten: What's the
> > new way to output a link using the HtmlHelper class? $html->link is
> > deprecated.
--~--~-~--~~~---~--~~
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: Default template: Turn off CakePHP header and SQL debug? Also, $html->?

2008-04-18 Thread 703designs

Never mind the first two questions; I was able to turn off SQL output
by setting debug to 1, and I made my own copy of default.ctp as a new
template, choosing to remove the header and footer regions.

On Apr 18, 1:22 pm, 703designs <[EMAIL PROTECTED]> wrote:
> First, I've begun building my own pages for a small To Do list app,
> which I'm making while following the old blog tutorial, in the Beta.
> How do I get rid of the CakePHP header bar? And how can I turn off the
> SQL query debug message at the bottom?
>
> Finally, I did figure this out before, but I've forgotten: What's the
> new way to output a link using the HtmlHelper class? $html->link is
> deprecated.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Default template: Turn off CakePHP header and SQL debug? Also, $html->?

2008-04-18 Thread 703designs

First, I've begun building my own pages for a small To Do list app,
which I'm making while following the old blog tutorial, in the Beta.
How do I get rid of the CakePHP header bar? And how can I turn off the
SQL query debug message at the bottom?

Finally, I did figure this out before, but I've forgotten: What's the
new way to output a link using the HtmlHelper class? $html->link is
deprecated.
--~--~-~--~~~---~--~~
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: i18n in cakephp

2008-04-18 Thread b logica

2008/4/17 robert123 <[EMAIL PROTECTED]>:
>
>  Hi, I want to develop website using cakephp in Chinese and English
>  using utf8 encoding  I am trying to use cakephp 1.2 version, I have
>  been searching around the web on the docs on i18n, but it is rather
>  scatter, below are a few problems where I have difficulties, hopefully
>  anyone can help me, thank you
>
>  1." .po files should be encoded using ISO-8859-1", this is a nightmare
>  maintenance for Chinese character, reason being once it is in
>  iso-8859-1 format, if you want to change any messages, the messages
>  cannot be seen easily, example 我 is me in chinese, but if you store it
>  in  ISO-8859-1 encoding it is \u6211, hence it becomes very hard to
>  hunt down the words in message file, but it will be different if it is
>  store in UTF8 encoding, as the Chinese character can be store, edit,
>  view naturally as it is, anyone can highlight any solution to this ?
>  like A good editor to convert these eastern characters to the correct
>  encoding, or making cakephp read utf8 encoding po file?

I'm unaware of any such limitation. But I'm dealing with chars that
are mostly in 8859-1 so it's not something I would have necessarily
noticed.

>  2. Another problem , take an example a product table that has
>  id, title and description field
>  there is a product in english and chinese, how do you with the chosen
>  language pick up the correct product in database in that language,
>  other than using another lookup table.

Have a look at this implementation by ros (Rostislav):

http://www.palivoda.eu/2008/04/i18n-in-cakephp-12-database-content-translation-part-2/

In a nutshell, you create multiple columns per language. So, instead
of "name" you'd have "name_eng" & ("name_" + whichever code you need
for your Chinese).

This is similar to something I've already been doing but is far more robust.

Actually, that should really be "name_en" for English, but CakePHP
goes against the ISO spec on this.

Anyway, this looks like a better implementation than the default,
which is to dump everything, regardless of the model, into a single
"i18n" table.


>  3. Lastly is the error message for validation of users inputs, I
>  search the  new Forms built in helper, doesnt seem to tell us how to
>  show the different language depending on the user locale

Please search this group for that. It's been brought up a few times
very recently.

>  4. I am thinking also does caching actually works with i18n, reason
>  being you execute
>
>  $this->L10n = new L10n();
>  $this->L10n->get("en");
>   Configure::write('Config.language', "en");
>  , but let say you have the webpage cache seperately english and
>  chinese, how does it recognize which one to pickup?
>

I hope you find the answer to this. I've asked the same question here
without a response. There's a mechanism, apparently, to prefix the
cache filename but I could not get it to play nice.

--~--~-~--~~~---~--~~
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: sitepoint tutorial

2008-04-18 Thread Sliv

Possibly an issue with your mod_rewrite setup, check your .htaccess
rules - also keep in mind that sitepoint article is around 2 years old
iirc.

--~--~-~--~~~---~--~~
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: Best way to use $html->link ?

2008-04-18 Thread Sliv

The first way is the recommended method, so that you can have more
flexibility with routing if/when needed.

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



sitepoint tutorial

2008-04-18 Thread teerg

I am going through the sitepoint tutorial (http://www.sitepoint.com/
article/application-development-cakephp) getting the following
problem:
My root folder is http://htdocs/notes) To see the scaffolding page I
have to go to http://localhost/notes/index.php/notes instead of
http://localhost/notes/notes (as mentioned in the tutorial) following
the 'add link' I get on http://localhost/notes/index.php/notes I am
redirected to http://localhost/notes/notes/add and get a 'object not
found error'. However manually going to 
http://localhost/notes/index.php/notes/add
gives me the right content.
What am I doing wrong here?

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



Best way to use $html->link ?

2008-04-18 Thread Neveldo

Hi all,

I've an simple question :)

Which is the best way to do a link using $html->link :

1) $html->link('Edit your profile', array('controller' => 'users',
'action' => 'profiles_edit')

2) $html->link('Edit your profile', '/users/edit')

Is the second way depreciated for 1.2 ?

Thank !

Cordially,
Neveldo : http://www.neveldo.fr
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



i18n in cakephp

2008-04-18 Thread robert123

Hi, I want to develop website using cakephp in Chinese and English
using utf8 encoding  I am trying to use cakephp 1.2 version, I have
been searching around the web on the docs on i18n, but it is rather
scatter, below are a few problems where I have difficulties, hopefully
anyone can help me, thank you

1." .po files should be encoded using ISO-8859-1", this is a nightmare
maintenance for Chinese character, reason being once it is in
iso-8859-1 format, if you want to change any messages, the messages
cannot be seen easily, example 我 is me in chinese, but if you store it
in  ISO-8859-1 encoding it is \u6211, hence it becomes very hard to
hunt down the words in message file, but it will be different if it is
store in UTF8 encoding, as the Chinese character can be store, edit,
view naturally as it is, anyone can highlight any solution to this ?
like A good editor to convert these eastern characters to the correct
encoding, or making cakephp read utf8 encoding po file?

2. Another problem , take an example a product table that has
id, title and description field
there is a product in english and chinese, how do you with the chosen
language pick up the correct product in database in that language,
other than using another lookup table.

3. Lastly is the error message for validation of users inputs, I
search the  new Forms built in helper, doesnt seem to tell us how to
show the different language depending on the user locale

4. I am thinking also does caching actually works with i18n, reason
being you execute

$this->L10n = new L10n();
$this->L10n->get("en");
 Configure::write('Config.language', "en");
, but let say you have the webpage cache seperately english and
chinese, how does it recognize which one to pickup?


http://www.generics.ws";>www.generics.ws
http://www.genericsmed.com";>www.genericsmed.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
-~--~~~~--~~--~--~---



Findall on a belong b belong c.name='fred'

2008-04-18 Thread [EMAIL PROTECTED]

I have 3 models:
A belongs to B
B belongs to C

I want to findAll A where C.name='fred'.

I had assumed that cake would just left join the 3 tables and c.name
would be accessible in the query. But regardless of what level of
recursive I set, it only left joins A and B and then does
multitudinous other queries to get C. Hence I can't refer to c.name in
the query.

I've searched and read lots of messages and trac item that implies
that Cake is doing what it thinks is correct.

If so, what is the recommended way of doing this query?

Do the new 'bindable'/'container' behaviours (which should be used?)
help with this?

Thanks
Peter

--~--~-~--~~~---~--~~
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: folder problem

2008-04-18 Thread Chris Hartjes

On Fri, Apr 18, 2008 at 5:23 AM, teerg <[EMAIL PROTECTED]> wrote:
>
>  I just started with the sitepoint tutorial. I've set up a test site
>  with rootdirectory http://localhost/notes for some reason when I want
>  to see the scaffolding of the notes table I have to go to the
>  following url: http://localhost/notes/index.php/notes instead of
>  http://localhost/notes/notes.
>  If I get to http://localhost/notes/index.php/notes and want to add/
>  delete ... the link directes me to (http://localhost/notes/add) and
>  gives an error (object not found) if I manually go to:
>  http://localhost/notes/index.php/notes/add I receive the right content
>  What is wrong in the set up?

The pretty URL's only work if you have mod_rewrite (or other rewriting
rules) setup.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@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
-~--~~~~--~~--~--~---



model query indexes by a letter

2008-04-18 Thread hutchic

With the following function

function calculate_due(){
$query = "
SELECT i.id, i.client_id, ifnull(total,'0') as 
total_due,
ifnull(i.due,'NA') as due_date, ifnull(sum(p.amount),0) as total_paid,
ifnull(i.total - sum(p.amount),i.total) as total_still_due
FROM invoices i LEFT JOIN payments p ON p.invoice_id = 
i.id
WHERE total > 0
GROUP BY p.client_id
ORDER BY due_date";
$ret = $this->query($query);
pr($ret);
die('');
}

The output I get is

Array
(
[0] => Array
(
[i] => Array
(
[id] => 8
[client_id] => 1
)

[0] => Array
(
[total_due] => 3.250
[due_date] => NA
[total_paid] => 0.00
[total_still_due] => 3.250
)

)

)

In version 1.1.19.6305

Help is greatly appreciated
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Router, Controller change CakePHP 1.2

2008-04-18 Thread Jeebs24

Hello,

First of all I already tried searching, but couldn't find that
answer.  Maybe I'm searching for the wrong thing.  But here's the
question:

How do I change the position of the controller in the URL? For example
I want to keep everything as is

http://www.cakerules.ca/my_app/controller/action/var1/var2/etc

and want to change to something like:

http://www.cakerules.ca/my_app/newlayout/controller/action/var1/var2/etc

I want the first parameter of the app to be "newlayout" and not
controller.  The reason I want to do this is to be able to change the
layout and not have to copy the same app and the URL would look
better.

I'm a newbie so please forgive me if what I am trying to do seems
moronic.  If you can suggest something that follows convention, that
would be perfect.

Thank you in advanced.

--~--~-~--~~~---~--~~
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 with autocomplete in IE

2008-04-18 Thread lekshmi

Thanks a lot.Now it is working.
Cheers. :):)

On Apr 17, 5:21 pm, grigri <[EMAIL PROTECTED]> wrote:
> I don't know if it's relevant, but try adding this javascript to the
> relevant page:
>
> try {
>   document.execCommand("BackgroundImageCache", false, true);
>
> } catch(err) {}
>
> [put it in an ie cc - nothing else needs it]
>
> On Apr 17, 11:12 am, lekshmi <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I'm using cakephp version 1.1.17.5612. There is a problem with auto
> > complete.I'm using autocomplete helper without using auto complete
> > component. autocomplete is working fine in firefox. But has some problems in
> > IE. While entering something in textbox for autocomplete or while mouse
> > overing the contents of autocomplete div , other background images in the
> > page flickers :(. This happens only in IE. Can anyone help me to solve these
> > problems.
>
> > Code used
>
> >  > $ajax->autoComplete('Category/name','/categories/autocomplete',array('frequency'=>'0.01',
> > 'class'=>'auto_complete_new'));  ?>
>
> > autocomplete function used in categories controller
>
> > function autocomplete()
> > {
> > $this->layout = "ajax";
> > $this->set('categories', $this->Category->findAll("name LIKE
> > '{$this->data['Category']['name']}%'",array('name'), 'name ASC',10));
>
> > }
>
> > view for autocomplete
>
> > 
> >  > foreach($categories as $category): ?>
> > 
> > 
> > 
>
> > css for autocomplete
>
> > .auto_complete_new
> > {
> >   font-family : Tahoma, Verdana, Geneva, Arial, Helvetica, sans-serif;
> >   font-size : 12px;
> >   color:black;
> >   text-align:left;
>
> > }
>
> > .auto_complete_new ul
> > {
> >   width: 100%;
> >   margin: 0;
> >   padding: 0;overflow-x:hidden;
> >   list-style-type: none;
>
> > }
>
> > .auto_complete_new ul li
> > {
> >   width: 170;
> >   margin: 0;
> >   padding: 3px;
> >   border-bottom: 1px solid #eee;
> >   list-style-type: none;
> >   /*background-color: #00CCFF */
> >   background-color: #C6
>
> > }
>
> > .auto_complete_new li.selected
> > {
> > color:#FFF;background-color: #A2CD5A;
>
> > }
>
> > Thanks,
> > Lekshmi
>
> > --
> > View this message in 
> > context:http://www.nabble.com/Problem-with-autocomplete-in-IE-tp16740179p1674...
> > Sent from the CakePHP mailing list archive at Nabble.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: cakePHP or not?

2008-04-18 Thread ReiToei

Aranworld: Those urls could be generated by any one of the hundreds of
frameworks available in for php, java, python or lisp.

The only real way to know what framework is running is to FTP or SSH
in to the server running the application and look at files.
I would agree with Dr. Tarique Sani; the right tool for the right job.

-Rei

On Apr 17, 4:35 pm, aranworld <[EMAIL PROTECTED]> wrote:
> These are typical CakePHP urls:
>
> http://www.domain.com/articles/view/354http://www.domain.com/staff_bios/http://www.domain.com/pages/about_us/http://www.domain.com/news/index
>
> Look for the pattern of a plural word followed by either "index" or
> "view".  At least if they are clean URLs like this, and the site is
> running well, then even if it is not CakePHP, it is probably something
> decent.
>
> Urls that look like this are probably not CakePHP:
>
> http://www.domain.com/article/160/really-long-article-titles-like-thi...http://www.domain.com/index.php?type=Articles&sort=namehttp://www.domain.com/news.php?sort=year
>
> In other words, you shouldn't be seeing direct calls to any file with
> a .php extension.  And you won't generally see really long article
> titles as part of the url.
>
> If the URL looks like either of these two below, kick his ass to the
> curb  : )
>
> http://www.domain.com/Default.asp?bhcp=1http://www.domain.com/site/help/training.jsp?top=28&mid=29
>
> On Apr 17, 8:20 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
>
> > If you really don't know the difference then why bother?
>
> > Focus on getting a solution... Or hire a project manager who you can trust!
>
> > Wait a min!! Is it that you are the project manager :o)
>
> > Yes looking at the source code of the rendered page can give enough clues
>
> > Cheers
> > Tarique
>
> > On Thu, Apr 17, 2008 at 7:55 PM, foongoos <[EMAIL PROTECTED]> wrote:
>
> > > I have a free lance developer that wants to do a job for me and he
> > > sounds very promising. The project is based on cake but I am afraid
> > > that I will not be able to tell the difference if he used another
>
> > --
> > =
> > 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: Which CakePHP version should I use?

2008-04-18 Thread Sourabh Sharma

Hello All,

I am working on a cakephp from the last one year in stable version but
i notice that in the latest version of cakephp ie. beta version more
have more good functionality in that. So I prefer to use that beta
version of cakephp.

Thanks
Sourabh Sharma

On Apr 18, 8:04 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> > where can i get the manual about this?
>
> http://book.cakephp.org
>
> > i also get confused with the form helper such as form->create(), how to
> > change the model n the destination where i'll post the form?
>
> $form->create('Post', array('url' => array('controller' => 'cake',
> 'action' => 'is_great')));
> $form->create('Post', array('url' => '/cake/is_great'));
>
> > i tried to generete the api reference using javadocs, some past it was so
> > helpfull but i hope i can get a better one, anyone have?
>
> > thanks,
>
> > On Fri, Mar 7, 2008 at 4:50 AM, SumanRS <[EMAIL PROTECTED]> wrote:
>
> > > > Oh I forget about:
>
> > > > * Improved models validation
> > > > * Localization and Internationalization
> > > > * New Shells
>
> > > Baking (to automatically generate models, views, controllers and
> > > more)! :)
>
> > > I would vote this as the best new feature and a really powerful one.
> > > It makes development on CakePHP so much easier...
>
> > --
> > inoex135
> > I'm a newbie who want to be a hacker
> >http://inoex135.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
-~--~~~~--~~--~--~---



Custom controller directories

2008-04-18 Thread el.pescado

Hi,

I have a website written with CakePHP. Website is divided into dwo
distinct sections - section for visitors, accessible from /, and
administration panel, which should be located in url /admin (or
something). I want controllers for visitors to be located physically
in /app/controllers directory and controllers for admin panel in /app/
controllers/admin directory. I want models to be shared, though. I
have found that cake searches for controller files anywhere in /app/
controllers directory. Is there a possibility to control where cake
looks for controllers (ie. look for basic controllers only in /app/
controllers, not in subdirectories; and look for admin controllers in /
app/controllers/admin dir).

I have set routing for /admin/.

Thanks,
Przemek

P.S. I have found CAKE_ADMIN, but it is not what I search for.

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



schema syntax documentation

2008-04-18 Thread gino pilotino

hello,
is there any documentation for the new schema generation syntax ?
i.e. to define foreign/primary keys and a list with all supported
(sql) types.
i didn't find much so, may somebody please post a link ?
thank you,

-d.

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



Filtering hasMany tables

2008-04-18 Thread matw8

G'day all,
I've written a telco billing system using CakePHP (which made life
very easy!  Hooray for Cake!) and I have run into an issue while
writing some reports.

I have customers
A Customer hasMany ServiceNumbers
A ServiceNumber hasMany CallRecords

The problem is that I don't want ALL the CallRecords.  I just want the
records for one month.
How can I find a customer, with associated data, while adding a WHERE
criteria to the CallRecords?

Do I have to use bindModel in the controller (gasp!) and put the
criteria in there?

Any hints would be appreciated
Thanks
Matt Waite

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



folder problem

2008-04-18 Thread teerg

I just started with the sitepoint tutorial. I've set up a test site
with rootdirectory http://localhost/notes for some reason when I want
to see the scaffolding of the notes table I have to go to the
following url: http://localhost/notes/index.php/notes instead of
http://localhost/notes/notes.
If I get to http://localhost/notes/index.php/notes and want to add/
delete ... the link directes me to (http://localhost/notes/add) and
gives an error (object not found) if I manually go to:
http://localhost/notes/index.php/notes/add I receive the right content
What is wrong in the set up?

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



cakephp with other websites

2008-04-18 Thread Jon

I have cakephp installed in /public_html/ but I also have an
application I want to run in /public_html/grades/ .  I modified the
htaccess file to look like this:


RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} grades
RewriteRule ^.*$ - [L]




   RewriteEngine on
   RewriteRule^$ app/webroot/[L]
   RewriteRule(.*) app/webroot/$1 [L]


The problem, however, is that I also have a folder that needs to be
executed located at /public_html/grades/csv/ .  Whenever I try to
execute http://mywebsite/grades/csv/ , it gives me a 404 Not found
error.  What 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
-~--~~~~--~~--~--~---



Session : Single Sign on from other application

2008-04-18 Thread acl68

Hello everybody,

I was programming an application with Cake and all was well ;-)
Then my colleague and I had the idea to share the login procedure with
the applications he is maintining, so that the login in his
application and the information should be passed on to my cake
application -> Single Sign On for our users!

Now I have deep trouble to get those two applications to work
together. Using the user table from the other database was simple, but
checking whether somebody has already logged on is what I don't get to
work. The Userinformation is in the common user table, but how can I
load the userinformation in my application without an additional
login?

Has anyone an idea?

My ideas are:
1. Switch Cake session handling completely off and use the session
objects of the general application. But how can I do that?

2. Transfer the information from Object/Session_otheraplication to
Object/Session_myCakeapplication . But how can I achieve this? To make
things worse, both varaiable in which teh Sessiondata ist stored are
called $session.

The Non-Cake application is the leading application so I cannot change
anything / much there.

Thanks in advance for any hints and ideas!

Anja

--~--~-~--~~~---~--~~
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 with widget in opera.

2008-04-18 Thread lekshmi


Hi,

I am using cake php helper for creating widget. It is working in IE and
MOZILLA. But not working in OPERA.
The code used is
$event = "New text";
$data = <

Re: international language / unicode issue

2008-04-18 Thread Burak USGURLU

What editor/IDE are you using? It seems like an editor problem?

I had similar problems where UTF-8 text on ctp files was not correctly 
showing up on the browser which was caused by UTF-8 text on non UTF-8 
encoded ctp files. When I changed the encoding of the file the problem 
was resolved.

crazyDavid yazmış:
> hi,
> i'm working on an application with Nepali language. I'm using UTF-8
> charset and the same in MySQL.
>
> What I'm having problem with is rather the template (.ctp) files. If i
> add any text in .ctp with a different language (Nepali Unicode to be
> exact) the file can't be saved. I tried to change the encoding, yet i
> can't save it.
>
> Can someone suggest, what i'm doing is wrong?
>
> I'm using CakePHP 1.2
>
> 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
-~--~~~~--~~--~--~---



doubts in cakephp help me plz

2008-04-18 Thread sudhakar s
hi guys, i am programmer in php, now i am learning cakephp and also am new
to the framework.
i already worked out some examples. here
I have some doubts in cakephp, kindly see below and tell me where I am going
wrong?
---

1.In Scaffolding delete option is not working with the cake PHP,When we run
the following program by

http://localhost/cake/app/vendors/

  =>it showing the details from the tables with all fields and also
view,Edit,delete links and New vendor option
  =>Except Delete link,all the links are working.
  =>When we clicked the delete link it showing the following error


Error
=


"Query: DELETE `Vendor` FROM `Vendors` AS `Vendor` WHERE `Vendor`.`id`
IN (1)

Warning (512): SQL Error: 1066: Not unique table/alias: 'vendor'
[CORE\cake\libs\model\datasources\dbo_source.php, line 440]

Code | Context

$sql="DELETE `Vendor` FROM `Vendors` AS `Vendor`   WHERE
`Vendor`.`id` IN (1) "
$error="1066: Not unique table/alias: 'vendor'"

e("Query: {$sql} ");

if ($error) {

trigger_error("SQL Error: {$this->error}",
E_USER_WARNING);




DboSource::showQuery() - CORE\cake\libs\model\datasources\dbo_source.php,
line 440
DboSource::execute() - CORE\cake\libs\model\datasources\dbo_source.php, line
166
DboSource::delete() - CORE\cake\libs\model\datasources\dbo_source.php, line
1345
Model::del() - CORE\cake\libs\model\model.php, line 1466
Scaffold::__scaffoldDelete() - CORE\cake\libs\controller\scaffold.php, line
344
Scaffold::__scaffold() - CORE\cake\libs\controller\scaffold.php, line 422
Scaffold::__construct() - CORE\cake\libs\controller\scaffold.php, line 193
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 256
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 240
[main] - APP\webroot\index.php, line 84

There was an error deleting the Vendor with id: 1"



===
Coding




vendors_controller.php(controller)
==





vendor.thtml(Views)
===



Please fill out the form below to register an account.
Username:
Passwors:
First Name:
Last Name:





vendor.php(Models)
==

 VALID_NOT_EMPTY,
'password' => VALID_NOT_EMPTY,
'f_name'   => VALID_NOT_EMPTY,
'l_name'   => VALID_NOT_EMPTY
);


}
?>

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



Routing with named params

2008-04-18 Thread MonkeyGirl

Hi.

Just a quick routing question. Again, I'm probably missing something
simple but couldn't work it out from the documentation or previous
posts...

I've got this route set up:

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

This is great as long as there are no named arguments being passed to
the homepage. If the user tries to set a language by clicking on a
link that goes to, say, /lang:francais then CakePHP thinks there
should be a controller called Langfranais.

I've changed the links to go to /index/lang:francais and added this
route:

// For selecting a language from the homepage, which has no controller
specified
Router::connect('/index.*', array(
  'controller' => 'webpages',
  'action' => 'view',
  'home'
));

This can work out which controller and action to use, but still isn't
passing any named parameters, such as lang.

As a temporary fix I can change all the links to go directly to URLs
like /webpages/view/home/lang:francais , but for that professional
look, can anyone please explain to me how to get the homepage working
with URLs like /lang:francais or at least /index/lang:francais ?

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



Re: Custom SQL call problem

2008-04-18 Thread Defranco

On 17 abr, 17:26, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> is it returning something that cake should be able to understand? try
> debugging out the data in your *sql_dbo file before it gets put into
> an array

Its a nice idea, but what is sql_dbo file? I tried to Google it but it
just pointed to this post.

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: How to view all Cake queries?

2008-04-18 Thread Corie

Thanks a bunch. That's precisely what I needed.

On Apr 18, 11:05 am, grigri <[EMAIL PROTECTED]> wrote:
> Write the sql queries to a text log file.
>
> I created a custom datasource to allow syntax hilighting of the sql
> log and file-based logging.
>
> More details in this 
> thread:http://groups.google.com/group/cake-php/browse_thread/thread/9609699b...
>
> Code here:http://openpaste.org/en/6181/
>
> Hope this helps
> grigri
>
> On Apr 18, 3:59 pm, Corie <[EMAIL PROTECTED]> wrote:
>
> > Of course I have debug set to 2, but sometimes redirects are used.
>
> > I'm specifically trying to troubleshoot an Auth problem and need to
> > see the queries generated. What can 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
-~--~~~~--~~--~--~---



Maintain subdomain in login redirect

2008-04-18 Thread John R

When a user is at http://roar.domain.com and clicks on say, upload
photo (that requires login) http://roar.domain.com/upload, it takes
them to http://www.domain.com, just like a good little app.

However, after a successful login, it takes them to http://www.domain.com/upload

Any idea how I can tell it to take them back to http://roar.domain.com/upload?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Forms CakePHP v1.1 to CakePHP v1.2 Beta

2008-04-18 Thread Andrew Assarattanakul

Something that I ran across from updating CakePHP v1.1 to CakePHP v1.2
Beta for forms is that quite a few things changed and I wanted to
continue to show all of the fields the database has as they are added
without having to modify my views or controllers.

For the View:
 - Form::generateFields was renamed to Form::inputs with some nice
additions to it.
 - Html::submit was moved to Form::submit.

For Controllers:
 - Controller::generateFieldNames was removed completely. This is no
longer "needed" as Form::inputs function will check the database and
build the variables that is required to create the form if they are
missing.

So now all you need is the list of fields that
Controller::generateFieldNames to be sent to the view like it used to
have. You can get a list of the field names by using either
Model::getColumnTypes or Model::schema to get the key values set into
an array to be sent to Form::inputs in the view.

You'll want to have the format something like this:

$fields = array(
   'id' => array(),
   'name' => array()
);

Another thing to note, is that Form::inputs will create the fieldset
and legend fields for you so you no longer have to create them
yourselves (if you did). You can set the text for the legend by having
the key value of "legend" to the list of your field names.

I hope this helps some people out. If someone has found a better way
to do this please let me know!

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



Forms CakePHP v1.1 to CakePHP v1.2 Beta

2008-04-18 Thread Andrew Assarattanakul

Something that I ran across from updating CakePHP v1.1 to CakePHP v1.2
Beta for forms is that quite a few things changed and I wanted to
continue to show all of the fields the database has as they are added
without having to modify my views or controllers.

For the View:
 - Form::generateFields was renamed to Form::inputs with some nice
additions to it.
 - Html::submit was moved to Form::submit.

For Controllers:
 - Controller::generateFieldNames was removed completely. This is no
longer "needed" as Form::inputs function will check the database and
build the variables that is required to create the form if they are
missing.

So now all you need is the list of fields that
Controller::generateFieldNames to be sent to the view like it used to
have. You can get a list of the field names by using either
Model::getColumnTypes or Model::schema to get the key values set into
an array to be sent to Form::inputs in the view.

You'll want to have the format something like this:

$fields = array(
   'id' => array(),
   'name' => array()
);

Another thing to note, is that Form::inputs will create the fieldset
and legend fields for you so you no longer have to create them
yourselves (if you did). You can set the text for the legend by having
the key value of "legend" to the list of your field names.

I hope this helps some people out. If someone has found a better way
to do this please let me know!

--~--~-~--~~~---~--~~
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: Which CakePHP version should I use?

2008-04-18 Thread Reza Muhammad



On Mar 5, 5:34 am, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> A short list of what I remember:
>
> * Pagintaion
> * Integrated Auth (Auth component)
> * Email Component
> * Model Behaviors (Models)
> * Improved plugins
> * Better SQL generated in models (Models)
> * "With" Associations (models)
> * Web services (Router)
> * Extensions (Router)
> * Sweet FormHelper
> * Improved performance
> * New cache engines
>
> List goes on and on
>
> On Wed, Mar 5, 2008 at 4:39 AM, Wisnu Manupraba <[EMAIL PROTECTED]> wrote:
> > is there anybody can review the advantages 1.2 than 1.1?
>
> > thanks,
>
> > On Wed, Mar 5, 2008 at 6:09 AM, jonknee <[EMAIL PROTECTED]> wrote:
>
> > > I'd definitely go for 1.2 using PHP 5.
>
> > > On Mar 4, 3:32 am, Reza Muhammad <[EMAIL PROTECTED]> wrote:
> > > > Hi guys,
>
> > > > I was just reading about CakePHP, and I was thinking to use CakePHP
> > > > for my web applications, as it looks fun and easy to code.  What I
> > > > would like to know is, which version should I use? I know the latest
> > > > stable version is still 1.1, yet alot of articles / tutorials I found
> > > > on bakery are for CakePHP 1.2.  I also notice that some helpers are
> > > > changed in 1.2 (for example, to create a form, 1.1 use $html helper,
> > > > but 1.2 uses $form helper).
>
> > > > If I chose to use 1.1, would updating to CakePHP 1.2 be a steep
> > > > process? (In terms maintaining existing codes that are already written
> > > > in 1.1).  Also, is it safe to use CakePHP 1.2 these days?  And this
> > > > might be annoying to ask, but I couldn't find it on CakePHP's website,
> > > > so here goes, When should we be expecting 1.2 to release?
>
> > > > Thanks for the help
>
> > --
> > inoex135
> > I'm a newbie who want to be a hacker
> >http://inoex135.wordpress.com

Thanks alot!

Pagination and auth components are definitely some are the features i
was looking for :)
--~--~-~--~~~---~--~~
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: need advice => try to develop alternative flex client

2008-04-18 Thread bingo

hi Kiang,

Thank you for those pointers.. Can you describe little more about how
you are using amfphp directly with CakePHP application. What I really
want to know is how application (or controller) decides how to package
data i.e. in html view or in AMF format

Regards,


On Apr 17, 9:10 pm, kiang <[EMAIL PROTECTED]> wrote:
> We are using amfphp directly with CakePHP application (1.2). Only
> share some settings and the database.
>
> My experiences:
>
> CakeSWXPHP works well if I disable PECL/APC 
> settings.http://blog.aboutme.be/cakeswxphp/
>
> CakeAMFPHP need some modification to work under CakePHP 1.2. But the
> project is a legacy.http://cakeforge.org/projects/cakeamfphp/
>
> CakePHP AMF Plugin seems like a best solution, but still under
> development. And I haven't figured out how to use 
> it.https://trac.cakefoundation.org/amf/
> Gwoo had pointed me to his new project which is based on this plug-in.
> But I need some time to realize it since it's a big project and no
> documents available.http://code.google.com/p/fake-as3/
>
> I promised gwoo to make a tutorial about amf plug-in. But I'm still
> trying in limited time. ^^||
>
> ---
> kiang
>
> On 4月18日, 上午5時19分, bingo <[EMAIL PROTECTED]> wrote:
>
>
>
> > hi all,
>
> > I have an existing website (http://findnwrite.com/memento) running on
> > CakePHP. Now, I am planning to develop a  Flex client, but I don't
> > want to disturb my existing website. I have gone through some of the
> > tutorials on CakePHP + AMPHP + Flex, but not really understanding on
> > how to get flex working with CakePHP without disturbing my existing
> > website.
>
> > here are my specific questions.
> > 1. Currently in router.php you can specify which extensions, such as
> > rss, xml,  should be parsed by CakePHP and rendered accordingly. Can
> > you use the same technique to pass action script object from CakePHP
> > to flex application?. if not, what's the best way to deploy flex as an
> > alternative view for your cakephp based application.
>
> > 2. In general, I am interested to know how other bakers are dealing
> > with CakePHP and flex, together.
>
> > regards,- 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
-~--~~~~--~~--~--~---



testing in cakephp 1.2-Bug- Database table user_tests for model UserTest was not found

2008-04-18 Thread bhushan A

I have followed the steps  mentioned 'http://bakery.cakephp.org/
articles/view/testing-models-with-cakephp-1-2-test-suite' LINK. I am
putting my user.test.php's code here. Please let me know what i am
missing.

UserTest =& new UserTest ();

$result = $this->UserTest ->inactive(array('id', 'name'));
$expected = array(
array('UserTest ' => array( 'id' => 1, 'name' => 'User Communities' ))

);

$this->assertEqual($result, $expected);
}
}
?>
I am getting  Database table user_tests for model UserTest was not
found error. How tables for test suites are automatically created? Do
i need to any setting in database.php or user_test_fixtures.php file?


Please reply.

--~--~-~--~~~---~--~~
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: Question about Model::save() and its beforeSave and afterSave callbacks

2008-04-18 Thread Joshua McFarren

> Have you tried deleting all the files that have accumulated in my app/
> tmp/cache directory.  Sometimes when I have had these kinds of strange
> problems it was because of an outdated cached model file.

Hi Aran,

I deleted the cache and unfortunately that didn't help. I'm pretty
sure the wrong Model:save() is being called. I need to figure why
ProjectTask::save() is not handling this. Still stumped and its
probably something very obvious.

Best,
Joshua

> sparked an idea to override ProjectTask::save() to see if that's even
> being called and its not!
>
> class ProjectTask extends AppModel {
>     var $name = 'ProjectTask';
>     function save() {
>         echo "ProjectTask::save()";
>         exit;
>     }
> }
>
> Yet the data is being stored in the DB. So it must be saving through
> Schedule::save(). ProjectTask and Schedule are associated models so I
> guess that's possible right? How can I force ProjectTask::save() to
> handle 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: testing in cakephp 1.2-Bug-Class 'Usel' Not found

2008-04-18 Thread b logica

Actually, it'll give the same error if Cake can't *access* the table.
Pretty much the swam thing, though, for all intents ...

bhushan, make sure the table user_tests exists in the database and the
user that Cake is connecting as has the proper rights to it (GRANT
SELECT,INSERT,UPDATE,DELETE).

On Fri, Apr 18, 2008 at 11:03 AM, Chris Hartjes <[EMAIL PROTECTED]> wrote:
>
>  On Fri, Apr 18, 2008 at 2:21 AM, bhushan A <[EMAIL PROTECTED]> wrote:
>  >
>  >  hey thanks amit... it worked but not its giving following error.
>  >  Error:  Database table user_tests for model SiteTest was not found.
>  >  what to do? please help
>
>  The error message is telling you *exactly* what is wrong:  you have no
>  table called 'user_tests' in the database that your model SiteTest is
>  trying to use.
>
>  I am not of the opinion that PHP and CakePHP spits out
>  hard-to-diagnose error messages.
>
>  --
>  Chris Hartjes
>  Internet Loudmouth
>  Motto for 2008: "Moving from herding elephants to handling snakes..."
>  @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: Question about Model::save() and its beforeSave and afterSave callbacks

2008-04-18 Thread aranworld

It is quite a mystery, because if you look at the Model's save()
function, it clearly should be making a call to beforeSave():

http://api.cakephp.org/1.2/libs_2model_2model_8php-source.html#l01106

Have you tried deleting all the files that have accumulated in my app/
tmp/cache directory.  Sometimes when I have had these kinds of strange
problems it was because of an outdated cached model file.

-Aran

On Apr 17, 5:32 pm, Joshua McFarren <[EMAIL PROTECTED]> wrote:
> Hi Aran,
>
> Thanks for the advice. Unfortunately I tried that and it doesn't make
> a difference. The syntax i tried is:
>
> $this->ProjectTasks->create();
> $this->ProjectTasks->save($task);
>
> In either case the save method does update the row in the DB but the
> callbacks don't happen.
>
> Any other ideas?
>
> - Joshua
>
> On Apr 17, 7:46 pm, aranworld <[EMAIL PROTECTED]> wrote:
>
> > Try putting:
>
> > $this->ProjectTasks->create();
>
> > in each loop of the foreach in Schedule::afterSave()
>
> > When you call save() multiple times on the same model, I have found
> > that I run into problems if I don't call create() in between each call
> > to save().
--~--~-~--~~~---~--~~
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 view all Cake queries?

2008-04-18 Thread grigri

Write the sql queries to a text log file.

I created a custom datasource to allow syntax hilighting of the sql
log and file-based logging.

More details in this thread: 
http://groups.google.com/group/cake-php/browse_thread/thread/9609699bbd2e1afd

Code here: http://openpaste.org/en/6181/

Hope this helps
grigri

On Apr 18, 3:59 pm, Corie <[EMAIL PROTECTED]> wrote:
> Of course I have debug set to 2, but sometimes redirects are used.
>
> I'm specifically trying to troubleshoot an Auth problem and need to
> see the queries generated. What can 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: Which CakePHP version should I use?

2008-04-18 Thread Dardo Sordi Bogado

> where can i get the manual about this?

http://book.cakephp.org

> i also get confused with the form helper such as form->create(), how to
> change the model n the destination where i'll post the form?

$form->create('Post', array('url' => array('controller' => 'cake',
'action' => 'is_great')));
$form->create('Post', array('url' => '/cake/is_great'));

> i tried to generete the api reference using javadocs, some past it was so
> helpfull but i hope i can get a better one, anyone have?
>
> thanks,
>
>
> On Fri, Mar 7, 2008 at 4:50 AM, SumanRS <[EMAIL PROTECTED]> wrote:
>
> >
> >
> > > Oh I forget about:
> > >
> > > * Improved models validation
> > > * Localization and Internationalization
> > > * New Shells
> >
> > Baking (to automatically generate models, views, controllers and
> > more)! :)
> >
> > I would vote this as the best new feature and a really powerful one.
> > It makes development on CakePHP so much easier...
> >
> >
> >
> >
> >
> >
>
>
>
> --
> inoex135
> I'm a newbie who want to be a hacker
> http://inoex135.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: Bug with findAllThreaded

2008-04-18 Thread Renan Gonçalves
Ok... I got it!

I'll make a test case for this, thanks!


on Fri, Apr 18, 2008 at 2:18 AM, Sourabh Sharma <[EMAIL PROTECTED]>
> wrote:
>
> Hello,
>
> But I use that findAllThreaded its works fine for me. But we have to
> only take care about parent id  relationship. I followed the
> instruction from manual. Or may be there is difference of versions. I
> am using betaversion of cakephp.


What kind of care? Could you explain?
The only way to sort is putting "ORDER BY parent_id ASC"!


[]'s

On Fri, Apr 18, 2008 at 3:30 AM, Adam Royle <[EMAIL PROTECTED]> wrote:

>
> It was closed because there was no reproducable test case attached to
> the ticket.
>
> On Apr 18, 12:59 pm, "Renan Gonçalves" <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I was trying the method findAllThreaded and I have found a bug!
> > I have been tested this in Cake 1.2, but problaly the bug is on 1.1 too.
> > There is a table called sections (model Section) with id, parent_id,
> > created, modified and name.
> >
> > When I try to sort this data with $sections =
> > $this->Section->findAllThreaded(null, null, 'Section.name ASC'); the
> result
> > is only one Section, but there are 5.
> > The only way to get all data is sorting by modified field.
> >
> > The problem is in:
> > /**
> >  * Private, recursive helper method for findAllThreaded.
> >  *
> >  * @param array $data Results of find operation
> >  * @param string $root NULL or id for root node of operation
> >  * @param integer $index last processed index of $data
> >  * @return array Threaded results
> >  * @access private
> >  * @see Model::findAllThreaded()
> >  */
> > The way to fix it is dont keeping the last processed index, but the
> > processeds indexes... I guess.
> >
> > There is a ticket invalidated by phpnut. Why?
> https://trac.cakephp.org/ticket/3924
> >
> > I opened the ticket with new information.
> >
> > --
> > Renan Gonçalves - Software Engineer
> > Cell Phone: +55 11 8633 6018
> > MSN: [EMAIL PROTECTED]
> > São Paulo - SP/Brazil
> >
>


-- 
Renan Gonçalves - Software Engineer
Cell Phone: +55 11 8633 6018
MSN: [EMAIL PROTECTED]
São Paulo - SP/Brazil

--~--~-~--~~~---~--~~
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: testing in cakephp 1.2-Bug-Class 'Usel' Not found

2008-04-18 Thread Chris Hartjes

On Fri, Apr 18, 2008 at 2:21 AM, bhushan A <[EMAIL PROTECTED]> wrote:
>
>  hey thanks amit... it worked but not its giving following error.
>  Error:  Database table user_tests for model SiteTest was not found.
>  what to do? please help

The error message is telling you *exactly* what is wrong:  you have no
table called 'user_tests' in the database that your model SiteTest is
trying to use.

I am not of the opinion that PHP and CakePHP spits out
hard-to-diagnose error messages.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@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
-~--~~~~--~~--~--~---



How to view all Cake queries?

2008-04-18 Thread Corie

Of course I have debug set to 2, but sometimes redirects are used.

I'm specifically trying to troubleshoot an Auth problem and need to
see the queries generated. What can 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: testing in cakephp 1.2-Bug-Class 'Usel' Not found

2008-04-18 Thread bhushan A

hey thanks amit... it worked but not its giving following error.
Error:  Database table user_tests for model SiteTest was not found.
what to do? please help


On Apr 18, 10:45 am, "Amit Badkas" <[EMAIL PROTECTED]> wrote:
> On Fri, Apr 18, 2008 at 10:54 AM, bhushan A <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > I have followed the steps given in  "http://bakery.cakephp.org/
> > articles/view/testing-models-with-cakephp-1-2-test-suite"
> > link. But
> > still I am gettng 'Fatal error: Class 'User' not found in /tests/cases/
> > models/user.test.php' I am putting my user.test.php's code here.
> > Please let me know what i am missing.
>
> >  > App::import('User','User');
>
> - You need to do App::import('Model', 'User'); here
>
> --
> Regards,
> Amit
>
> http://amitrb.wordpress.com/http://coppermine-gallery.net/http://cheesecake-photoblog.org/http://www.sanisoft.com/blog/author/amitbadkas
--~--~-~--~~~---~--~~
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: Question about Model::save() and its beforeSave and afterSave callbacks

2008-04-18 Thread Fred Hirsch

What I would do to verify this behavior is to debug the model itself 
(Cake library). Just copy the original to a second file for safe keeping 
and start digging. I would step debug statements through the save() 
method and see if I could determine whether the beforeSave is called. 
Looking at the code itself, I would say that beforeSave is always called 
and it only procedes with the full save if the method returns a value.

If you find that something odd is happening here, then search the Trac 
for beforeSave bugs and see if you find any. There may be workarounds or 
bugfixes already posted that relate to your issues.

Some other things that I thought of:
1) Did you override save() in your model or app_model?
2) Did you debug the beforeSave in the calling model to see if its 
somehow retriggering?
3) Do you have a beforeSave in your app_model? Is it triggering?

Good luck,
Fred

Joshua McFarren wrote:
> Hi Aran,
>
> Thanks for the advice. Unfortunately I tried that and it doesn't make
> a difference. The syntax i tried is:
>
> $this->ProjectTasks->create();
> $this->ProjectTasks->save($task);
>
> In either case the save method does update the row in the DB but the
> callbacks don't happen.
>
> Any other ideas?
>
> - Joshua
>
> On Apr 17, 7:46 pm, aranworld <[EMAIL PROTECTED]> wrote:
>   
>> Try putting:
>>
>> $this->ProjectTasks->create();
>>
>> in each loop of the foreach in Schedule::afterSave()
>>
>> When you call save() multiple times on the same model, I have found
>> that I run into problems if I don't call create() in between each call
>> to save().
>> 
>
> >
>
>   


--~--~-~--~~~---~--~~
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 test fake-as3 ?

2008-04-18 Thread kiang

The steps I did:
1. Check out source from http://fake-as3.googlecode.com/svn/branches/
2. Add the following line to pretend/app/config/bootstrap.php

App::import('Vendor', 'Amf.AmfDispatcher');

3. Make the cakephp application 'pretend' works ( I'm sure it worked )
4. Modify the settings in pretend/src/com/app/Environment.as
5. Compile the flex source through Adobe Flex® Builder™ for Linux
alpha 3
6. Then the error message:
[SWF] /~kiang/pretend/bin-debug/pretend.swf - 1,200,975 bytes after
decompression
Error #2044: Unhandled NetStatusEvent:. level=error,
code=NetConnection.Call.BadVersion
at com.fake.model.datasources::AmfDataSource()[/home/kiang/
public_html/pretend/src/com/fake/model/datasources/AmfDataSource.as:
46] ...

7. Another kind error message:

Error #1009: Cannot access a property or method of a null object
reference.
at com.fake.model::Model/call()[/home/kiang/public_html/pretend/src/
com/fake/model/Model.as:104] ...

---
kiang
--~--~-~--~~~---~--~~
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: "redirect" and "Cannot modify header information"

2008-04-18 Thread [EMAIL PROTECTED]

Hi,
Thank you for your help : I found the error.
It was a presence of "space" was after the "?>"
That sends a char and create an error 




On Apr 15, 7:08 pm, "Gonzalo Servat" <[EMAIL PROTECTED]> wrote:
> On Tue, Apr 15, 2008 at 12:59 PM, [EMAIL PROTECTED] <
>
>
>
> [EMAIL PROTECTED]> wrote:
>
> > [snip]
>
> > 2)  The execution of this code on Unix server with "PHP version 5.2.5,
> > System HP-UX frl4 B.11.11 U 9000/800 " generate the following error:
>
> > Warning (2): Cannot modify header information - headers already sent
> > by (output started at /opt/hpws/apache/htdocs/cake/app/
> > app_controller.php:75) [CORE/cake/libs/controller/controller.php, line
> > 546]
>
> > header - [internal], line ??
> > Controller::redirect() - CORE/cake/libs/controller/controller.php,
> > line 546
> > PlansController::add() - APP/controllers/plans_controller.php, line
> > 165
> > Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 268
> > Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 240
> > [main] - APP/webroot/index.php, line 84
>
> > I do not really manage to understand why I have this error; somebody
> > can help me on this subject?
>
> Hi,
>
> I had a similar issue to this recently. I had pasted some code from a page
> into a app/models/ file and it kept sending a blank character/line which
> meant headers were already sent out (you can verify this by using something
> like curl to look at the HTTP headers; you'll find you'll receive a 200 OK
> instead of a "moved" status message like 301). Try backing up your
> app_controller.php and starting with a fresh new one. Start to copy code
> back until it breaks the redirect. Just an idea.
>
> - Gonzalo
--~--~-~--~~~---~--~~
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   >