Re: How much to charge?

2011-02-17 Thread alaxos
I definitely like 'hold your breath while you give the number to your
client' and 'instruct a lawyer now because clients like to hold out on
payment' ! :-)

On Feb 16, 11:57 pm, Jeremy Burns | Class Outfit
 wrote:
> The only way to price something is to:
> - get the proper requirements
> - make sure they are what the customer wants
> - write them up and get the client to sign it off
> - work out how long it will take you to do it
> - double it (because you always underestimate)
> - make sure the customer agrees that the time and price will rise if they 
> make changes
> - decide how much each of your hours is worth
> - multiply the hours by the hourly rate
> - hold your breath while you give the number to your client
> - get half the money up front
> - get a proper contract between you signed
> - instruct a lawyer now because clients like to hold out on payment
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 16 Feb 2011, at 22:47, euromark wrote:
>
> > its a suggestive question like "what car should i bye"
> > plus its not even remotely cake related
>
> > so nobody in this group will probably be able to help you with this...
>
> > On 16 Feb., 23:17, hydra12  wrote:
> >> I've been offered a one-time job to develop a database driven form for
> >> someone's website.  I don't have any idea what to charge.  I've done
> >> some of this before, but always when I was on salary.  Anybody want to
> >> give me some advice?
>
> >> Thanks in advance!
>
> >> hydra12
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: redirecting page if if two submit buttons are given.

2011-02-17 Thread Jeremy Burns | Class Outfit
Give the button a name (let's use 'process'  as an example):

echo $this->Form->submit(
'Order',
array('name' => 'process')
);


echo $this->Form->submit(
'Submit',
array('name' => 'process')
);

...and then check for it:

if ($this->data && isset($this->params['form']['process'])):

$response = strtolower($this->params['form']['process']);
if ($process == 'order'):
//do something
else:
//do something else
endif;



Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 18 Feb 2011, at 07:26, andy_the ultimate baker wrote:

> hi,
> i m working on one form.
> 
> in that form i have two submit button. one is for SUBMIT and another
> is ORDER.
> 
> i want to redirect my form to ORDER view if user clicks on ORDER. but
> i m not getting how.
> 
> my code is in simple HTML not in Cake HTML
> 
> is as fallows
> 
> tr>
>   name="Submit22" value="Submit" id="submit"/>   td>
>   
>   name="Submit" value="Chemo Order" onclik id="chemoorder"/>
>
> 
> plase help
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


redirecting page if if two submit buttons are given.

2011-02-17 Thread andy_the ultimate baker
hi,
i m working on one form.

in that form i have two submit button. one is for SUBMIT and another
is ORDER.

i want to redirect my form to ORDER view if user clicks on ORDER. but
i m not getting how.

my code is in simple HTML not in Cake HTML

is as fallows

tr>

   
  


plase help

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem with cake 1.2 or not ?

2011-02-17 Thread Ryan Schmidt
On Feb 17, 2011, at 21:41, Alejandro Gómez Fernández wrote:

> In case you want to upgrade cake "to the most recent version" I think
> you must see cake 2.0. It's a development version, but more or less,
> when you finish your migration it will be a production version. To
> change to an 1.3.x has no sense to me.

Upgrading a production site to the development version of CakePHP that will 
become 2.0 makes no sense. The final version 2.0 is not released yet, and the 
developers have provided no guidance on when it will be completed. It might be 
tomorrow, it might be next year. In the mean time, you might run into issues, 
the response to which will generally be "it's a development version, it's 
expected to have unresolved problems, go use the stable version".

There is a published guide explaining how to upgrade a 1.2 site to 1.3. When 
2.0 is released, I would expect there to be a guide explaining how to upgrade a 
site from 1.3 to 2.0. I would not, however, expect there to be a guide on how 
to upgrade from 1.2 directly to 2.0; users would be expected to have already 
upgraded to 1.3. Therefore it makes a great amount of sense to upgrade your 1.2 
site to 1.3 now, verify that you've followed the existing upgrade guide 
properly and that everything works, and publish your site with 1.3, and then, 
whenever 2.0 does come out, you can tackle that upgrade then.


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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem with cake 1.2 or not ?

2011-02-17 Thread Alejandro Gómez Fernández
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



Cake 1.2 works fine with php 5.3.
Several hosting providers lets you configure what version of php you
want to use (for example, one of mine, let my choose between php 4, 5.0
or 5.3)

Remember you always can change your hosting provider, so you can choose
one that supports you desired php version.

In case you want to upgrade cake "to the most recent version" I think
you must see cake 2.0. It's a development version, but more or less,
when you finish your migration it will be a production version. To
change to an 1.3.x has no sense to me.



Alejandro.




El 17/02/2011 22:10, Miloš Vučinić escribió:
> Thank you guys , you have really helped !!!
> ...
> So this web site now works fine with cake 1.2 , I may have to update a
> thing or two but in general it is OK. Would you suggest an upgrade to
> the most recent version, or do you think it is not necessary. My fear
> is that at some point, PHP hosting can be changed to higher version
> and that out of a blue the website will not work.
> Is my fear justified or am I just talking nonsense ?
> ...
> Milos
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNXep9AAoJEHQn9CmeN9DJ71EH/3bBaOnSCSJuy1kP7JRZPWgi
OKj+UF6nIRBVZXPOmuuWdTH/ST6/jlm4zI13C559P9JsRMqVEaXuRD09/2QJsSAB
HBickzyb5+HLURQqH4PtbzY855toWyX4uMa9rmCiKz2yJG4mmAbkC/MfC+ppmZ5o
iZxDVtfsLcyBs8ZpL8QgzbB6sXns3ZXGPaTBMU6NCOQT3NBcnU8vM9MQffLixY7n
0JAyPEanrIRGLlhJQnlS0RvnZCHY8YSP4mLXtdWKkD5kMSW2EcDrjGTbwkWXV/JV
K1GDJ0NnauNcJNoOA4IswHs6ilykUVuj1p1GRwFlo66o1b4TKk0Z/eq/c7o90Us=
=lvoc
-END PGP SIGNATURE-

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: cakephp website not working

2011-02-17 Thread cricket
On Thu, Feb 17, 2011 at 2:54 PM, barricades  wrote:
> Hi there, since the new design for the website came online the
> cookbook doesn't seem to be operating properly. It used to be that the
> menu on the right would open up so you could browse through the sub-
> sections, but for me using both FF and IE it only says:
> 1.3 collection
> 1.2 collection
> 1.1 collection
>
> I've tried clicking the >> link at the bottom of each page to see if
> when you go deeper it opens, but it doesn't for me.

It's the "local caching" feature. It seems to be buggy. Click on the
"clear local cache" link at top-right.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem with cake 1.2 or not ?

2011-02-17 Thread Ryan Schmidt
I would always suggest upgrading to the newest stable version. The developers 
might only release new features or bugfixes in the newest versions; you would 
probably want to have those.


On Feb 17, 2011, at 19:10, Miloš Vučinić wrote:

> So this web site now works fine with cake 1.2 , I may have to update a
> thing or two but in general it is OK. Would you suggest an upgrade to
> the most recent version, or do you think it is not necessary.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem with cake 1.2 or not ?

2011-02-17 Thread Miloš Vučinić
Thank you guys , you have really helped !!!

I apologize for not answering sooner because I was busy fixing this
issue and now is OK.


You confirmed what i suspected and that is that this hosting was not
good enough. It had mysql timeout for just 10 sec's and basically when
web site needed to make cache to all 35 tables it always got an
error.

This was not cakephp error. On godaddy's most cheap hosting it works
OK , as well as on one other dedicated server which host around 50
websites from my friend who gave me a test account to see if it works
out.

I hope this thread will also help somebody else having same issue.

I would like to ask now for an opinion because I am not so experienced
in cakephp programming.

So this web site now works fine with cake 1.2 , I may have to update a
thing or two but in general it is OK. Would you suggest an upgrade to
the most recent version, or do you think it is not necessary. My fear
is that at some point, PHP hosting can be changed to higher version
and that out of a blue the website will not work.
Is my fear justified or am I just talking nonsense ?

Thank you kindly for your help !

All the best
Milos

On Feb 17, 1:40 pm, cricket  wrote:
> On Wed, Feb 16, 2011 at 1:03 PM, Miloš Vučinić  wrote:
>
> > Now, from time to time i get the warining: Warning (512): SQL Error:
> > 2006: MySQL server has gone away [CORE/cake/libs/model/datasources/
> > dbo_source.php, line 525]
>
> This is not a Cake issue. It may appear to be because it mentions
> dbo_source.php but that's simply passing on the message as  reported
> by MySQL.
>
> Use google to search "Error: 2006: MySQL server has gone away". You
> should contact your hosting company about it.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: how to automatically have the logged in users id in a form

2011-02-17 Thread barricades
thanks guys, that was taking ages to figure out. I was on completely
the wrong track.

thanks for the quick replies




On Feb 18, 12:12 am, thatsgreat2345  wrote:
> or rather $this->Auth->user('id');
>
> On Feb 17, 4:07 pm, labianchin  wrote:
>
>
>
>
>
>
>
> > Hi.
>
> > In the controller action method you can use something like:
> > $this->data['ModelName']['user_id'] = $this->Session-
>
> > >read('Auth.User.id');
>
> > On 18 fev, 00:57, barricades  wrote:
>
> > > Hi there, I've searched through a bunch of tutorials but no-one seems
> > > to explain this particular situation. I have a model for users and a
> > > model for what I call campaigns, which a logged in user is allowed to
> > > create. So I've got Auth up and running and the relationship set up so
> > > a campaign belongs to a user.
>
> > > So the user logs in and is directed to the create campaign action. In
> > > the form that the user fills in, I want the users_id to be the id of
> > > the currently logged in user by default.
>
> > > echo $this->Form->input('user_id');
>
> > > I know this is probably dead simple, but all the tutorials I've been
> > > through don't tell me. The blog tutorial(s) there is only one possible
> > > user; in the TOR tutorial its a drop down list to select which dealer
> > > etc... etc...

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


RE: how to automatically have the logged in users id in a form

2011-02-17 Thread Krissy Masters
Well first off I would never expose a user_id in a form. (anywhere) My users
do not ever know their id never exposed on the site anywhere. No need for
them to know really.
If they are logged in then you have it in the Session data so you can simply
drop that in behind the scene in the controller

$this->data['ModelName']['user_id'] = $this->Auth-User->('id'); //add this
before you save data

Since you have the user_id you can then find() whatever info you might need
to add to the record, state_id, country_id so on.


$this->Model->save($this->data);


K


-Original Message-
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of barricades
Sent: Thursday, February 17, 2011 8:27 PM
To: CakePHP
Subject: how to automatically have the logged in users id in a form

Hi there, I've searched through a bunch of tutorials but no-one seems
to explain this particular situation. I have a model for users and a
model for what I call campaigns, which a logged in user is allowed to
create. So I've got Auth up and running and the relationship set up so
a campaign belongs to a user.

So the user logs in and is directed to the create campaign action. In
the form that the user fills in, I want the users_id to be the id of
the currently logged in user by default.

echo $this->Form->input('user_id');

I know this is probably dead simple, but all the tutorials I've been
through don't tell me. The blog tutorial(s) there is only one possible
user; in the TOR tutorial its a drop down list to select which dealer
etc... etc...

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: how to automatically have the logged in users id in a form

2011-02-17 Thread thatsgreat2345
or rather $this->Auth->user('id');

On Feb 17, 4:07 pm, labianchin  wrote:
> Hi.
>
> In the controller action method you can use something like:
> $this->data['ModelName']['user_id'] = $this->Session-
>
> >read('Auth.User.id');
>
> On 18 fev, 00:57, barricades  wrote:
>
> > Hi there, I've searched through a bunch of tutorials but no-one seems
> > to explain this particular situation. I have a model for users and a
> > model for what I call campaigns, which a logged in user is allowed to
> > create. So I've got Auth up and running and the relationship set up so
> > a campaign belongs to a user.
>
> > So the user logs in and is directed to the create campaign action. In
> > the form that the user fills in, I want the users_id to be the id of
> > the currently logged in user by default.
>
> > echo $this->Form->input('user_id');
>
> > I know this is probably dead simple, but all the tutorials I've been
> > through don't tell me. The blog tutorial(s) there is only one possible
> > user; in the TOR tutorial its a drop down list to select which dealer
> > etc... etc...

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: how to automatically have the logged in users id in a form

2011-02-17 Thread labianchin
Hi.

In the controller action method you can use something like:
$this->data['ModelName']['user_id'] = $this->Session-
>read('Auth.User.id');


On 18 fev, 00:57, barricades  wrote:
> Hi there, I've searched through a bunch of tutorials but no-one seems
> to explain this particular situation. I have a model for users and a
> model for what I call campaigns, which a logged in user is allowed to
> create. So I've got Auth up and running and the relationship set up so
> a campaign belongs to a user.
>
> So the user logs in and is directed to the create campaign action. In
> the form that the user fills in, I want the users_id to be the id of
> the currently logged in user by default.
>
> echo $this->Form->input('user_id');
>
> I know this is probably dead simple, but all the tutorials I've been
> through don't tell me. The blog tutorial(s) there is only one possible
> user; in the TOR tutorial its a drop down list to select which dealer
> etc... etc...

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


how to automatically have the logged in users id in a form

2011-02-17 Thread barricades
Hi there, I've searched through a bunch of tutorials but no-one seems
to explain this particular situation. I have a model for users and a
model for what I call campaigns, which a logged in user is allowed to
create. So I've got Auth up and running and the relationship set up so
a campaign belongs to a user.

So the user logs in and is directed to the create campaign action. In
the form that the user fills in, I want the users_id to be the id of
the currently logged in user by default.

echo $this->Form->input('user_id');

I know this is probably dead simple, but all the tutorials I've been
through don't tell me. The blog tutorial(s) there is only one possible
user; in the TOR tutorial its a drop down list to select which dealer
etc... etc...

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Shell/CronJob - How to set locale for gettext() and i18n?

2011-02-17 Thread Ryan Schmidt
Right, you:

Configure::write('Config.language', 'whatever');

Your current code uses the session in some way when deciding what language to 
write? Fine for when your code is running as a web site where there is a 
session, but for cases when you're running without a session, like in a shell 
script, you'll want to have a different method for selecting what language to 
write into the config.

On Feb 17, 2011, at 15:21, John Andersen wrote:

> Use the Configure statement as specified in the CakePHP book at:
> http://book.cakephp.org/#!/view/1230/Localization-in-CakePHP
> 
> Enjoy,
>   John
> 
> On Feb 17, 6:44 pm, DigitalDude  wrote:
>> Hey,
>> 
>> I ran into a problem the other day, and I don't know what to do right
>> now.
>> 
>> I have a shell which is run as a cronjob, and this shell/cronjob sends
>> weekly status reports about a users work-environment. In these emails,
>> there is text as gettext and sometimes even i18n models with specific
>> language-depending content.
>> 
>> My problem is: How can I set a Session Language or a locale for the
>> content? In a shell I don't have a Session and I've never seen
>> anything like this before. So does anyone have a clue what's best
>> practice for this kind of stuff?




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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Created and Modified Dates don't auto populate on HABTM

2011-02-17 Thread euromark
yep
you will need to develop your own HABTM behavior that will take care
of that
because john is right, in the default HABTM table, only the primary
keys of the two joined tables are allowed
something I regretted as well in the past
but you can easily work around it - manually :)


On 17 Feb., 22:10, John Andersen  wrote:
> I do think that you need to take a look at The Join Model in the
> CakePHP book 
> at:http://book.cakephp.org/#!/view/1650/hasMany-through-The-Join-Model
>
> as what you want is to have additional data in your intersection table
> and CakePHP normal usage does not allow that.
> Whether or not it will be able to automatically populate the created
> and modified columns is not something I am sure about though!
> Enjoy,
>    John
>
> On Feb 17, 5:19 pm, rgreenphotodesign 
> wrote:
>
>
>
>
>
>
>
> > Just for good measure here are my relationships in the models:
>
> > Activity:
>
> >         var $hasAndBelongsToMany = array(
> >                 'Statustype' => array(
> >                         'className' => 'Statustype',
> >                         'joinTable' => 'activity_statuses',
> >                         'foreignKey' => 'activities_id',
> >                         'associationForeignKey' => 'statustypes_id',
> >                         'unique' => false,
> >                         'conditions' => '',
> >                         'fields' => '',
> >                         'order' => '',
> >                         'limit' => '',
> >                         'offset' => '',
> >                         'finderQuery' => '',
> >                         'deleteQuery' => '',
> >                         'insertQuery' => ''
> >                 ),
> >         );
>
> > ActivityStatus:
>
> >         var $belongsTo = array(
> >                 'Statustype' => array(
> >                         'className' => 'Statustype',
> >                         'foreignKey' => 'statustypes_id',
> >                         'conditions' => '',
> >                         'fields' => '',
> >                         'order' => ''
> >                 ),
> >                 'Activity' => array(
> >                         'className' => 'Activity',
> >                         'foreignKey' => 'activities_id',
> >                         'conditions' => '',
> >                         'fields' => '',
> >                         'order' => ''
> >                 ),
> >         );
>
> > I don't define any relationships in the Statustype model.
>
> [snip]

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Shell/CronJob - How to set locale for gettext() and i18n?

2011-02-17 Thread John Andersen
Use the Configure statement as specified in the CakePHP book at:
http://book.cakephp.org/#!/view/1230/Localization-in-CakePHP

Enjoy,
   John

On Feb 17, 6:44 pm, DigitalDude  wrote:
> Hey,
>
> I ran into a problem the other day, and I don't know what to do right
> now.
>
> I have a shell which is run as a cronjob, and this shell/cronjob sends
> weekly status reports about a users work-environment. In these emails,
> there is text as gettext and sometimes even i18n models with specific
> language-depending content.
>
> My problem is: How can I set a Session Language or a locale for the
> content? In a shell I don't have a Session and I've never seen
> anything like this before. So does anyone have a clue what's best
> practice for this kind of stuff?
>
> Regards,
>
> DD

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: cakephp website not working

2011-02-17 Thread John Andersen
Just click on the cookbook link above that you want to use or use the
"book.cakephp.org" address always!
Enjoy,
   John

On Feb 17, 8:54 pm, barricades  wrote:
> Hi there, since the new design for the website came online the
> cookbook doesn't seem to be operating properly. It used to be that the
> menu on the right would open up so you could browse through the sub-
> sections, but for me using both FF and IE it only says:
> 1.3 collection
> 1.2 collection
> 1.1 collection
>
> I've tried clicking the >> link at the bottom of each page to see if
> when you go deeper it opens, but it doesn't for me.
>
> http://book.cakephp.org/view/1/The-Cookbook

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Created and Modified Dates don't auto populate on HABTM

2011-02-17 Thread John Andersen
I do think that you need to take a look at The Join Model in the
CakePHP book at:
http://book.cakephp.org/#!/view/1650/hasMany-through-The-Join-Model

as what you want is to have additional data in your intersection table
and CakePHP normal usage does not allow that.
Whether or not it will be able to automatically populate the created
and modified columns is not something I am sure about though!
Enjoy,
   John

On Feb 17, 5:19 pm, rgreenphotodesign 
wrote:
> Just for good measure here are my relationships in the models:
>
> Activity:
>
>         var $hasAndBelongsToMany = array(
>                 'Statustype' => array(
>                         'className' => 'Statustype',
>                         'joinTable' => 'activity_statuses',
>                         'foreignKey' => 'activities_id',
>                         'associationForeignKey' => 'statustypes_id',
>                         'unique' => false,
>                         'conditions' => '',
>                         'fields' => '',
>                         'order' => '',
>                         'limit' => '',
>                         'offset' => '',
>                         'finderQuery' => '',
>                         'deleteQuery' => '',
>                         'insertQuery' => ''
>                 ),
>         );
>
> ActivityStatus:
>
>         var $belongsTo = array(
>                 'Statustype' => array(
>                         'className' => 'Statustype',
>                         'foreignKey' => 'statustypes_id',
>                         'conditions' => '',
>                         'fields' => '',
>                         'order' => ''
>                 ),
>                 'Activity' => array(
>                         'className' => 'Activity',
>                         'foreignKey' => 'activities_id',
>                         'conditions' => '',
>                         'fields' => '',
>                         'order' => ''
>                 ),
>         );
>
> I don't define any relationships in the Statustype model.
>
[snip]

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Postgresql Datestyle

2011-02-17 Thread labianchin
Hummm, right.
Thanks.

On Feb 17, 7:53 pm, cricket  wrote:
> On Thu, Feb 17, 2011 at 12:06 PM, labianchin  wrote:
> > Hello, folks.
>
> > I was doing the formating for date fields in afterFind and
> > beforeValidate callback, then I've found a way to do that inside of
> > postgresql.
> > It's just doing something like that: SET datestyle to 'ISO',
> > 'European';
>
> > The problem is that this statement would be executed once the database
> > connection is establish, in other words I think it would be in the
> > connect method of the datasource.
>
> > I have tried to search a tip to do that without reimplementing (or
> > extending) the DboPostgres, but no success.
>
> > Do you have any ideas of how or where I can execute this statement?
>
> Do you have access to the postgresql.conf? It can be set there.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


cakephp website not working

2011-02-17 Thread barricades
Hi there, since the new design for the website came online the
cookbook doesn't seem to be operating properly. It used to be that the
menu on the right would open up so you could browse through the sub-
sections, but for me using both FF and IE it only says:
1.3 collection
1.2 collection
1.1 collection

I've tried clicking the >> link at the bottom of each page to see if
when you go deeper it opens, but it doesn't for me.

http://book.cakephp.org/view/1/The-Cookbook

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


RE: AuthComponent action manipulation.

2011-02-17 Thread Krissy Masters
Try:

Form->create('School',
array('action' => 'login'));?>

Create -> School not school

And you do not need the controller => 'school'

K

-Original Message-
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Christophe
Sent: Thursday, February 17, 2011 9:22 AM
To: CakePHP
Subject: AuthComponent action manipulation.

Hi there

I'm working on an app where schools should able to login.
I just read the cookbook and used the api to understand the component
but i'm missing a link I believe.

My controller 'school_controller' has an action 'login'.
And I've set the userModel and fields.
$this->Auth->userModel = 'School';
$this->Auth->fields = array(
'username' => 'email1',
'password' => 'schoolcode'
);

My form looks like this:
Form->create('school',
array('controller'=>'school','action' => 'login'));?>
School inlog
input('email');
echo $form->input('pass');
?>
end('Submit');?>

But when I look at my SC I see Cake created a form with an action
action="/code/index.php/school/schools/login"
The problem is that "schools" doesnt exists and I have no clue why
Cake adds it. Is there someone that can explain this or give a
refference to an article about this?

Thanks
Christophe

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Character Set problems in Chrome ?

2011-02-17 Thread Santiago Basulto
"Ubuntu is an OS" Thanks, i know. I wanted to say "firefox but not in
CHROME". It's not a bug. It seems to be a configuration issue.

Thanks.

On Feb 17, 4:05 pm, cricket  wrote:
> On Thu, Feb 17, 2011 at 2:02 PM, Santiago Basulto
>
>  wrote:
> > Hello people.
>
> > Today I almost blow my head off. I spent all moring trying to resolve
> > a Character Set issue within my application. First, i change the MySQL
> > database default character set, after that i add the "enconding"
> > property to my database config. After several hours, something seemed
> > to be wrong, and couldn't fix the problem.  Some time later, i decided
> > to try it on other browser. That was the problem It works right in
> > firefox but not in Ubuntu. The same app, opened in different web
> > browsers behaves different. Do you know what might be?
>
> Ubuntu is an OS, not a browser. In any case, a quick google search
> suggests that Chrome has a bug.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Same code in controller, model and view

2011-02-17 Thread gremlin
I already answered this guy on StackOverflow telling him exactly this.
He didn't listen then and I doubt he will now...


On Feb 16, 8:16 pm, "Dr. Tarique Sani"  wrote:
> Just for day names and format you need helpers/behavior and components?
>
> Pray why?
>
> How you display a date is purely a View problem, rest of your code
> (controllers and models) should have to just deal with date values
> which are recognized by PHP and your database.
>
> Cheers
> Tarique
>
> On Wed, Feb 16, 2011 at 10:18 PM, Matthias
>
>
>
>  wrote:
> > I built my own helper for converting dates, because I need to deal
> > with german day names, and now I need the same helper in controllers,
> > models and views. I like the concept of helpers, components etc, but
> > how do I organize this "helper" so I don't need to repeat myself by
> > creating a DateFormatHelper, a DateFormatComponent and a
> > DateFormatBehaviour?
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php
>
> --
> =
> PHP for E-Biz:http://sanisoft.com
> =

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Character Set problems in Chrome ?

2011-02-17 Thread Santiago Basulto
Hey, i found the problem. It was a Chrome issue after all.

This worked out: 
http://www.google.com/support/chrome/bin/answer.py?hl=en&answer=95290

Thanks anyway.

On Feb 17, 4:02 pm, Santiago Basulto 
wrote:
> Hello people.
>
> Today I almost blow my head off. I spent all moring trying to resolve
> a Character Set issue within my application. First, i change the MySQL
> database default character set, after that i add the "enconding"
> property to my database config. After several hours, something seemed
> to be wrong, and couldn't fix the problem.  Some time later, i decided
> to try it on other browser. That was the problem It works right in
> firefox but not in Ubuntu. The same app, opened in different web
> browsers behaves different. Do you know what might be?
>
> I'll give you more data.
>
> It's an App for Argentina, then the language must support special
> characters (á, ñ, etc)
> The database (mysql) is set to latin1 (that character set is default,
> and has all those characters, UTF8 in mysql is a weird 3-bits
> representation)
> The App.encoding is set to UTF-8. Configure::write('App.encoding', 'UTF-8');
> Here is the html output:
> ---
> 
>         
>          CakePHP: the rapid development php
> framework:              Postulantes     
> ...
> ---
>
> Well. That same location, same HTML, is displayed right in Firefox and
> Wrong in Chrome.
>
> Is it Chrome? Is it my app?
>
> Help!
>
> Thanks!
>
> --
> Santiago Basulto.-

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Character Set problems in Chrome ?

2011-02-17 Thread cricket
On Thu, Feb 17, 2011 at 2:02 PM, Santiago Basulto
 wrote:
> Hello people.
>
> Today I almost blow my head off. I spent all moring trying to resolve
> a Character Set issue within my application. First, i change the MySQL
> database default character set, after that i add the "enconding"
> property to my database config. After several hours, something seemed
> to be wrong, and couldn't fix the problem.  Some time later, i decided
> to try it on other browser. That was the problem It works right in
> firefox but not in Ubuntu. The same app, opened in different web
> browsers behaves different. Do you know what might be?

Ubuntu is an OS, not a browser. In any case, a quick google search
suggests that Chrome has a bug.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cakephp 1.3 Form Helper inputDefaults bug?

2011-02-17 Thread designv...@gmail.com
In case anyone finds this:

Here's how to change the error message container:

http://book.cakephp.org/view/1401/options-error

And an example:

Form->create('Artist', array('inputDefaults'
=>array('div' => array('tag' => 'p'),'between' => '','error' =>
array('wrap' => 'span', 'class' => 'bzzz'),'format' =>array('before',
'label', 'error', 'between', 'input', 'after'; ?>


On Feb 17, 4:42 pm, "designv...@gmail.com" 
wrote:
> So that seems to be the issue lord alone knows why
>
> Does anyone know how to change the div to a span for the validation
> errors? ;-)
>
> d//t
>
> On Feb 17, 4:32 pm, "designv...@gmail.com" 
> wrote:
>
> > Ahh wierd... i was viewing the HTML in Firebug and it was messed up,
> > actually view source in Firefox and its correct...
>
> > Hmmm...
>
> > (and I know I shouldn't be putting divs inside p tags! hehe)
>
> > On Feb 17, 4:27 pm, Jeremy Burns | Class Outfit
>
> >  wrote:
> > > Could it be browser behaviour because p is a block level element?
>
> > > Jeremy Burns
> > > Class Outfit
>
> > > jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> > > On 17 Feb 2011, at 16:20, designv...@gmail.com wrote:
>
> > > > Hi there,
>
> > > > When using the 'inputDefaults' option in Form->create and doing the
> > > > following:
>
> > > > Form->create('Enquiry', array('inputDefaults' =>
> > > > array('div' => array('tag' => 'p'),'between' => '','format' =>
> > > > array('before', 'label', 'error', 'between', 'input', 'after'; ?>
>
> > > > Cake seems to close the  tag imediately after the label, however if
> > > > I remove this it defaults using a div that surrounds everything.
>
> > > > I would have thought that specifying using a P tag instead would still
> > > > act the same...
>
> > > > Anyone noticed this?
>
> > > > d//t
>
> > > > --
> > > > Our newest site for the community: CakePHP Video 
> > > > Tutorialshttp://tv.cakephp.org
> > > > Check out the new CakePHP Questions 
> > > > sitehttp://ask.cakephp.organdhelpothers with their CakePHP related 
> > > > questions.
>
> > > > To unsubscribe from this group, send email to
> > > > cake-php+unsubscr...@googlegroups.com For more options, visit this 
> > > > group athttp://groups.google.com/group/cake-php

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Character Set problems in Chrome ?

2011-02-17 Thread Santiago Basulto
Hello people.

Today I almost blow my head off. I spent all moring trying to resolve
a Character Set issue within my application. First, i change the MySQL
database default character set, after that i add the "enconding"
property to my database config. After several hours, something seemed
to be wrong, and couldn't fix the problem.  Some time later, i decided
to try it on other browser. That was the problem It works right in
firefox but not in Ubuntu. The same app, opened in different web
browsers behaves different. Do you know what might be?

I'll give you more data.

It's an App for Argentina, then the language must support special
characters (á, ñ, etc)
The database (mysql) is set to latin1 (that character set is default,
and has all those characters, UTF8 in mysql is a weird 3-bits
representation)
The App.encoding is set to UTF-8. Configure::write('App.encoding', 'UTF-8');
Here is the html output:
---


 CakePHP: the rapid development php
framework:  Postulantes 
...
---

Well. That same location, same HTML, is displayed right in Firefox and
Wrong in Chrome.

Is it Chrome? Is it my app?

Help!

Thanks!

-- 
Santiago Basulto.-

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: AuthComponent action manipulation.

2011-02-17 Thread cricket
On Thu, Feb 17, 2011 at 7:52 AM, Christophe  wrote:
> Hi there
>
> I'm working on an app where schools should able to login.
> I just read the cookbook and used the api to understand the component
> but i'm missing a link I believe.
>
> My controller 'school_controller' has an action 'login'.
> And I've set the userModel and fields.
> $this->Auth->userModel = 'School';
> $this->Auth->fields = array(
>        'username' => 'email1',
>        'password' => 'schoolcode'
> );
>
> My form looks like this:
> Form->create('school',
> array('controller'=>'school','action' => 'login'));?>
> School inlog
>         echo $form->input('email');
>        echo $form->input('pass');
> ?>
> end('Submit');?>

In addition to Stephen's advice, also note that your input names do
not match what you've told Auth to look for.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Postgresql Datestyle

2011-02-17 Thread cricket
On Thu, Feb 17, 2011 at 12:06 PM, labianchin  wrote:
> Hello, folks.
>
> I was doing the formating for date fields in afterFind and
> beforeValidate callback, then I've found a way to do that inside of
> postgresql.
> It's just doing something like that: SET datestyle to 'ISO',
> 'European';
>
> The problem is that this statement would be executed once the database
> connection is establish, in other words I think it would be in the
> connect method of the datasource.
>
> I have tried to search a tip to do that without reimplementing (or
> extending) the DboPostgres, but no success.
>
> Do you have any ideas of how or where I can execute this statement?

Do you have access to the postgresql.conf? It can be set there.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakeDC Users plugin - routes issue

2011-02-17 Thread cricket
On Thu, Feb 17, 2011 at 7:02 AM, designv...@gmail.com
 wrote:
> Hi there there,
>
> I have integrated the CakeDC Users plugin fine and it all works out of
> the box, however I want to uses some neater routes for the
> login,register,dashboard actions but adding the following route:
>
> Router::connect('/login', array('plugin' => 'users','controller' =>
> 'users', 'action' => 'login'));
>
> Causes the login to break and I just get a white screen?

A blank screen generally means a fatal error somewhere. Have you
looked at the server's log? Also, try setting debug to 2.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem with cake 1.2 or not ?

2011-02-17 Thread cricket
On Wed, Feb 16, 2011 at 1:03 PM, Miloš Vučinić  wrote:
>
> Now, from time to time i get the warining: Warning (512): SQL Error:
> 2006: MySQL server has gone away [CORE/cake/libs/model/datasources/
> dbo_source.php, line 525]


This is not a Cake issue. It may appear to be because it mentions
dbo_source.php but that's simply passing on the message as  reported
by MySQL.

Use google to search "Error: 2006: MySQL server has gone away". You
should contact your hosting company about it.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Delete problem

2011-02-17 Thread Stephen
$this->Model->delete($id);

http://book.cakephp.org/view/1036/delete

On 17 February 2011 18:32, Fahim  wrote:

> Hi,
>
> I want to delete a item but it's not deleting. How do i delete?
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>



-- 
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: AuthComponent action manipulation.

2011-02-17 Thread Stephen
Try:

Form->create('School', array('action' => 'login')); ?>

If your form is being called from the /schools/login action then just do

Form->create('School'); ?>

HTH

On 17 February 2011 12:52, Christophe  wrote:

> Hi there
>
> I'm working on an app where schools should able to login.
> I just read the cookbook and used the api to understand the component
> but i'm missing a link I believe.
>
> My controller 'school_controller' has an action 'login'.
> And I've set the userModel and fields.
> $this->Auth->userModel = 'School';
> $this->Auth->fields = array(
>'username' => 'email1',
>'password' => 'schoolcode'
> );
>
> My form looks like this:
> Form->create('school',
> array('controller'=>'school','action' => 'login'));?>
> School inlog
> echo $form->input('email');
>echo $form->input('pass');
> ?>
> end('Submit');?>
>
> But when I look at my SC I see Cake created a form with an action
> action="/code/index.php/school/schools/login"
> The problem is that "schools" doesnt exists and I have no clue why
> Cake adds it. Is there someone that can explain this or give a
> refference to an article about this?
>
> Thanks
> Christophe
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>



-- 
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Delete problem

2011-02-17 Thread Fahim
Hi,

I want to delete a item but it's not deleting. How do i delete?

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Postgresql Datestyle

2011-02-17 Thread labianchin
Hello, folks.

I was doing the formating for date fields in afterFind and
beforeValidate callback, then I've found a way to do that inside of
postgresql.
It's just doing something like that: SET datestyle to 'ISO',
'European';

The problem is that this statement would be executed once the database
connection is establish, in other words I think it would be in the
connect method of the datasource.

I have tried to search a tip to do that without reimplementing (or
extending) the DboPostgres, but no success.

Do you have any ideas of how or where I can execute this statement?

Thanks in advance.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


AuthComponent action manipulation.

2011-02-17 Thread Christophe
Hi there

I'm working on an app where schools should able to login.
I just read the cookbook and used the api to understand the component
but i'm missing a link I believe.

My controller 'school_controller' has an action 'login'.
And I've set the userModel and fields.
$this->Auth->userModel = 'School';
$this->Auth->fields = array(
'username' => 'email1',
'password' => 'schoolcode'
);

My form looks like this:
Form->create('school',
array('controller'=>'school','action' => 'login'));?>
School inlog
input('email');
echo $form->input('pass');
?>
end('Submit');?>

But when I look at my SC I see Cake created a form with an action
action="/code/index.php/school/schools/login"
The problem is that "schools" doesnt exists and I have no clue why
Cake adds it. Is there someone that can explain this or give a
refference to an article about this?

Thanks
Christophe

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Adding a count to model association

2011-02-17 Thread Rene_
Hi,

does anyone know how to add a custom count to a model?
I've tryied using 'finderQuery', and 'counterQuery', and no results..

My count query, and model looks like this:

var $hasMany = array(
'Record' => array('className' => 'Record',
'foreignKey' => 'id',
'order' => '',
'conditions' => '',
'fields' => '',
'finderQuery' => "
(
(
(
SELECT COUNT(kvcbs.id) 
AS count
FROM kvcbs
WHERE ((kvcbs.file_id = 
records.id) AND (kvcbs.kvcb_posoda <>
''))
) +
(
SELECT COUNT(sins.id) 
AS count
FROM sins
WHERE ((sins.file_id = 
records.id) AND (sins.sin_posoda
<> ''))
)
) +
(
SELECT COUNT(others.id) AS count
FROM others
WHERE ((others.file_id = 
records.id) AND (others.drugo_posoda <>
''))
)
) AS found"

)
);

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Google Visualization that fetches data from mysql

2011-02-17 Thread Maureen Soriano
hi guys,

i have found this through my study. i followed the instructions from
this link http://code.google.com/p/mc-goog-visualization/wiki/UserDocumentation
and downloaded its package but still, i encountered errors. i think
this code causes error

?php

require_once 'MC/Google/Visualization.php';

$db=new PDO ('mysql:host=localhost;database=pelopsx', 'root',
'admin');

$vis = new MC_Google_Visualization($db, 'mysql');

$vis->addEntity('dlogs', array(

'dlogs'=>array(

'col1'=>array('cal','number'),

'col2'=> array('met','number')

)

));

$vis->handleRequest();

?>

its error is

Notice (8): Undefined index: table [APP/MC/Google/Visualization.php,
line 785]

Code | Context

*/

public function addEntity($name, $spec=array()) {

$entity = array('table' => ($spec['table']) ? $spec['table'] : $name,
'fields' => array(), 'joins' => array());

$name = "dlogs"

$spec = array(

"dlogs" => array(

"col1" => array(),

"col2" => array()

)

)

MC_Google_Visualization::addEntity() - APP/MC/Google/
Visualization.php, line 785

include - APP/views/pages/test1.ctp, line 49

View::_render() - CORE/cake/libs/view/view.php, line 718

View::render() - CORE/cake/libs/view/view.php, line 417

Controller::render() - CORE/cake/libs/controller/controller.php, line
861

PagesController::display() - CORE/cake/libs/controller/
pages_controller.php, line 88

Object::dispatchMethod() - CORE/cake/libs/object.php, line 125

Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 240

Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 206

[main] - APP/webroot/index.php, line 83

Notice (8): Undefined index: tq [APP/MC/Google/Visualization.php, line
136]

Code

*/

public function handleRequest() {

$query = $_GET['tq'];

MC_Google_Visualization::handleRequest() - APP/MC/Google/
Visualization.php, line 136

include - APP/views/pages/test1.ctp, line 51

View::_render() - CORE/cake/libs/view/view.php, line 718

View::render() - CORE/cake/libs/view/view.php, line 417

Controller::render() - CORE/cake/libs/controller/controller.php, line
861

PagesController::display() - CORE/cake/libs/controller/
pages_controller.php, line 88

Object::dispatchMethod() - CORE/cake/libs/object.php, line 125

Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 240

Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 206

[main] - APP/webroot/index.php, line 83

Notice (8): Undefined index: tqx [APP/MC/Google/Visualization.php,
line 138]

Code | Context

$query = $_GET['tq'];

$params = array('version' => $this->version, 'responseHandler' =>
'google.visualization.Query.setResponse');

$paramlist = explode(';', $_GET['tqx']);

$query = null

$params = array(

"version" => 0.5,

"responseHandler" => "google.visualization.Query.setResponse"

)

MC_Google_Visualization::handleRequest() - APP/MC/Google/
Visualization.php, line 138

include - APP/views/pages/test1.ctp, line 51

View::_render() - CORE/cake/libs/view/view.php, line 718

View::render() - CORE/cake/libs/view/view.php, line 417

Controller::render() - CORE/cake/libs/controller/controller.php, line
861

PagesController::display() - CORE/cake/libs/controller/
pages_controller.php, line 88

Object::dispatchMethod() - CORE/cake/libs/object.php, line 125

Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 240

Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 206

[main] - APP/webroot/index.php, line 83

Notice (8): Undefined offset: 1 [APP/MC/Google/Visualization.php, line
140]

Code | Context

$paramlist = explode(';', $_GET['tqx']);

foreach($paramlist as $paramstr) {

list($name, $val) = explode(':', $paramstr);

$query = null

$params = array(

"version" => 0.5,

"responseHandler" => "google.visualization.Query.setResponse"

)

$paramlist = array(

""

)

$paramstr = ""

MC_Google_Visualization::handleRequest() - APP/MC/Google/
Visualization.php, line 140

include - APP/views/pages/test1.ctp, line 51

View::_render() - CORE/cake/libs/view/view.php, line 718

View::render() - CORE/cake/libs/view/view.php, line 417

Controller::render() - CORE/cake/libs/controller/controller.php, line
861

PagesController::display() - CORE/cake/libs/controller/
pages_controller.php, line 88

Object::dispatchMethod() - CORE/cake/libs/object.php, line 125

Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 240

Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 206

[main] - APP/webroot/index.php, line 83

Notice (8): Undefined index: reqId [APP/MC/Google/Visualization.php,
line 144]

Code | Context

}

$params['reqId'] = (int) $params['reqId'];

$query = null

$params = array(

"version" => 0.5,

"responseHandler" => "google.visualization.Query.setResponse",

"" => null

)

$paramlist = array(

""

)

$paramstr = ""

$val = null

$name = ""

MC_Google_Visualization::handleRequest() - APP/MC/Google/
Visualization.php, line 144

include - APP/views/pages/test1.ctp, line 51

View::_render() - CORE/cake/libs/view/view.php, line 718

View::render() - CORE/cake/libs/view/view.php, line 417

Contro

Logging always on?

2011-02-17 Thread pe...@webtrax.com.au
The manual (4.6.5) for 1.3 says "Setting Configure::write('log',
false); will disable error logging when debug = 0."

I've tried and still always get logging.

These are my core.php settings.
Configure::write('debug', 0);
Configure::write('log', false);

And the following test logging messages in app_controller,
$this->log('AppController:beforeFilter:test logging:');
$this->log('AppController:beforeFilter:config:debug:'.
Configure::read('debug') .':');
$this->log('AppController:beforeFilter:config:log:'.
Configure::read('log') .':');
$this->log('AppController:beforeFilter:config:version:'.
Configure::version() .':');

generate this in the error.log
2011-02-17 11:03:52 Error: AppController:beforeFilter:test logging:
2011-02-17 11:03:52 Error: AppController:beforeFilter:config:debug:0:
2011-02-17 11:03:52 Error: AppController:beforeFilter:config:log::
2011-02-17 11:03:52 Error: AppController:beforeFilter:config:version:
1.3.7:

It shouldn't be logging anything, should it?

Is the manual wrong, or am I doing something wrong?

Running CakePHP 1.3.7.

Cheers
Peter

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: some images cannot be loaded (not about path)

2011-02-17 Thread Necdet TENEKECİ
ok. i ve done it. i realised that my images are encrypted. i turned of
the encyrption under windows. cake cannot render them because of enc.

2011/2/16 cricket :
> On Wed, Feb 16, 2011 at 12:33 AM, divisionbyzero
>  wrote:
>> Hello,
>>
>> i'm very new to CakePHP. In my app, i can load cake.icon.png and
>> cake.power.gif in webroot/img dir. But i cannot load any other images.
>
> Can you show an example of an image that isn't displaying? I mean, the
> code you're using. Is it with $this->Html->img()? A plain IMG tag?
>
> Also, can you fetch the image by itself in the browser when you put
> the URL directly?
>
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php
>

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Shell/CronJob - How to set locale for gettext() and i18n?

2011-02-17 Thread DigitalDude
Hey,

I ran into a problem the other day, and I don't know what to do right
now.

I have a shell which is run as a cronjob, and this shell/cronjob sends
weekly status reports about a users work-environment. In these emails,
there is text as gettext and sometimes even i18n models with specific
language-depending content.

My problem is: How can I set a Session Language or a locale for the
content? In a shell I don't have a Session and I've never seen
anything like this before. So does anyone have a clue what's best
practice for this kind of stuff?

Regards,

DD

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cakephp 1.3 Form Helper inputDefaults bug?

2011-02-17 Thread designv...@gmail.com
So that seems to be the issue lord alone knows why

Does anyone know how to change the div to a span for the validation
errors? ;-)

d//t

On Feb 17, 4:32 pm, "designv...@gmail.com" 
wrote:
> Ahh wierd... i was viewing the HTML in Firebug and it was messed up,
> actually view source in Firefox and its correct...
>
> Hmmm...
>
> (and I know I shouldn't be putting divs inside p tags! hehe)
>
> On Feb 17, 4:27 pm, Jeremy Burns | Class Outfit
>
>  wrote:
> > Could it be browser behaviour because p is a block level element?
>
> > Jeremy Burns
> > Class Outfit
>
> > jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> > On 17 Feb 2011, at 16:20, designv...@gmail.com wrote:
>
> > > Hi there,
>
> > > When using the 'inputDefaults' option in Form->create and doing the
> > > following:
>
> > > Form->create('Enquiry', array('inputDefaults' =>
> > > array('div' => array('tag' => 'p'),'between' => '','format' =>
> > > array('before', 'label', 'error', 'between', 'input', 'after'; ?>
>
> > > Cake seems to close the  tag imediately after the label, however if
> > > I remove this it defaults using a div that surrounds everything.
>
> > > I would have thought that specifying using a P tag instead would still
> > > act the same...
>
> > > Anyone noticed this?
>
> > > d//t
>
> > > --
> > > Our newest site for the community: CakePHP Video 
> > > Tutorialshttp://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
> > > others with their CakePHP related questions.
>
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > > athttp://groups.google.com/group/cake-php
>
>

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cakephp 1.3 Form Helper inputDefaults bug?

2011-02-17 Thread designv...@gmail.com
Ahh wierd... i was viewing the HTML in Firebug and it was messed up,
actually view source in Firefox and its correct...

Hmmm...

(and I know I shouldn't be putting divs inside p tags! hehe)



On Feb 17, 4:27 pm, Jeremy Burns | Class Outfit
 wrote:
> Could it be browser behaviour because p is a block level element?
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 17 Feb 2011, at 16:20, designv...@gmail.com wrote:
>
> > Hi there,
>
> > When using the 'inputDefaults' option in Form->create and doing the
> > following:
>
> > Form->create('Enquiry', array('inputDefaults' =>
> > array('div' => array('tag' => 'p'),'between' => '','format' =>
> > array('before', 'label', 'error', 'between', 'input', 'after'; ?>
>
> > Cake seems to close the  tag imediately after the label, however if
> > I remove this it defaults using a div that surrounds everything.
>
> > I would have thought that specifying using a P tag instead would still
> > act the same...
>
> > Anyone noticed this?
>
> > d//t
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php
>
>

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cakephp 1.3 Form Helper inputDefaults bug?

2011-02-17 Thread Jeremy Burns | Class Outfit
Could it be browser behaviour because p is a block level element?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 17 Feb 2011, at 16:20, designv...@gmail.com wrote:

> Hi there,
> 
> When using the 'inputDefaults' option in Form->create and doing the
> following:
> 
> Form->create('Enquiry', array('inputDefaults' =>
> array('div' => array('tag' => 'p'),'between' => '','format' =>
> array('before', 'label', 'error', 'between', 'input', 'after'; ?>
> 
> Cake seems to close the  tag imediately after the label, however if
> I remove this it defaults using a div that surrounds everything.
> 
> I would have thought that specifying using a P tag instead would still
> act the same...
> 
> Anyone noticed this?
> 
> d//t
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Cakephp 1.3 Form Helper inputDefaults bug?

2011-02-17 Thread designv...@gmail.com
Hi there,

When using the 'inputDefaults' option in Form->create and doing the
following:

Form->create('Enquiry', array('inputDefaults' =>
array('div' => array('tag' => 'p'),'between' => '','format' =>
array('before', 'label', 'error', 'between', 'input', 'after'; ?>

Cake seems to close the  tag imediately after the label, however if
I remove this it defaults using a div that surrounds everything.

I would have thought that specifying using a P tag instead would still
act the same...

Anyone noticed this?

d//t

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Created and Modified Dates don't auto populate on HABTM

2011-02-17 Thread rgreenphotodesign
Just for good measure here are my relationships in the models:

Activity:

var $hasAndBelongsToMany = array(
'Statustype' => array(
'className' => 'Statustype',
'joinTable' => 'activity_statuses',
'foreignKey' => 'activities_id',
'associationForeignKey' => 'statustypes_id',
'unique' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
),
);

ActivityStatus:

var $belongsTo = array(
'Statustype' => array(
'className' => 'Statustype',
'foreignKey' => 'statustypes_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
'Activity' => array(
'className' => 'Activity',
'foreignKey' => 'activities_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
);

I don't define any relationships in the Statustype model.

On Feb 17, 9:11 am, rgreenphotodesign 
wrote:
> CREATE TABLE `activity_statuses` (
>   `id` int(11) NOT NULL AUTO_INCREMENT,
>   `statustypes_id` int(11) NOT NULL DEFAULT '0',
>   `activities_id` int(11) NOT NULL DEFAULT '0',
>   `created` datetime DEFAULT NULL,
>   `created_by` int(11) DEFAULT NULL,
>   `modified` datetime DEFAULT NULL,
>   `modified_by` int(11) DEFAULT NULL,
>   `_explicitType` varchar(45) NOT NULL DEFAULT 'ActivityStatus',
>   PRIMARY KEY (`id`)
> ) ENGINE=InnoDB AUTO_INCREMENT=644 DEFAULT CHARSET=latin1;
>
> This is the create table SQL for my activity_statuses table. If I do a
> direct insert via the ActivityStatus model, the dates get populated
> correct. Thanks for looking!
>
> Russ
>
> On Feb 17, 9:00 am, John Andersen  wrote:
>
>
>
>
>
>
>
> > What is the definition of your created and modified columns? Please do
> > a copy/paste :)
> > Enjoy,
> >    John
>
> > On 17 Feb., 16:40, rgreenphotodesign 
> > wrote:
>
> > > I've set up (maybe the wrong approach) a HABTM relationship to handle
> > > status updates on a model record. For example:
>
> > > Models: Activity, Statustype, ActivityStatus
>
> > > In my Activity model, I created a belongsTo relationship with
> > > Statustype and the table contains a statustype_id (relationship is
> > > called CurrentStatustype). This represents the current status of the
> > > Activity. I also created a HABTM relationship (unique = false) with
> > > the ActivityStatus/Statustype model (named Statustype). The theory
> > > being, anytime an Activity is updated it gets the current status
> > > change in the Activity and then writes a 'history' to the
> > > ActivityStatus table. So far the automagic happens just the way I want
> > > with one exception. The HABTM relationship does not auto populate the
> > > created and modified date fields in the ActivityStatus table. I know
> > > for most HABTM relationships this wouldn't be an issue as you could
> > > simply get those dates from the Activity table. But as I'm trying to
> > > create a running history of status changes, the date fields become
> > > critical.
>
> > > Is there a way to force these dates? Do I need to write a insertQuery
> > > in the relationship? Or do you think this is just a bad approach to
> > > the requirement? Thanks in advance.
> > > Russ

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Created and Modified Dates don't auto populate on HABTM

2011-02-17 Thread rgreenphotodesign
CREATE TABLE `activity_statuses` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `statustypes_id` int(11) NOT NULL DEFAULT '0',
  `activities_id` int(11) NOT NULL DEFAULT '0',
  `created` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `modified` datetime DEFAULT NULL,
  `modified_by` int(11) DEFAULT NULL,
  `_explicitType` varchar(45) NOT NULL DEFAULT 'ActivityStatus',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=644 DEFAULT CHARSET=latin1;

This is the create table SQL for my activity_statuses table. If I do a
direct insert via the ActivityStatus model, the dates get populated
correct. Thanks for looking!

Russ

On Feb 17, 9:00 am, John Andersen  wrote:
> What is the definition of your created and modified columns? Please do
> a copy/paste :)
> Enjoy,
>    John
>
> On 17 Feb., 16:40, rgreenphotodesign 
> wrote:
>
>
>
>
>
>
>
> > I've set up (maybe the wrong approach) a HABTM relationship to handle
> > status updates on a model record. For example:
>
> > Models: Activity, Statustype, ActivityStatus
>
> > In my Activity model, I created a belongsTo relationship with
> > Statustype and the table contains a statustype_id (relationship is
> > called CurrentStatustype). This represents the current status of the
> > Activity. I also created a HABTM relationship (unique = false) with
> > the ActivityStatus/Statustype model (named Statustype). The theory
> > being, anytime an Activity is updated it gets the current status
> > change in the Activity and then writes a 'history' to the
> > ActivityStatus table. So far the automagic happens just the way I want
> > with one exception. The HABTM relationship does not auto populate the
> > created and modified date fields in the ActivityStatus table. I know
> > for most HABTM relationships this wouldn't be an issue as you could
> > simply get those dates from the Activity table. But as I'm trying to
> > create a running history of status changes, the date fields become
> > critical.
>
> > Is there a way to force these dates? Do I need to write a insertQuery
> > in the relationship? Or do you think this is just a bad approach to
> > the requirement? Thanks in advance.
> > Russ

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Created and Modified Dates don't auto populate on HABTM

2011-02-17 Thread John Andersen
What is the definition of your created and modified columns? Please do
a copy/paste :)
Enjoy,
   John

On 17 Feb., 16:40, rgreenphotodesign 
wrote:
> I've set up (maybe the wrong approach) a HABTM relationship to handle
> status updates on a model record. For example:
>
> Models: Activity, Statustype, ActivityStatus
>
> In my Activity model, I created a belongsTo relationship with
> Statustype and the table contains a statustype_id (relationship is
> called CurrentStatustype). This represents the current status of the
> Activity. I also created a HABTM relationship (unique = false) with
> the ActivityStatus/Statustype model (named Statustype). The theory
> being, anytime an Activity is updated it gets the current status
> change in the Activity and then writes a 'history' to the
> ActivityStatus table. So far the automagic happens just the way I want
> with one exception. The HABTM relationship does not auto populate the
> created and modified date fields in the ActivityStatus table. I know
> for most HABTM relationships this wouldn't be an issue as you could
> simply get those dates from the Activity table. But as I'm trying to
> create a running history of status changes, the date fields become
> critical.
>
> Is there a way to force these dates? Do I need to write a insertQuery
> in the relationship? Or do you think this is just a bad approach to
> the requirement? Thanks in advance.
> Russ

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem with "loadModel" and "afterSave"

2011-02-17 Thread pablosky
Fixed. The problem was that the model is within a plugin.

$this->loadModel('Settings.Setting');

Thanks!!!

On 17 feb, 14:06, "Dr. Loboto"  wrote:
> Does it really loads this model? Simplest check is by class name:
> pr(get_class($this->Setting));
>
> On 17 фев, 15:36, pablosky  wrote:
>
> > Hello.
>
> > I have a controller that using another model . And save some data:
>
> > $this->loadModel('Setting');
> > $this->Setting->saveAll($settings['Settings']['Setting']);
>
> > The model is this:
>
> > class Setting extends SettingsAppModel {
> >         var $name = 'Setting';
>
> >         function afterSave()
> >         {
> >                 Cache::delete('settings');
> >                 Cache::delete('settings_menu');
> >         }
>
> > }
>
> > The problem is not running afterSave when you load the model using
> > loadModel.
>
> > Any ideas?
>
> > Thanks

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Created and Modified Dates don't auto populate on HABTM

2011-02-17 Thread rgreenphotodesign
I've set up (maybe the wrong approach) a HABTM relationship to handle
status updates on a model record. For example:

Models: Activity, Statustype, ActivityStatus

In my Activity model, I created a belongsTo relationship with
Statustype and the table contains a statustype_id (relationship is
called CurrentStatustype). This represents the current status of the
Activity. I also created a HABTM relationship (unique = false) with
the ActivityStatus/Statustype model (named Statustype). The theory
being, anytime an Activity is updated it gets the current status
change in the Activity and then writes a 'history' to the
ActivityStatus table. So far the automagic happens just the way I want
with one exception. The HABTM relationship does not auto populate the
created and modified date fields in the ActivityStatus table. I know
for most HABTM relationships this wouldn't be an issue as you could
simply get those dates from the Activity table. But as I'm trying to
create a running history of status changes, the date fields become
critical.

Is there a way to force these dates? Do I need to write a insertQuery
in the relationship? Or do you think this is just a bad approach to
the requirement? Thanks in advance.
Russ

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Blank screen except these characters: dispatch(); }

2011-02-17 Thread zzella
Hi Ryan & Milos thanks very much for your replies!
I thought the problem had gone away but I saw it again last night. So
with renewed vigour, here is more information on the problem!

@Ryan the info you asked for I'm pulling mostly from a phpinfo() call
as it is a server hosted by someone else. Hope this will be ok:
Server: Red Hat Enterprise Linux 5, x86_64-redhat-linux-gnu
SAPI: Apache 2.0 Handler
PHP: v 5.1.6
Cake: 1.3.6

@Milos Thanks for the list of things to check.
Tmp file perms seem to be ok.
The items in the cache refresh when I delete them, except the cache/
view folder but this has always been empty (Is that normal?)
The biggest file in the cache is about 12kb which doesn't seem to be
enormous to me but not sure what I should be expecting.
I'm not sure how to make sure that I'm not caching things I shouldn't
be?

Finally, I asked the server administrator for the error and access
logs. He said the error log was empty. Below is the access log for the
time that the error happened (00:20 this morning).

I am suspecting caching issues also but I'm not sure how to go about
debugging this. Any help is appreciated!

Ella

- - [17/Feb/2011:00:20:19 +0100] "GET / HTTP/1.1" 200 2973 "-"
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.7
(KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7"
78.X.X.X
- - [17/Feb/2011:00:20:19 +0100] "GET /css/.css HTTP/1.1" 304 -
"http://myclientsserver.fr/"; "Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/
534.7"
78.X.X.X
- - [17/Feb/2011:00:20:19 +0100] "GET /js/jquery.js HTTP/1.1" 304 -
"http://myclientsserver.fr/"; "Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/
534.7"
78.X.X.X
- - [17/Feb/2011:00:20:19 +0100] "GET /img/trad100.png HTTP/1.1" 304 -
"http://myclientsserver.fr/"; "Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/
534.7"
78.X.X.X
- - [17/Feb/2011:00:20:19 +0100] "GET /img/inter100.png HTTP/1.1" 304
- "http://myclientsserver.fr/"; "Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44
Safari/534.7"
78.X.X.X
- - [17/Feb/2011:00:20:23 +0100] "GET /applicants HTTP/1.1" 302 - "-"
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.7
(KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7"
78.X.X.X
- - [17/Feb/2011:00:20:24 +0100] "GET /users/login HTTP/1.1" 200 1665
"-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.7
(KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7"
78.X.X.X
- - [17/Feb/2011:00:20:32 +0100] "POST /users/login HTTP/1.1" 200 2727
"http://myclientsserver.fr/users/login"; "Mozilla/5.0 (Windows; U;
Windows NT 5.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/
7.0.517.44 Safari/534.7"
78.X.X.X
- - [17/Feb/2011:00:20:36 +0100] "POST /users/login HTTP/1.1" 302 -
"http://myclientsserver.fr/users/login"; "Mozilla/5.0 (Windows; U;
Windows NT 5.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/
7.0.517.44 Safari/534.7"
78.X.X.X
- - [17/Feb/2011:00:20:37 +0100] "GET /applicants HTTP/1.1" 200 27797
"http://myclientsserver.fr/users/login"; "Mozilla/5.0 (Windows; U;
Windows NT 5.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/
7.0.517.44 Safari/534.7"
78.X.X.X
- - [17/Feb/2011:00:20:38 +0100] "GET /js/jquery.js HTTP/1.1" 304 -
"http://myclientsserver.fr/applicants"; "Mozilla/5.0 (Windows; U;
Windows NT 5.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/
7.0.517.44 Safari/534.7"
78.X.X.X
- - [17/Feb/2011:00:20:38 +0100] "GET /css/.css HTTP/1.1" 304 -
"http://myclientsserver.fr/applicants"; "Mozilla/5.0 (Windows; U;
Windows NT 5.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/
7.0.517.44 Safari/534.7"
78.X.X.X
- - [17/Feb/2011:00:20:38 +0100] "GET /js/applicants/
applicant_index.js HTTP/1.1" 304 - "http://myclientsserver.fr/
applicants" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7"
78.X.X.X
- - [17/Feb/2011:00:20:38 +0100] "GET /favicon.ico HTTP/1.1" 304 - "-"
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.7
(KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7"
78.X.X.X




On Feb 10, 9:36 pm, Ryan Schmidt  wrote:
> On Feb 10, 2011, at 12:07, zzella wrote:
>
> > Update: When I view the source of the screen, I see the contents of
> > the app/webroot/index.php file!
>
> > Everything seems to be an invisible comment until it hits the ">" of
> > this line:
> > $Dispatcher->dispatch();
>
> > Everything in the file after the ">" appears on the browser screen (ie
> > "dispatch(); }"  )
>
> > Would appreciate any ideas on why my page is getting served like this
> > occasionally?
>
> Goodness, it sounds like your web server is occasionally forgetting to invoke 
> the PHP interpreter, and is sending the PHP code directly to the browser. I 
> would say that is rather wr

Re: How much to charge?

2011-02-17 Thread hydra12
Thanks for the input, everyone!
@euromark - I know it's a very open-ended question, but I didn't even
know where to start.  I'm probably going to do this in cake, though,
and I know there are a lot of developers on this list, so that's why I
asked.

@Jeremy, Krissy - Thanks!

@Tarique - Very nice :-)

@keymaster - Thanks for the hourly pricing.  That helps a lot!

hydra12

On Feb 17, 12:39 am, keymaster  wrote:
> Just off the top of my head, for freelance work:
>
> Western countries - $50 - $125/hr.
> India/Russia/Africa - $8 - $25/hr.
>
> Where you fit in that range is determined by a host of issues which
> you need to objectively decide for yourself.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Validation Question

2011-02-17 Thread Jeremy Burns | Class Outfit
Always listen to John - he is usually right.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 17 Feb 2011, at 14:24, Tapan Kumar Thapa wrote:

> Issue resolved:-)
> 
> Many thanks John for pointing me to the correct point. 
> 
> My model file name was incomings.php by mistake i think so and that is why 
> validation was not working.
> 
> Many thanks to Jeremy as well for helping me out.
> 
> Regards
> Tapan Thapa
> India
> 
> 
> On Thu, Feb 17, 2011 at 6:19 PM, John Andersen  
> wrote:
> Check your file names! Your model file name should be incoming.php!
> If it is not, then you may actually be using the AppModel instead of
> the Incoming Model class!
> Enjoy,
>   John
> 
> On 17 Feb., 13:05, Tapan Kumar Thapa 
> wrote:
> > If i put debug statement nothing gets print in my incoming view.
> >
> > If i also put die statement then complete page dies and i got blank white
> > blank page.
> >
> >  >
> > class IncomingsController extends AppController {
> >
> > var $name = 'Incomings';
> >
> > function request() {
> > $this->Incoming->set(array(
> > 'Incoming' => $this->params['named']
> > ));
> > debug($this->Incoming->validates());
> > //die(debug($this->Incoming->validationErrors));
> > /* $this->Incoming->set($this->params['named']);
> >   if ($this->Incoming->validates()==TRUE) {
> >   $this->Session->setFlash("Correct");
> >   } else {
> [snip]
> 
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Validation Question

2011-02-17 Thread Tapan Kumar Thapa
*Issue resolved:-)*

Many thanks John for pointing me to the correct point.

My model file name was incomings.php by mistake i think so and that is why
validation was not working.

Many thanks to Jeremy as well for helping me out.

Regards
Tapan Thapa
India


On Thu, Feb 17, 2011 at 6:19 PM, John Andersen wrote:

> Check your file names! Your model file name should be incoming.php!
> If it is not, then you may actually be using the AppModel instead of
> the Incoming Model class!
> Enjoy,
>   John
>
> On 17 Feb., 13:05, Tapan Kumar Thapa 
> wrote:
> > If i put debug statement nothing gets print in my incoming view.
> >
> > If i also put die statement then complete page dies and i got blank white
> > blank page.
> >
> >  >
> > class IncomingsController extends AppController {
> >
> > var $name = 'Incomings';
> >
> > function request() {
> > $this->Incoming->set(array(
> > 'Incoming' => $this->params['named']
> > ));
> > debug($this->Incoming->validates());
> > //die(debug($this->Incoming->validationErrors));
> > /* $this->Incoming->set($this->params['named']);
> >   if ($this->Incoming->validates()==TRUE) {
> >   $this->Session->setFlash("Correct");
> >   } else {
> [snip]
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


RE: Joins Conditions Contain Question

2011-02-17 Thread Krissy Masters
Thanks guys,

I will let you know after trying your suggestions.

K


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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem with "loadModel" and "afterSave"

2011-02-17 Thread Dr. Loboto
Does it really loads this model? Simplest check is by class name:
pr(get_class($this->Setting));

On 17 фев, 15:36, pablosky  wrote:
> Hello.
>
> I have a controller that using another model . And save some data:
>
> $this->loadModel('Setting');
> $this->Setting->saveAll($settings['Settings']['Setting']);
>
> The model is this:
>
> class Setting extends SettingsAppModel {
>         var $name = 'Setting';
>
>         function afterSave()
>         {
>                 Cache::delete('settings');
>                 Cache::delete('settings_menu');
>         }
>
> }
>
> The problem is not running afterSave when you load the model using
> loadModel.
>
> Any ideas?
>
> Thanks

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Validation Question

2011-02-17 Thread John Andersen
Check your file names! Your model file name should be incoming.php!
If it is not, then you may actually be using the AppModel instead of
the Incoming Model class!
Enjoy,
   John

On 17 Feb., 13:05, Tapan Kumar Thapa 
wrote:
> If i put debug statement nothing gets print in my incoming view.
>
> If i also put die statement then complete page dies and i got blank white
> blank page.
>
> 
> class IncomingsController extends AppController {
>
>     var $name = 'Incomings';
>
>     function request() {
>         $this->Incoming->set(array(
>             'Incoming' => $this->params['named']
>         ));
>         debug($this->Incoming->validates());
>         //die(debug($this->Incoming->validationErrors));
>         /* $this->Incoming->set($this->params['named']);
>           if ($this->Incoming->validates()==TRUE) {
>           $this->Session->setFlash("Correct");
>           } else {
[snip]

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Validation Question

2011-02-17 Thread Jeremy Burns | Class Outfit
Then something else is astray. Is debug set to 2?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 17 Feb 2011, at 12:05, Tapan Kumar Thapa wrote:

> If i put debug statement nothing gets print in my incoming view.
> 
> If i also put die statement then complete page dies and i got blank white 
> blank page.
> 
>  
> class IncomingsController extends AppController {
> 
> var $name = 'Incomings';
> 
> function request() {
> $this->Incoming->set(array(
> 'Incoming' => $this->params['named']
> ));
> debug($this->Incoming->validates());
> //die(debug($this->Incoming->validationErrors));
> /* $this->Incoming->set($this->params['named']);
>   if ($this->Incoming->validates()==TRUE) {
>   $this->Session->setFlash("Correct");
>   } else {
>   $this->Session->setFlash("Incorrect");
>   } */
> }
> 
> }
> 
> ?>
> 
> Please suggest...
> 
> Regards
> Tapan Thapa
> 
> On Thu, Feb 17, 2011 at 5:14 PM, Jeremy Burns | Class Outfit 
>  wrote:
> Try something for me...
> 
> debug($this->Incoming->validates());
> 
> die(debug($this->Incoming->validationErrors));
> 
> ...rather than checking for true or false.
> 
> 
> Jeremy Burns
> Class Outfit
> 
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
> 
> On 17 Feb 2011, at 11:40, Tapan Kumar Thapa wrote:
> 
>> Still not working. :-(
>> 
>> My Url: 
>> http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI
>> 
>> My Controller:
>> 
>> > 
>> class IncomingsController extends AppController {
>> 
>> var $name = 'Incomings';
>> 
>> function request() {
>> $this->Incoming->set(array(
>> 'Incoming' => $this->params['named']
>> ));
>> //$this->Incoming->set($this->params['named']);
>> if ($this->Incoming->validates()==TRUE) {
>> $this->Session->setFlash("Correct");
>> } else {
>> $this->Session->setFlash("Incorrect");
>> }
>> }
>> 
>> }
>> 
>> ?>
>> 
>> My Model:
>> 
>> > 
>> class Incoming extends AppModel {
>> 
>> var $name = 'Incoming';
>> var $validate = array(
>> 'msisdn' => array(
>> 'required' => true,
>> 'allowEmpty' => false,
>> 'rule' => 'numeric',
>> 'message' => 'Please enter a valid msisdn',
>> ));
>> 
>> }
>> 
>> ?>
>> 
>> Please suggest.
>> 
>> Regards
>> Tapan Thapa
>> India
>> 
>> On Thu, Feb 17, 2011 at 4:58 PM, John Andersen  
>> wrote:
>> When you are setting the model data using the set() method, then you
>> should provide it with at standard structure, not just the value of
>> the msisdn parameter.
>> 
>> [code example]
>> $this->Incoming->set( array(
>>   'Incoming' => $this->params['named']
>> ) );
>> [/code example]
>> 
>> Enjoy,
>>   John
>> 
>> On 17 Feb., 12:09, Tapan Kumar Thapa 
>> wrote:
>> > I am dam got stuck here.
>> >
>> > Can some one suggest anything?
>> >
>> > BR
>> > Tapan Thapa
>> >
>> > On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa <
>> >
>> >
>> [snip]
>> 
>> --
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>> 
>> 
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php
>> 
>> 
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>  
>>  
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


To unsubscribe from this group, send email to
cake-php+uns

Re: Validation Question

2011-02-17 Thread Dr. Tarique Sani
Damn!! now I am pissed - zip up your model and controller files and
paste a URL to download

I want the actual files you are using not cut and paste

Tarique


On Thu, Feb 17, 2011 at 5:35 PM, Tapan Kumar Thapa
 wrote:
> If i put debug statement nothing gets print in my incoming view.
>
> If i also put die statement then complete page dies and i got blank white
> blank page.
>
> 
> class IncomingsController extends AppController {
>
>     var $name = 'Incomings';
>
>     function request() {
>     $this->Incoming->set(array(
>     'Incoming' => $this->params['named']
>     ));
>     debug($this->Incoming->validates());
>     //die(debug($this->Incoming->validationErrors));
>     /* $this->Incoming->set($this->params['named']);
>   if ($this->Incoming->validates()==TRUE) {
>   $this->Session->setFlash("Correct");
>   } else {
>   $this->Session->setFlash("Incorrect");
>   } */
>     }
>
> }
>
> ?>
>
> Please suggest...
>
> Regards
> Tapan Thapa
>
> On Thu, Feb 17, 2011 at 5:14 PM, Jeremy Burns | Class Outfit
>  wrote:
>>
>> Try something for me...
>> debug($this->Incoming->validates());
>> die(debug($this->Incoming->validationErrors));
>> ...rather than checking for true or false.
>>
>> Jeremy Burns
>> Class Outfit
>> jeremybu...@classoutfit.com
>> http://www.classoutfit.com
>> On 17 Feb 2011, at 11:40, Tapan Kumar Thapa wrote:
>>
>> Still not working. :-(
>>
>> My Url:
>> http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI
>>
>> My Controller:
>>
>> >
>> class IncomingsController extends AppController {
>>
>>     var $name = 'Incomings';
>>
>>     function request() {
>>     $this->Incoming->set(array(
>>     'Incoming' => $this->params['named']
>>     ));
>>     //$this->Incoming->set($this->params['named']);
>>     if ($this->Incoming->validates()==TRUE) {
>>     $this->Session->setFlash("Correct");
>>     } else {
>>     $this->Session->setFlash("Incorrect");
>>     }
>>     }
>>
>> }
>>
>> ?>
>>
>> My Model:
>>
>> >
>> class Incoming extends AppModel {
>>
>>     var $name = 'Incoming';
>>     var $validate = array(
>>     'msisdn' => array(
>>     'required' => true,
>>     'allowEmpty' => false,
>>     'rule' => 'numeric',
>>     'message' => 'Please enter a valid msisdn',
>>     ));
>>
>> }
>>
>> ?>
>>
>> Please suggest.
>>
>> Regards
>> Tapan Thapa
>> India
>>
>> On Thu, Feb 17, 2011 at 4:58 PM, John Andersen 
>> wrote:
>>>
>>> When you are setting the model data using the set() method, then you
>>> should provide it with at standard structure, not just the value of
>>> the msisdn parameter.
>>>
>>> [code example]
>>> $this->Incoming->set( array(
>>>   'Incoming' => $this->params['named']
>>> ) );
>>> [/code example]
>>>
>>> Enjoy,
>>>   John
>>>
>>> On 17 Feb., 12:09, Tapan Kumar Thapa 
>>> wrote:
>>> > I am dam got stuck here.
>>> >
>>> > Can some one suggest anything?
>>> >
>>> > BR
>>> > Tapan Thapa
>>> >
>>> > On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa <
>>> >
>>> >
>>> [snip]
>>>
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>>> others with their CakePHP related questions.
>>>
>>>
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>>> at http://groups.google.com/group/cake-php
>>
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php
>



-- 
=
PHP for E-Biz: http://sanisoft.com
=

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out

Re: Validation Question

2011-02-17 Thread Tapan Kumar Thapa
If i put debug statement nothing gets print in my incoming view.

If i also put die statement then complete page dies and i got blank white
blank page.

Incoming->set(array(
'Incoming' => $this->params['named']
));
debug($this->Incoming->validates());
//die(debug($this->Incoming->validationErrors));
/* $this->Incoming->set($this->params['named']);
  if ($this->Incoming->validates()==TRUE) {
  $this->Session->setFlash("Correct");
  } else {
  $this->Session->setFlash("Incorrect");
  } */
}

}

?>

Please suggest...

Regards
Tapan Thapa

On Thu, Feb 17, 2011 at 5:14 PM, Jeremy Burns | Class Outfit <
jeremybu...@classoutfit.com> wrote:

> Try something for me...
>
> debug($this->Incoming->validates());
>
> die(debug($this->Incoming->validationErrors));
>
> ...rather than checking for true or false.
>
>
> Jeremy Burns
> *Class Outfit*
> *
> *
> jeremybu...@classoutfit.com 
> http://www.classoutfit.com
>
> On 17 Feb 2011, at 11:40, Tapan Kumar Thapa wrote:
>
> Still not working. :-(
>
> My Url:
> http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI
>
> My Controller:
>
> 
> class IncomingsController extends AppController {
>
> var $name = 'Incomings';
>
> function request() {
> $this->Incoming->set(array(
> 'Incoming' => $this->params['named']
> ));
> //$this->Incoming->set($this->params['named']);
> if ($this->Incoming->validates()==TRUE) {
> $this->Session->setFlash("Correct");
> } else {
> $this->Session->setFlash("Incorrect");
> }
> }
>
> }
>
> ?>
>
> My Model:
>
> 
> class Incoming extends AppModel {
>
> var $name = 'Incoming';
> var $validate = array(
> 'msisdn' => array(
> 'required' => true,
> 'allowEmpty' => false,
> 'rule' => 'numeric',
> 'message' => 'Please enter a valid msisdn',
> ));
>
> }
>
> ?>
>
> Please suggest.
>
> Regards
> Tapan Thapa
> India
>
> On Thu, Feb 17, 2011 at 4:58 PM, John Andersen wrote:
>
>> When you are setting the model data using the set() method, then you
>> should provide it with at standard structure, not just the value of
>> the msisdn parameter.
>>
>> [code example]
>> $this->Incoming->set( array(
>>   'Incoming' => $this->params['named']
>> ) );
>> [/code example]
>>
>> Enjoy,
>>   John
>>
>> On 17 Feb., 12:09, Tapan Kumar Thapa 
>> wrote:
>> > I am dam got stuck here.
>> >
>> > Can some one suggest anything?
>> >
>> > BR
>> > Tapan Thapa
>> >
>> > On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa <
>> >
>> >
>> [snip]
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


CakeDC Users plugin - routes issue

2011-02-17 Thread designv...@gmail.com
Hi there there,

I have integrated the CakeDC Users plugin fine and it all works out of
the box, however I want to uses some neater routes for the
login,register,dashboard actions but adding the following route:

Router::connect('/login', array('plugin' => 'users','controller' =>
'users', 'action' => 'login'));

Causes the login to break and I just get a white screen?

Has anyone got any suggestions? Has anyone successfully achieved this?

TIA,

d//t

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Validation Question

2011-02-17 Thread Jeremy Burns | Class Outfit
Also try a save() before checking for validation errors.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 17 Feb 2011, at 11:44, Jeremy Burns | Class Outfit wrote:

> Try something for me...
> 
> debug($this->Incoming->validates());
> 
> die(debug($this->Incoming->validationErrors));
> 
> ...rather than checking for true or false.
> 
> Jeremy Burns
> Class Outfit
> 
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
> 
> On 17 Feb 2011, at 11:40, Tapan Kumar Thapa wrote:
> 
>> Still not working. :-(
>> 
>> My Url: 
>> http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI
>> 
>> My Controller:
>> 
>> > 
>> class IncomingsController extends AppController {
>> 
>> var $name = 'Incomings';
>> 
>> function request() {
>> $this->Incoming->set(array(
>> 'Incoming' => $this->params['named']
>> ));
>> //$this->Incoming->set($this->params['named']);
>> if ($this->Incoming->validates()==TRUE) {
>> $this->Session->setFlash("Correct");
>> } else {
>> $this->Session->setFlash("Incorrect");
>> }
>> }
>> 
>> }
>> 
>> ?>
>> 
>> My Model:
>> 
>> > 
>> class Incoming extends AppModel {
>> 
>> var $name = 'Incoming';
>> var $validate = array(
>> 'msisdn' => array(
>> 'required' => true,
>> 'allowEmpty' => false,
>> 'rule' => 'numeric',
>> 'message' => 'Please enter a valid msisdn',
>> ));
>> 
>> }
>> 
>> ?>
>> 
>> Please suggest.
>> 
>> Regards
>> Tapan Thapa
>> India
>> 
>> On Thu, Feb 17, 2011 at 4:58 PM, John Andersen  
>> wrote:
>> When you are setting the model data using the set() method, then you
>> should provide it with at standard structure, not just the value of
>> the msisdn parameter.
>> 
>> [code example]
>> $this->Incoming->set( array(
>>   'Incoming' => $this->params['named']
>> ) );
>> [/code example]
>> 
>> Enjoy,
>>   John
>> 
>> On 17 Feb., 12:09, Tapan Kumar Thapa 
>> wrote:
>> > I am dam got stuck here.
>> >
>> > Can some one suggest anything?
>> >
>> > BR
>> > Tapan Thapa
>> >
>> > On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa <
>> >
>> >
>> [snip]
>> 
>> --
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>> 
>> 
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php
>> 
>> 
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>  
>>  
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Validation Question

2011-02-17 Thread Jeremy Burns | Class Outfit
But that's what the model does - so why not set up your validation rules and do 
a save? If it fails validation it will not save and you'll get back an array of 
validation errors, which you can then process.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 17 Feb 2011, at 11:44, Tapan Kumar Thapa wrote:

> I want to validate user input in http get url before inserting into my 
> database table.
> 
> If user is not sending any data or sending invalid character data in my named 
> parameters then i want to use built in validation feature available in cake 
> php and throw different error message for each named parameters.
> 
> Please suggest.
> 
> Regards
> Tapan Thapa
> 
> On Thu, Feb 17, 2011 at 5:09 PM, Jeremy Burns | Class Outfit 
>  wrote:
> Why do you need to validate it? Is it not enough to just check the value?
> 
> Jeremy Burns
> Class Outfit
> 
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
> 
> On 17 Feb 2011, at 11:33, Tapan Kumar Thapa wrote:
> 
>> Sorry to say but it is still not working.
>> 
>> Url: 
>> http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI
>> 
>> Incoming controller:
>> 
>> > 
>> class IncomingsController extends AppController {
>> 
>> var $name = 'Incomings';
>> 
>> function request() {
>> $this->Incoming->set($this->params['named']);
>> if ($this->Incoming->validates()) {
>> $this->Session->setFlash("Correct");
>> } else {
>> $this->Session->setFlash("Incorrect");
>> }
>> }
>> 
>> }
>> 
>> ?>
>> 
>> Incoming Model:
>> 
>> > 
>> class Incoming extends AppModel {
>> 
>> var $name = 'Incoming';
>> var $validate = array(
>> 'msisdn' => array(
>> 'required' => true,
>> 'allowEmpty' => false,
>> 'rule' => 'numeric',
>> 'message' => 'Please enter a valid msisdn',
>> ));
>> 
>> }
>> 
>> ?>
>> 
>> Please suggest.
>> 
>> Is validation only work for post request of is it also work for get request 
>> like above?
>> 
>> Regards
>> Tapan Thapa 
>> India
>> 
>> On Thu, Feb 17, 2011 at 4:49 PM, Dr. Tarique Sani  
>> wrote:
>> Try $this->Incoming->set($this->params['named']);
>> 
>> Tarique
>> 
>> On Thu, Feb 17, 2011 at 4:39 PM, Tapan Kumar Thapa
>>  wrote:
>> > I am dam got stuck here.
>> >
>> > Can some one suggest anything?
>> >
>> > BR
>> > Tapan Thapa
>> >
>> > On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa
>> >  wrote:
>> >>
>> >> Hello,
>> >>
>> >> Now i am trying like this.
>> >>
>> >>
>> >> http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI
>> >>
>> >> but still validation from model class it not working. Please please
>> >> suggest.
>> >>
>> >> My Model:
>> >>
>> >> > >>
>> >> class Incoming extends AppModel {
>> >>
>> >> var $name = 'Incoming';
>> >> var $validate = array(
>> >> 'msisdn' => array(
>> >> 'required' => true,
>> >> 'allowEmpty' => false,
>> >> 'rule' => 'numeric',
>> >> 'message' => 'Please enter a valid msisdn',
>> >> ));
>> >>
>> >> }
>> >>
>> >> ?>
>> >>
>> >> My Controller:
>> >>
>> >> > >>
>> >> class IncomingsController extends AppController {
>> >>
>> >> var $name = 'Incomings';
>> >>
>> >> function request() {
>> >> $this->Incoming->set($this->params['named']['msisdn']);
>> >> if ($this->Incoming->validates()) {
>> >> $this->Session->setFlash("Correct");
>> >> } else {
>> >> $this->Session->setFlash("Incorrect");
>> >> }
>> >> }
>> >>
>> >> }
>> >>
>> >> ?>
>> >>
>> >> I am always going in Correct message if condition however i have not given
>> >> any value in msisdn parameter.
>> >>
>> >> Please please suggest something. I am clue less. Is validation only works
>> >> in case of post request from view?
>> >>
>> >> Regards
>> >> Tapan Thapa
>> >> India
>> >>
>> >>
>> >> On Thu, Feb 17, 2011 at 8:56 AM, Tapan Kumar Thapa
>> >>  wrote:
>> >>>
>> >>> I don't mind using URL like this but are you sure that validation will
>> >>> work like this?
>> >>>
>> >>> Regards
>> >>> Tapan Thapa
>> >>>
>> >>> Sent from my iPhone
>> >>>
>> >>> On Feb 16, 2011, at 11:36 PM, euromark 
>> >>> wrote:
>> >>>
>> >>> > you are mixing cake pretty urls and plain url style
>> >>> >
>> >>> > why not going with
>> >>> > /.../x:1/y:2/z:3
>> >>> > and using
>> >>> > $this->params[named]
>> >>> > ?
>> >>> >
>> >>> > if you don't mind my asking
>> >>> >
>> >>> >
>> >>> > On 16 Feb., 12:49, Tapan Thapa  wrote:
>> >>> >> Hello Community,
>> >>> >>
>> >>> >> I want to create a url like this.
>> >>> >>
>> >>> >>
>> >>> >> http://localhost/cakephp/incomings/request/?msisdn=919871701375&opera...
>> >>> >>
>> >>> >> and i am accepting this request in my controller like below code and
>> >>> >> passing it to model for validation but it is not working in case i
>> >>> >> left any variable above blank like (

Re: Validation Question

2011-02-17 Thread Jeremy Burns | Class Outfit
Try something for me...

debug($this->Incoming->validates());

die(debug($this->Incoming->validationErrors));

...rather than checking for true or false.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 17 Feb 2011, at 11:40, Tapan Kumar Thapa wrote:

> Still not working. :-(
> 
> My Url: 
> http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI
> 
> My Controller:
> 
>  
> class IncomingsController extends AppController {
> 
> var $name = 'Incomings';
> 
> function request() {
> $this->Incoming->set(array(
> 'Incoming' => $this->params['named']
> ));
> //$this->Incoming->set($this->params['named']);
> if ($this->Incoming->validates()==TRUE) {
> $this->Session->setFlash("Correct");
> } else {
> $this->Session->setFlash("Incorrect");
> }
> }
> 
> }
> 
> ?>
> 
> My Model:
> 
>  
> class Incoming extends AppModel {
> 
> var $name = 'Incoming';
> var $validate = array(
> 'msisdn' => array(
> 'required' => true,
> 'allowEmpty' => false,
> 'rule' => 'numeric',
> 'message' => 'Please enter a valid msisdn',
> ));
> 
> }
> 
> ?>
> 
> Please suggest.
> 
> Regards
> Tapan Thapa
> India
> 
> On Thu, Feb 17, 2011 at 4:58 PM, John Andersen  
> wrote:
> When you are setting the model data using the set() method, then you
> should provide it with at standard structure, not just the value of
> the msisdn parameter.
> 
> [code example]
> $this->Incoming->set( array(
>   'Incoming' => $this->params['named']
> ) );
> [/code example]
> 
> Enjoy,
>   John
> 
> On 17 Feb., 12:09, Tapan Kumar Thapa 
> wrote:
> > I am dam got stuck here.
> >
> > Can some one suggest anything?
> >
> > BR
> > Tapan Thapa
> >
> > On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa <
> >
> >
> [snip]
> 
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Validation Question

2011-02-17 Thread Tapan Kumar Thapa
I want to validate user input in http get url before inserting into my
database table.

If user is not sending any data or sending invalid character data in my
named parameters then i want to use built in validation feature available in
cake php and throw different error message for each named parameters.

Please suggest.

Regards
Tapan Thapa

On Thu, Feb 17, 2011 at 5:09 PM, Jeremy Burns | Class Outfit <
jeremybu...@classoutfit.com> wrote:

> Why do you need to validate it? Is it not enough to just check the value?
>
> Jeremy Burns
> *Class Outfit*
> *
> *
> jeremybu...@classoutfit.com 
> http://www.classoutfit.com
>
> On 17 Feb 2011, at 11:33, Tapan Kumar Thapa wrote:
>
> Sorry to say but it is still not working.
>
> Url:
> http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI
>
> Incoming controller:
>
> 
> class IncomingsController extends AppController {
>
> var $name = 'Incomings';
>
> function request() {
> $this->Incoming->set($this->params['named']);
> if ($this->Incoming->validates()) {
> $this->Session->setFlash("Correct");
> } else {
> $this->Session->setFlash("Incorrect");
> }
> }
>
> }
>
> ?>
>
> Incoming Model:
>
> 
> class Incoming extends AppModel {
>
> var $name = 'Incoming';
> var $validate = array(
> 'msisdn' => array(
> 'required' => true,
> 'allowEmpty' => false,
> 'rule' => 'numeric',
> 'message' => 'Please enter a valid msisdn',
> ));
>
> }
>
> ?>
>
> Please suggest.
>
> Is validation only work for post request of is it also work for get request
> like above?
>
> Regards
> Tapan Thapa
> India
>
> On Thu, Feb 17, 2011 at 4:49 PM, Dr. Tarique Sani 
> wrote:
>
>> Try $this->Incoming->set($this->params['named']);
>>
>> Tarique
>>
>> On Thu, Feb 17, 2011 at 4:39 PM, Tapan Kumar Thapa
>>  wrote:
>> > I am dam got stuck here.
>> >
>> > Can some one suggest anything?
>> >
>> > BR
>> > Tapan Thapa
>> >
>> > On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa
>> >  wrote:
>> >>
>> >> Hello,
>> >>
>> >> Now i am trying like this.
>> >>
>> >>
>> >>
>> http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI
>> >>
>> >> but still validation from model class it not working. Please please
>> >> suggest.
>> >>
>> >> My Model:
>> >>
>> >> > >>
>> >> class Incoming extends AppModel {
>> >>
>> >> var $name = 'Incoming';
>> >> var $validate = array(
>> >> 'msisdn' => array(
>> >> 'required' => true,
>> >> 'allowEmpty' => false,
>> >> 'rule' => 'numeric',
>> >> 'message' => 'Please enter a valid msisdn',
>> >> ));
>> >>
>> >> }
>> >>
>> >> ?>
>> >>
>> >> My Controller:
>> >>
>> >> > >>
>> >> class IncomingsController extends AppController {
>> >>
>> >> var $name = 'Incomings';
>> >>
>> >> function request() {
>> >> $this->Incoming->set($this->params['named']['msisdn']);
>> >> if ($this->Incoming->validates()) {
>> >> $this->Session->setFlash("Correct");
>> >> } else {
>> >> $this->Session->setFlash("Incorrect");
>> >> }
>> >> }
>> >>
>> >> }
>> >>
>> >> ?>
>> >>
>> >> I am always going in Correct message if condition however i have not
>> given
>> >> any value in msisdn parameter.
>> >>
>> >> Please please suggest something. I am clue less. Is validation only
>> works
>> >> in case of post request from view?
>> >>
>> >> Regards
>> >> Tapan Thapa
>> >> India
>> >>
>> >>
>> >> On Thu, Feb 17, 2011 at 8:56 AM, Tapan Kumar Thapa
>> >>  wrote:
>> >>>
>> >>> I don't mind using URL like this but are you sure that validation will
>> >>> work like this?
>> >>>
>> >>> Regards
>> >>> Tapan Thapa
>> >>>
>> >>> Sent from my iPhone
>> >>>
>> >>> On Feb 16, 2011, at 11:36 PM, euromark 
>> >>> wrote:
>> >>>
>> >>> > you are mixing cake pretty urls and plain url style
>> >>> >
>> >>> > why not going with
>> >>> > /.../x:1/y:2/z:3
>> >>> > and using
>> >>> > $this->params[named]
>> >>> > ?
>> >>> >
>> >>> > if you don't mind my asking
>> >>> >
>> >>> >
>> >>> > On 16 Feb., 12:49, Tapan Thapa  wrote:
>> >>> >> Hello Community,
>> >>> >>
>> >>> >> I want to create a url like this.
>> >>> >>
>> >>> >>
>> >>> >>
>> http://localhost/cakephp/incomings/request/?msisdn=919871701375&opera...
>> >>> >>
>> >>> >> and i am accepting this request in my controller like below code
>> and
>> >>> >> passing it to model for validation but it is not working in case i
>> >>> >> left any variable above blank like (circle=) or (msisdn=)
>> >>> >>
>> >>> >> incomings_controller.php
>> >>> >>
>> >>> >> > >>> >> class IncomingsController extends AppController {
>> >>> >> var $name = 'Incomings';
>> >>> >> function request() {
>> >>> >> $this->Incoming->set($this->params['url']);
>> >>> >> $this->Incoming->validates();}
>> >>> >> }
>> >>> >>
>> >>> >> ?>
>> >>> >>
>> >>> >> incoming model:
>> >>> >>
>> >>> >> > >>> >> class

Re: Validation Question

2011-02-17 Thread Tapan Kumar Thapa
Still not working. :-(

My Url:
http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI

My Controller:

Incoming->set(array(
'Incoming' => $this->params['named']
));
//$this->Incoming->set($this->params['named']);
if ($this->Incoming->validates()==TRUE) {
$this->Session->setFlash("Correct");
} else {
$this->Session->setFlash("Incorrect");
}
}

}

?>

My Model:

 array(
'required' => true,
'allowEmpty' => false,
'rule' => 'numeric',
'message' => 'Please enter a valid msisdn',
));

}

?>

Please suggest.

Regards
Tapan Thapa
India

On Thu, Feb 17, 2011 at 4:58 PM, John Andersen wrote:

> When you are setting the model data using the set() method, then you
> should provide it with at standard structure, not just the value of
> the msisdn parameter.
>
> [code example]
> $this->Incoming->set( array(
>   'Incoming' => $this->params['named']
> ) );
> [/code example]
>
> Enjoy,
>   John
>
> On 17 Feb., 12:09, Tapan Kumar Thapa 
> wrote:
> > I am dam got stuck here.
> >
> > Can some one suggest anything?
> >
> > BR
> > Tapan Thapa
> >
> > On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa <
> >
> >
> [snip]
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Validation Question

2011-02-17 Thread Jeremy Burns | Class Outfit
Why do you need to validate it? Is it not enough to just check the value?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 17 Feb 2011, at 11:33, Tapan Kumar Thapa wrote:

> Sorry to say but it is still not working.
> 
> Url: 
> http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI
> 
> Incoming controller:
> 
>  
> class IncomingsController extends AppController {
> 
> var $name = 'Incomings';
> 
> function request() {
> $this->Incoming->set($this->params['named']);
> if ($this->Incoming->validates()) {
> $this->Session->setFlash("Correct");
> } else {
> $this->Session->setFlash("Incorrect");
> }
> }
> 
> }
> 
> ?>
> 
> Incoming Model:
> 
>  
> class Incoming extends AppModel {
> 
> var $name = 'Incoming';
> var $validate = array(
> 'msisdn' => array(
> 'required' => true,
> 'allowEmpty' => false,
> 'rule' => 'numeric',
> 'message' => 'Please enter a valid msisdn',
> ));
> 
> }
> 
> ?>
> 
> Please suggest.
> 
> Is validation only work for post request of is it also work for get request 
> like above?
> 
> Regards
> Tapan Thapa 
> India
> 
> On Thu, Feb 17, 2011 at 4:49 PM, Dr. Tarique Sani  
> wrote:
> Try $this->Incoming->set($this->params['named']);
> 
> Tarique
> 
> On Thu, Feb 17, 2011 at 4:39 PM, Tapan Kumar Thapa
>  wrote:
> > I am dam got stuck here.
> >
> > Can some one suggest anything?
> >
> > BR
> > Tapan Thapa
> >
> > On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa
> >  wrote:
> >>
> >> Hello,
> >>
> >> Now i am trying like this.
> >>
> >>
> >> http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI
> >>
> >> but still validation from model class it not working. Please please
> >> suggest.
> >>
> >> My Model:
> >>
> >>  >>
> >> class Incoming extends AppModel {
> >>
> >> var $name = 'Incoming';
> >> var $validate = array(
> >> 'msisdn' => array(
> >> 'required' => true,
> >> 'allowEmpty' => false,
> >> 'rule' => 'numeric',
> >> 'message' => 'Please enter a valid msisdn',
> >> ));
> >>
> >> }
> >>
> >> ?>
> >>
> >> My Controller:
> >>
> >>  >>
> >> class IncomingsController extends AppController {
> >>
> >> var $name = 'Incomings';
> >>
> >> function request() {
> >> $this->Incoming->set($this->params['named']['msisdn']);
> >> if ($this->Incoming->validates()) {
> >> $this->Session->setFlash("Correct");
> >> } else {
> >> $this->Session->setFlash("Incorrect");
> >> }
> >> }
> >>
> >> }
> >>
> >> ?>
> >>
> >> I am always going in Correct message if condition however i have not given
> >> any value in msisdn parameter.
> >>
> >> Please please suggest something. I am clue less. Is validation only works
> >> in case of post request from view?
> >>
> >> Regards
> >> Tapan Thapa
> >> India
> >>
> >>
> >> On Thu, Feb 17, 2011 at 8:56 AM, Tapan Kumar Thapa
> >>  wrote:
> >>>
> >>> I don't mind using URL like this but are you sure that validation will
> >>> work like this?
> >>>
> >>> Regards
> >>> Tapan Thapa
> >>>
> >>> Sent from my iPhone
> >>>
> >>> On Feb 16, 2011, at 11:36 PM, euromark 
> >>> wrote:
> >>>
> >>> > you are mixing cake pretty urls and plain url style
> >>> >
> >>> > why not going with
> >>> > /.../x:1/y:2/z:3
> >>> > and using
> >>> > $this->params[named]
> >>> > ?
> >>> >
> >>> > if you don't mind my asking
> >>> >
> >>> >
> >>> > On 16 Feb., 12:49, Tapan Thapa  wrote:
> >>> >> Hello Community,
> >>> >>
> >>> >> I want to create a url like this.
> >>> >>
> >>> >>
> >>> >> http://localhost/cakephp/incomings/request/?msisdn=919871701375&opera...
> >>> >>
> >>> >> and i am accepting this request in my controller like below code and
> >>> >> passing it to model for validation but it is not working in case i
> >>> >> left any variable above blank like (circle=) or (msisdn=)
> >>> >>
> >>> >> incomings_controller.php
> >>> >>
> >>> >>  >>> >> class IncomingsController extends AppController {
> >>> >> var $name = 'Incomings';
> >>> >> function request() {
> >>> >> $this->Incoming->set($this->params['url']);
> >>> >> $this->Incoming->validates();}
> >>> >> }
> >>> >>
> >>> >> ?>
> >>> >>
> >>> >> incoming model:
> >>> >>
> >>> >>  >>> >> class Incoming extends AppModel {
> >>> >> var $name = 'Incoming';
> >>> >> var $validate = array(
> >>> >> 'msisdn' => array(
> >>> >> 'rule' => 'notEmpty',
> >>> >> 'required' => true,
> >>> >> 'message' => 'Please enter a valid msisdn',
> >>> >> 'last' => true
> >>> >> ),
> >>> >> 'operator' => array(
> >>> >> 'rule' => 'notEmpty',
> >>> >> 'required' => true,
> >>> >> 'message' => 'Please enter a valid operator',
> >>> >> 'last' => true
> >>> >> ),
> >>> >> 'circle' => array(
> >>> >> 'rule' => 'notEmpty',
> >>> >> 'required' => true,
> >>> >> 'message' => 'Please enter a valid ci

Re: Validation Question

2011-02-17 Thread Tapan Kumar Thapa
Sorry to say but it is still not working.

Url:
http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI

Incoming controller:

Incoming->set($this->params['named']);
if ($this->Incoming->validates()) {
$this->Session->setFlash("Correct");
} else {
$this->Session->setFlash("Incorrect");
}
}

}

?>

Incoming Model:

 array(
'required' => true,
'allowEmpty' => false,
'rule' => 'numeric',
'message' => 'Please enter a valid msisdn',
));

}

?>

Please suggest.

Is validation only work for post request of is it also work for get request
like above?

Regards
Tapan Thapa
India

On Thu, Feb 17, 2011 at 4:49 PM, Dr. Tarique Sani wrote:

> Try $this->Incoming->set($this->params['named']);
>
> Tarique
>
> On Thu, Feb 17, 2011 at 4:39 PM, Tapan Kumar Thapa
>  wrote:
> > I am dam got stuck here.
> >
> > Can some one suggest anything?
> >
> > BR
> > Tapan Thapa
> >
> > On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa
> >  wrote:
> >>
> >> Hello,
> >>
> >> Now i am trying like this.
> >>
> >>
> >>
> http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI
> >>
> >> but still validation from model class it not working. Please please
> >> suggest.
> >>
> >> My Model:
> >>
> >>  >>
> >> class Incoming extends AppModel {
> >>
> >> var $name = 'Incoming';
> >> var $validate = array(
> >> 'msisdn' => array(
> >> 'required' => true,
> >> 'allowEmpty' => false,
> >> 'rule' => 'numeric',
> >> 'message' => 'Please enter a valid msisdn',
> >> ));
> >>
> >> }
> >>
> >> ?>
> >>
> >> My Controller:
> >>
> >>  >>
> >> class IncomingsController extends AppController {
> >>
> >> var $name = 'Incomings';
> >>
> >> function request() {
> >> $this->Incoming->set($this->params['named']['msisdn']);
> >> if ($this->Incoming->validates()) {
> >> $this->Session->setFlash("Correct");
> >> } else {
> >> $this->Session->setFlash("Incorrect");
> >> }
> >> }
> >>
> >> }
> >>
> >> ?>
> >>
> >> I am always going in Correct message if condition however i have not
> given
> >> any value in msisdn parameter.
> >>
> >> Please please suggest something. I am clue less. Is validation only
> works
> >> in case of post request from view?
> >>
> >> Regards
> >> Tapan Thapa
> >> India
> >>
> >>
> >> On Thu, Feb 17, 2011 at 8:56 AM, Tapan Kumar Thapa
> >>  wrote:
> >>>
> >>> I don't mind using URL like this but are you sure that validation will
> >>> work like this?
> >>>
> >>> Regards
> >>> Tapan Thapa
> >>>
> >>> Sent from my iPhone
> >>>
> >>> On Feb 16, 2011, at 11:36 PM, euromark 
> >>> wrote:
> >>>
> >>> > you are mixing cake pretty urls and plain url style
> >>> >
> >>> > why not going with
> >>> > /.../x:1/y:2/z:3
> >>> > and using
> >>> > $this->params[named]
> >>> > ?
> >>> >
> >>> > if you don't mind my asking
> >>> >
> >>> >
> >>> > On 16 Feb., 12:49, Tapan Thapa  wrote:
> >>> >> Hello Community,
> >>> >>
> >>> >> I want to create a url like this.
> >>> >>
> >>> >>
> >>> >>
> http://localhost/cakephp/incomings/request/?msisdn=919871701375&opera...
> >>> >>
> >>> >> and i am accepting this request in my controller like below code and
> >>> >> passing it to model for validation but it is not working in case i
> >>> >> left any variable above blank like (circle=) or (msisdn=)
> >>> >>
> >>> >> incomings_controller.php
> >>> >>
> >>> >>  >>> >> class IncomingsController extends AppController {
> >>> >> var $name = 'Incomings';
> >>> >> function request() {
> >>> >> $this->Incoming->set($this->params['url']);
> >>> >> $this->Incoming->validates();}
> >>> >> }
> >>> >>
> >>> >> ?>
> >>> >>
> >>> >> incoming model:
> >>> >>
> >>> >>  >>> >> class Incoming extends AppModel {
> >>> >> var $name = 'Incoming';
> >>> >> var $validate = array(
> >>> >> 'msisdn' => array(
> >>> >> 'rule' => 'notEmpty',
> >>> >> 'required' => true,
> >>> >> 'message' => 'Please enter a valid msisdn',
> >>> >> 'last' => true
> >>> >> ),
> >>> >> 'operator' => array(
> >>> >> 'rule' => 'notEmpty',
> >>> >> 'required' => true,
> >>> >> 'message' => 'Please enter a valid operator',
> >>> >> 'last' => true
> >>> >> ),
> >>> >> 'circle' => array(
> >>> >> 'rule' => 'notEmpty',
> >>> >> 'required' => true,
> >>> >> 'message' => 'Please enter a valid circle',
> >>> >> 'last' => true
> >>> >> )
> >>> >> );
> >>> >>
> >>> >> }
> >>> >>
> >>> >> ?>
> >>> >>
> >>> >> Please suggest.
> >>> >>
> >>> >> Regards
> >>> >> Tapan Thapa
> >>> >> India
> >>> >> tapan.th...@yahoo.com
> >>> >
> >>> > --
> >>> > Our newest site for the community: CakePHP Video Tutorials
> >>> > http://tv.cakephp.org
> >>> > Check out the new CakePHP Questions site http://ask.cakephp.org and
> >>> > help others with their CakePHP related questions.
> >>> >
> >>> >
> >>> > To unsubscribe from this group, send email to
> >>> > cake-php

Re: Validation Question

2011-02-17 Thread John Andersen
When you are setting the model data using the set() method, then you
should provide it with at standard structure, not just the value of
the msisdn parameter.

[code example]
$this->Incoming->set( array(
   'Incoming' => $this->params['named']
) );
[/code example]

Enjoy,
   John

On 17 Feb., 12:09, Tapan Kumar Thapa 
wrote:
> I am dam got stuck here.
>
> Can some one suggest anything?
>
> BR
> Tapan Thapa
>
> On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa <
>
>
[snip]

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Validation Question

2011-02-17 Thread Dr. Tarique Sani
Try $this->Incoming->set($this->params['named']);

Tarique

On Thu, Feb 17, 2011 at 4:39 PM, Tapan Kumar Thapa
 wrote:
> I am dam got stuck here.
>
> Can some one suggest anything?
>
> BR
> Tapan Thapa
>
> On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa
>  wrote:
>>
>> Hello,
>>
>> Now i am trying like this.
>>
>>
>> http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI
>>
>> but still validation from model class it not working. Please please
>> suggest.
>>
>> My Model:
>>
>> >
>> class Incoming extends AppModel {
>>
>>     var $name = 'Incoming';
>>     var $validate = array(
>>     'msisdn' => array(
>>     'required' => true,
>>     'allowEmpty' => false,
>>     'rule' => 'numeric',
>>     'message' => 'Please enter a valid msisdn',
>>     ));
>>
>> }
>>
>> ?>
>>
>> My Controller:
>>
>> >
>> class IncomingsController extends AppController {
>>
>>     var $name = 'Incomings';
>>
>>     function request() {
>>     $this->Incoming->set($this->params['named']['msisdn']);
>>     if ($this->Incoming->validates()) {
>>     $this->Session->setFlash("Correct");
>>     } else {
>>     $this->Session->setFlash("Incorrect");
>>     }
>>     }
>>
>> }
>>
>> ?>
>>
>> I am always going in Correct message if condition however i have not given
>> any value in msisdn parameter.
>>
>> Please please suggest something. I am clue less. Is validation only works
>> in case of post request from view?
>>
>> Regards
>> Tapan Thapa
>> India
>>
>>
>> On Thu, Feb 17, 2011 at 8:56 AM, Tapan Kumar Thapa
>>  wrote:
>>>
>>> I don't mind using URL like this but are you sure that validation will
>>> work like this?
>>>
>>> Regards
>>> Tapan Thapa
>>>
>>> Sent from my iPhone
>>>
>>> On Feb 16, 2011, at 11:36 PM, euromark 
>>> wrote:
>>>
>>> > you are mixing cake pretty urls and plain url style
>>> >
>>> > why not going with
>>> > /.../x:1/y:2/z:3
>>> > and using
>>> > $this->params[named]
>>> > ?
>>> >
>>> > if you don't mind my asking
>>> >
>>> >
>>> > On 16 Feb., 12:49, Tapan Thapa  wrote:
>>> >> Hello Community,
>>> >>
>>> >> I want to create a url like this.
>>> >>
>>> >>
>>> >> http://localhost/cakephp/incomings/request/?msisdn=919871701375&opera...
>>> >>
>>> >> and i am accepting this request in my controller like below code and
>>> >> passing it to model for validation but it is not working in case i
>>> >> left any variable above blank like (circle=) or (msisdn=)
>>> >>
>>> >> incomings_controller.php
>>> >>
>>> >> >> >> class IncomingsController extends AppController {
>>> >> var $name = 'Incomings';
>>> >> function request() {
>>> >> $this->Incoming->set($this->params['url']);
>>> >> $this->Incoming->validates();}
>>> >> }
>>> >>
>>> >> ?>
>>> >>
>>> >> incoming model:
>>> >>
>>> >> >> >> class Incoming extends AppModel {
>>> >> var $name = 'Incoming';
>>> >> var $validate = array(
>>> >> 'msisdn' => array(
>>> >> 'rule' => 'notEmpty',
>>> >> 'required' => true,
>>> >> 'message' => 'Please enter a valid msisdn',
>>> >> 'last' => true
>>> >> ),
>>> >> 'operator' => array(
>>> >> 'rule' => 'notEmpty',
>>> >> 'required' => true,
>>> >> 'message' => 'Please enter a valid operator',
>>> >> 'last' => true
>>> >> ),
>>> >> 'circle' => array(
>>> >> 'rule' => 'notEmpty',
>>> >> 'required' => true,
>>> >> 'message' => 'Please enter a valid circle',
>>> >> 'last' => true
>>> >> )
>>> >> );
>>> >>
>>> >> }
>>> >>
>>> >> ?>
>>> >>
>>> >> Please suggest.
>>> >>
>>> >> Regards
>>> >> Tapan Thapa
>>> >> India
>>> >> tapan.th...@yahoo.com
>>> >
>>> > --
>>> > Our newest site for the community: CakePHP Video Tutorials
>>> > http://tv.cakephp.org
>>> > Check out the new CakePHP Questions site http://ask.cakephp.org and
>>> > help others with their CakePHP related questions.
>>> >
>>> >
>>> > To unsubscribe from this group, send email to
>>> > cake-php+unsubscr...@googlegroups.com For more options, visit this
>>> > group at http://groups.google.com/group/cake-php
>>
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php
>



-- 
=
PHP for E-Biz: http://sanisoft.com
=

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Validation Question

2011-02-17 Thread Tapan Kumar Thapa
I am dam got stuck here.

Can some one suggest anything?

BR
Tapan Thapa

On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa <
tapan.th...@hindustantimes.com> wrote:

> Hello,
>
> Now i am trying like this.
>
>
> http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI
>
> but still validation from model class it not working. Please please
> suggest.
>
> My Model:
>
>
> 
> class Incoming extends AppModel {
>
> var $name = 'Incoming';
> var $validate = array(
> 'msisdn' => array(
> 'required' => true,
> 'allowEmpty' => false,
> 'rule' => 'numeric',
>
> 'message' => 'Please enter a valid msisdn',
> ));
>
> }
>
> ?>
>
> My Controller:
>
>
> 
> class IncomingsController extends AppController {
>
> var $name = 'Incomings';
>
> function request() {
> $this->Incoming->set($this->params['named']['msisdn']);
> if ($this->Incoming->validates()) {
> $this->Session->setFlash("Correct");
> } else {
> $this->Session->setFlash("Incorrect");
> }
> }
>
> }
>
> ?>
>
> I am always going in Correct message if condition however i have not given
> any value in msisdn parameter.
>
> *Please please suggest something. I am clue less. Is validation only works
> in case of post request from view?*
>
> Regards
> Tapan Thapa
> India
>
>
>
> On Thu, Feb 17, 2011 at 8:56 AM, Tapan Kumar Thapa <
> tapan.thapa2...@gmail.com> wrote:
>
>> I don't mind using URL like this but are you sure that validation will
>> work like this?
>>
>> Regards
>> Tapan Thapa
>>
>> Sent from my iPhone
>>
>> On Feb 16, 2011, at 11:36 PM, euromark 
>> wrote:
>>
>> > you are mixing cake pretty urls and plain url style
>> >
>> > why not going with
>> > /.../x:1/y:2/z:3
>> > and using
>> > $this->params[named]
>> > ?
>> >
>> > if you don't mind my asking
>> >
>> >
>> > On 16 Feb., 12:49, Tapan Thapa  wrote:
>> >> Hello Community,
>> >>
>> >> I want to create a url like this.
>> >>
>> >> http://localhost/cakephp/incomings/request/?msisdn=919871701375&opera.
>> ..
>> >>
>> >> and i am accepting this request in my controller like below code and
>> >> passing it to model for validation but it is not working in case i
>> >> left any variable above blank like (circle=) or (msisdn=)
>> >>
>> >> incomings_controller.php
>> >>
>> >> > >> class IncomingsController extends AppController {
>> >> var $name = 'Incomings';
>> >> function request() {
>> >> $this->Incoming->set($this->params['url']);
>> >> $this->Incoming->validates();}
>> >> }
>> >>
>> >> ?>
>> >>
>> >> incoming model:
>> >>
>> >> > >> class Incoming extends AppModel {
>> >> var $name = 'Incoming';
>> >> var $validate = array(
>> >> 'msisdn' => array(
>> >> 'rule' => 'notEmpty',
>> >> 'required' => true,
>> >> 'message' => 'Please enter a valid msisdn',
>> >> 'last' => true
>> >> ),
>> >> 'operator' => array(
>> >> 'rule' => 'notEmpty',
>> >> 'required' => true,
>> >> 'message' => 'Please enter a valid operator',
>> >> 'last' => true
>> >> ),
>> >> 'circle' => array(
>> >> 'rule' => 'notEmpty',
>> >> 'required' => true,
>> >> 'message' => 'Please enter a valid circle',
>> >> 'last' => true
>> >> )
>> >> );
>> >>
>> >> }
>> >>
>> >> ?>
>> >>
>> >> Please suggest.
>> >>
>> >> Regards
>> >> Tapan Thapa
>> >> India
>> >> tapan.th...@yahoo.com
>> >
>> > --
>> > Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> > Check out the new CakePHP Questions site http://ask.cakephp.org and
>> help others with their CakePHP related questions.
>> >
>> >
>> > To unsubscribe from this group, send email to
>> > cake-php+unsubscr...@googlegroups.com For more options, visit this
>> group at http://groups.google.com/group/cake-php
>>
>
>

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Problem with "loadModel" and "afterSave"

2011-02-17 Thread pablosky
Hello.

I have a controller that using another model . And save some data:

$this->loadModel('Setting');
$this->Setting->saveAll($settings['Settings']['Setting']);


The model is this:

class Setting extends SettingsAppModel {
var $name = 'Setting';

function afterSave()
{
Cache::delete('settings');
Cache::delete('settings_menu');
}
}

The problem is not running afterSave when you load the model using
loadModel.

Any ideas?

Thanks

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Create when not existing.

2011-02-17 Thread Dwayne Hanekamp
Thanks for both answers! I've rewritten it and because the website
needs to be online next week i'll start moving the code to the model
when its finished. Cause in my believe thats where the validation
should be.

Dwayne

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php