HtmlHelper does not like multiple URL parameters?

2010-01-27 Thread Johnny Cupcake
My code (Cake 1.2.5):
echo $html->url( array(
   'controller' => 'users',
   'action' => 'activate',
   '?' => array('e' => 'EMAIL', 'c' => 'CODE')), TRUE );

The output:
http://localhost/index.php/users/activate?e=EMAIL&c=CODE

This output is wrong, right?  Should be:
http://localhost/index.php/users/activate?e=EMAIL&c=CODE

Workarounds?  Must I use slashes as argument delimiters, or just build
the URL myself?

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

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


Re: Avoid multiple form submission

2010-01-27 Thread aveev

Ok, thanks for the replies, I'll try them..


Miles J wrote:
> 
> You can enable the Security component, which does the session and bot
> validation automatically.
> 
> Secondly, after a post is done, you can unset the data so that the
> form is empty. unset($this->data['Model']);
> 
> Thirdly, you can have the page just redirect somewhere else.
> 
> On Jan 27, 5:24 pm, euromark  wrote:
>> by the way
>> i just tried this snippet
>>
>> $("form input.submit").bind("dblclick", function(e){
>>     e.preventDefault();
>>     return false;
>>
>> });
>>
>> and it works quite well for prevention of any double (or multiple)
>> clicks :)
>>
>> On 28 Jan., 02:10, euromark  wrote:
>>
>> > maybe some js disabling after clicking the submit button like
>> inhttp://www.norio.be/blog/2008/09/using-jquery-prevent-multiple-form-s...
>>
>> > but i guess this can get problematic if the connection gets aborted or
>> > user cancels manually
>> > he would then have to reload or hit F5 - some users might not know
>> > that and the form data could get lost because they wont be able to
>> > submit anymore
>>
>> > or use a timeout - like 2 seconds - most of the multiple submission
>> > happens due to a double click on the button (by accident or not)
>>
>> > after all, it does make sense to check on already submitted data in
>> > PHP again
>> > this will work even it js is disabled - read the last inserted record
>> > and compare it to the current one
>> > if they match, its obviously a double post
>>
>> > On 28 Jan., 01:55, aveev  wrote:
>>
>> > > How can I avoid multiple form submission ??
>> > > I know that this topic has been discussed in other forums.
>> > > When a user submits a form, how can we prevent the user to submit the
>> form
>> > > again and again ?
>> > > I read some threads in other forums. They use a session variable
>> (writing a
>> > > value to a session variable when the user submits the form and check
>> whether
>> > > this value exists upon next form submission)
>> > > Does cake have a built-in way to avoid multiple form submission ?
>> > > What's the best way to avoid multiple form submission ??
>> > > Thanks
>>
>> > > I use cakephp 1.2
>>
>> > > --
>> > > View this message in
>> context:http://old.nabble.com/Avoid-multiple-form-submission-tp27349363p27349...
>> > > Sent from the CakePHP mailing list archive at Nabble.com.
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php?hl=en
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Avoid-multiple-form-submission-tp27349363p27351899.html
Sent from the CakePHP mailing list archive at Nabble.com.

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

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


Re: now Using Session on my model

2010-01-27 Thread the_guru
@Jamie,

Its not wrong , its just not best practice and fall out of palce for
MVC design pattern i guess.




On Jan 26, 3:45 am, Jamie  wrote:
> You don't need to import a component, especially since components are
> for controllers. You can just do this in your Cart model:
>
> public $session = null;
>
> function __construct($id = false, $table = null, $ds = null) {
>         parent::__construct($id, $table, $ds);
>         App::import('Core', 'CakeSession');
>         $this->session = new CakeSession();
>
> }
>
> All the SessionComponent does is provide a controller-level wrapper
> for the CakeSession class. I don't see anything wrong with importing
> CakeSession itself right into your model.
>
> You can still do all of the regular session functions:
>
> $this->session->read
> $this->session->delete
> $this->session->write
>
> etc.
>
> - Jamie
>
> On Jan 20, 12:40 am, the_guru  wrote:
>
> > Hello Every body i am now using Session component on my Cart model
>
> > I have Cart Model which does not extends from AppModel
>
> > Now here is the code that i am using to access Session properties
>
> > class Cart
> > {
> >         public $Session = null;
>
> >         public function __construct(){
> >                 App::import('Component', 'SessionComponent');
> >                 $this->Session = new SessionComponent;
> >         }
>
> >         public function add($id){
>
> >         }
>
> >         public function remove($id)
> >         {
>
> >         }
>
> > }
>
> > ?>

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

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


Re: Thoughs about naming conflict between model and component

2010-01-27 Thread ecommy.com
I have not tried it but isn't the Miles idea the best option?  it's
the simplest and other solutions stated here are just unuseful,
complicating things when not needed

On 28 ian., 05:08, Marcelo Andrade  wrote:
> On Mon, Jan 25, 2010 at 10:50 AM, Chad Smith  wrote:
> > (..)
>
> I'm not 100% sure and cannot try for now, but doesn't this work?
>
>  class PostsController extends AppController {
>    var $uses = array('EmailModel'=> 'Email');
>    var $components = array('EmailComponent'=> 'Email');
>    var $helpers = array('MyForm'=> 'Form');
> // ...
>
> }
>
> Best regards.
>
> --
> MARCELO F ANDRADE
> Belem, Amazonia, Brazil
>
> "I took the red pill"

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

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


Re: looking for developer (Were based in Cleveland, Ohio)

2010-01-27 Thread ecommy.com
what kind of project do you want? what's the proposed reward to the
coder? part of the business / flat fee per project?

On 28 ian., 04:31, stefano  wrote:
> Andrew
>
> tell me about the project iam from Chile
>
> S
>
>
>
> On Wednesday, January 27, 2010, Andrew  wrote:
> > Hi Guys!
>
> > I am looking for a developer. I have a small project might take a few
> > weeks. I am looking for someone who wants to donate some time to a
> > small startup. You can be anywhere in the world. The company is not
> > looking to become the next Google. We simply want to make the world a
> > little better.
>
> > --
> > Andrew
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com for more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> --
> Stefano Salvatori M.http://stefano.salvatori.cl/

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

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


RE: Best approach for Pages

2010-01-27 Thread Dave
I found this but every url takes me to pages now...

http://paulherron.net/articles/view/managing_simple_pages_in_cakephp

Routes:
App::import('model', 'Page');
$Page = new Page();
$pages = $Page->find('list', array('fields' => array('id',
'title')));

//debug($pages);
Router::connect('/:page/*', array('controller' => 'pages'),
array('page' => implode($pages, '|')));


Pages controller
function index() {
if (!$id) {
$this->Session->setFlash(__('Invalid Page.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('page', $this->Page->read(null, $id));
}

Any ideas where I am going wrong?

Rhanks

Dave 

-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of Jeremy Burns
Sent: January-28-10 2:44 AM
To: cake-php@googlegroups.com
Subject: Re: Best approach for Pages

I built an 'about' controller with a function for each page, then used
routing to remove the 'about' part from the url.


Jeremy Burns


On 28 Jan 2010, at 06:10, Dave wrote:


I have to build a simple site, 5 pages but the tricky part seems to
be the pages are index, about us, info, history and contact us so the urls
need to be reflected by that (site/about_us site/contact) and the only
thing on these pages will be text. Admin logs in and using wysiwyg editor
can update the content for these pages. I do not want to build 5 controllers
since everything can be done with 1 "pages" controller. So my question is
how can this be done and if using 1 controller what would you name this
controller since "pages" is the obvious choice but that's set aside for
stoic pages and can you set routes for the text urls using 1 controller?
 
Any ideas / suggestions would be great.
 
Thanks,
 
Dave

Check out the new CakePHP Questions site http://cakeqs.org
  and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google
Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this
group at http://groups.google.com/group/cake-php?hl=en



Check out the new CakePHP Questions site http://cakeqs.org and help others
with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com To
unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group 
cake-php+at http://groups.google.com/group/cake-php?hl=en


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

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


Re: Best approach for Pages

2010-01-27 Thread Jeremy Burns
I built an 'about' controller with a function for each page, then used routing 
to remove the 'about' part from the url.

Jeremy Burns

On 28 Jan 2010, at 06:10, Dave wrote:

> I have to build a simple site, 5 pages but the tricky part seems to be the 
> pages are index, about us, info, history and contact us so the urls need to 
> be reflected by that (site/about_us site/contact) and the only thing on 
> these pages will be text. Admin logs in and using wysiwyg editor can update 
> the content for these pages. I do not want to build 5 controllers since 
> everything can be done with 1 "pages" controller. So my question is how can 
> this be done and if using 1 controller what would you name this controller 
> since "pages" is the obvious choice but that's set aside for stoic pages and 
> can you set routes for the text urls using 1 controller?
>  
> Any ideas / suggestions would be great.
>  
> Thanks,
>  
> Dave
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>  
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

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

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


Best approach for Pages

2010-01-27 Thread Dave
I have to build a simple site, 5 pages but the tricky part seems to be the
pages are index, about us, info, history and contact us so the urls need to
be reflected by that (site/about_us site/contact) and the only thing on
these pages will be text. Admin logs in and using wysiwyg editor can update
the content for these pages. I do not want to build 5 controllers since
everything can be done with 1 "pages" controller. So my question is how can
this be done and if using 1 controller what would you name this controller
since "pages" is the obvious choice but that's set aside for stoic pages and
can you set routes for the text urls using 1 controller?
 
Any ideas / suggestions would be great.
 
Thanks,
 
Dave

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

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


Dynamic redirecting ... stumped!

2010-01-27 Thread John R
(This is more of an overall programming / PHP question than Cake ..
but it will ultimately be built in Cake, and this community kicks ass
so I figured I would throw it out there)

Hello everyone. Here is the challenge I am working on:

I want to build a system that would allow you to control the redirect
location of one domain, via a front-end interface of another domain,
dynamically.

Example:

I own www.secondarydomain.com, which is going to point to different
places every so often.

I want to build an app on www.maindomain.com that would have an
interface that allows you to change where www.fakedomain.com points.

I want to also dynamically be able to dictate that 
www.secondarydomain.com/newtarget
goes somewhere different.

It seems to me, that there would be a way to set the DNS in
secondarydomain's registrar to maindomain.com's server, and then
maindomain.com would read the URL, checks it against a database, and
redirects it accordingly. I guess the struggle I can't figure out is
the connection between pointing a DNS at maindomain and allowing it to
redirect it.

Hope that wasn't too confusing. Any help is much appreciated!

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

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


Re: 600+ models issue

2010-01-27 Thread Miles J
No it doesnt really. I just uses the AppModel in its place.

On Jan 27, 5:47 pm, Jon Bennett  wrote:
> > Im guessing its just a lot of HABTM tables. If so, you don't need
> > models for those unless it has specific functionality.
>
> Cake still creates a model class per join though I think, so you still
> use up memory even though there's no physical file to load.
>
> jb
>
> --
> jon bennett -www.jben.net- blog.jben.net

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

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


Re: Thoughs about naming conflict between model and component

2010-01-27 Thread Marcelo Andrade
On Mon, Jan 25, 2010 at 10:50 AM, Chad Smith  wrote:
> (..)

I'm not 100% sure and cannot try for now, but doesn't this work?

 'Email');
   var $components = array('EmailComponent'=> 'Email');
   var $helpers = array('MyForm'=> 'Form');
// ...
}

Best regards.

-- 
MARCELO F ANDRADE
Belem, Amazonia, Brazil

"I took the red pill"

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

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


Re: looking for developer (Were based in Cleveland, Ohio)

2010-01-27 Thread stefano
Andrew

tell me about the project iam from Chile


S
On Wednesday, January 27, 2010, Andrew  wrote:
> Hi Guys!
>
> I am looking for a developer. I have a small project might take a few
> weeks. I am looking for someone who wants to donate some time to a
> small startup. You can be anywhere in the world. The company is not
> looking to become the next Google. We simply want to make the world a
> little better.
>
> --
> Andrew
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com for more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

-- 
Stefano Salvatori M.
http://stefano.salvatori.cl/

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

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


Re: 600+ models issue

2010-01-27 Thread Jon Bennett
> Im guessing its just a lot of HABTM tables. If so, you don't need
> models for those unless it has specific functionality.

Cake still creates a model class per join though I think, so you still
use up memory even though there's no physical file to load.

jb



-- 
jon bennett - www.jben.net - blog.jben.net

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

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


Re: Avoid multiple form submission

2010-01-27 Thread Miles J
You can enable the Security component, which does the session and bot
validation automatically.

Secondly, after a post is done, you can unset the data so that the
form is empty. unset($this->data['Model']);

Thirdly, you can have the page just redirect somewhere else.

On Jan 27, 5:24 pm, euromark  wrote:
> by the way
> i just tried this snippet
>
> $("form input.submit").bind("dblclick", function(e){
>     e.preventDefault();
>     return false;
>
> });
>
> and it works quite well for prevention of any double (or multiple)
> clicks :)
>
> On 28 Jan., 02:10, euromark  wrote:
>
> > maybe some js disabling after clicking the submit button like 
> > inhttp://www.norio.be/blog/2008/09/using-jquery-prevent-multiple-form-s...
>
> > but i guess this can get problematic if the connection gets aborted or
> > user cancels manually
> > he would then have to reload or hit F5 - some users might not know
> > that and the form data could get lost because they wont be able to
> > submit anymore
>
> > or use a timeout - like 2 seconds - most of the multiple submission
> > happens due to a double click on the button (by accident or not)
>
> > after all, it does make sense to check on already submitted data in
> > PHP again
> > this will work even it js is disabled - read the last inserted record
> > and compare it to the current one
> > if they match, its obviously a double post
>
> > On 28 Jan., 01:55, aveev  wrote:
>
> > > How can I avoid multiple form submission ??
> > > I know that this topic has been discussed in other forums.
> > > When a user submits a form, how can we prevent the user to submit the form
> > > again and again ?
> > > I read some threads in other forums. They use a session variable (writing 
> > > a
> > > value to a session variable when the user submits the form and check 
> > > whether
> > > this value exists upon next form submission)
> > > Does cake have a built-in way to avoid multiple form submission ?
> > > What's the best way to avoid multiple form submission ??
> > > Thanks
>
> > > I use cakephp 1.2
>
> > > --
> > > View this message in 
> > > context:http://old.nabble.com/Avoid-multiple-form-submission-tp27349363p27349...
> > > Sent from the CakePHP mailing list archive at Nabble.com.

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

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


Re: 600+ models issue

2010-01-27 Thread Miles J
May I ask what type of site? Ive worked on large projects before and
never got over 600.

Im guessing its just a lot of HABTM tables. If so, you don't need
models for those unless it has specific functionality.

On Jan 27, 4:53 pm, tiberium911  wrote:
> No 600 is not extreme. We have over 600, all necessary, over about 7
> database servers. Thanks for the link, helped quite a bit. Still need
> to find some more speed improvements, but most of that will probably
> be more caching.
>
> On Jan 27, 7:36 pm, Miles J  wrote:
>
> > Forgot to say, use a lazy loader.
>
> >http://github.com/mcurry/lazy_loader
>
> > On Jan 27, 4:34 pm, Miles J  wrote:
>
> > > Does your site really have 600 database tables? That's a bit extreme
> > > don't you think.
>
> > > On Jan 27, 2:13 pm, tiberium911  wrote:
>
> > > > Can cake handle a website with 600+ connected models? Right now the
> > > > site takes 7-10 seconds as soon as cake initializes any model. I
> > > > looked through the cake code, and it appears that cake initializes all
> > > > 600+ models on any model initialization.

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

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


Re: which is the actual ACL used today?

2010-01-27 Thread Sam Sherlock
Have you tried Mark Story's two part tutorial
http://mark-story.com/nodes/view/auth-and-acl-an-end-to-end-tutorial-pt-1
- S



2010/1/27 Alejo 

> Hi!
> I want to use some ACL in CakePHP, but I´ve tried with : Authake
> ( http://conseil-recherche-innovation.net/authake ) and with PHPGacl
> http://dev.sypad.com/installing-phpgacl-plugin-cakephp but this was
> imposible to install with Cakephp 1.2.5 version.
>
> Can you help me with some ideas to use ACL in Cakephp ? I´m a novice
> with this framework.
> I need to control users, groups and permissions.
>
> Thanks for your time, God bless to you.
>
> Alejo
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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

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


Re: Avoid multiple form submission

2010-01-27 Thread euromark
by the way
i just tried this snippet

$("form input.submit").bind("dblclick", function(e){
e.preventDefault();
return false;
});

and it works quite well for prevention of any double (or multiple)
clicks :)


On 28 Jan., 02:10, euromark  wrote:
> maybe some js disabling after clicking the submit button like 
> inhttp://www.norio.be/blog/2008/09/using-jquery-prevent-multiple-form-s...
>
> but i guess this can get problematic if the connection gets aborted or
> user cancels manually
> he would then have to reload or hit F5 - some users might not know
> that and the form data could get lost because they wont be able to
> submit anymore
>
> or use a timeout - like 2 seconds - most of the multiple submission
> happens due to a double click on the button (by accident or not)
>
> after all, it does make sense to check on already submitted data in
> PHP again
> this will work even it js is disabled - read the last inserted record
> and compare it to the current one
> if they match, its obviously a double post
>
> On 28 Jan., 01:55, aveev  wrote:
>
> > How can I avoid multiple form submission ??
> > I know that this topic has been discussed in other forums.
> > When a user submits a form, how can we prevent the user to submit the form
> > again and again ?
> > I read some threads in other forums. They use a session variable (writing a
> > value to a session variable when the user submits the form and check whether
> > this value exists upon next form submission)
> > Does cake have a built-in way to avoid multiple form submission ?
> > What's the best way to avoid multiple form submission ??
> > Thanks
>
> > I use cakephp 1.2
>
> > --
> > View this message in 
> > context:http://old.nabble.com/Avoid-multiple-form-submission-tp27349363p27349...
> > Sent from the CakePHP mailing list archive at Nabble.com.

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

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


Re: Avoid multiple form submission

2010-01-27 Thread euromark
maybe some js disabling after clicking the submit button like in
http://www.norio.be/blog/2008/09/using-jquery-prevent-multiple-form-submissions

but i guess this can get problematic if the connection gets aborted or
user cancels manually
he would then have to reload or hit F5 - some users might not know
that and the form data could get lost because they wont be able to
submit anymore

or use a timeout - like 2 seconds - most of the multiple submission
happens due to a double click on the button (by accident or not)

after all, it does make sense to check on already submitted data in
PHP again
this will work even it js is disabled - read the last inserted record
and compare it to the current one
if they match, its obviously a double post


On 28 Jan., 01:55, aveev  wrote:
> How can I avoid multiple form submission ??
> I know that this topic has been discussed in other forums.
> When a user submits a form, how can we prevent the user to submit the form
> again and again ?
> I read some threads in other forums. They use a session variable (writing a
> value to a session variable when the user submits the form and check whether
> this value exists upon next form submission)
> Does cake have a built-in way to avoid multiple form submission ?
> What's the best way to avoid multiple form submission ??
> Thanks
>
> I use cakephp 1.2
>
> --
> View this message in 
> context:http://old.nabble.com/Avoid-multiple-form-submission-tp27349363p27349...
> Sent from the CakePHP mailing list archive at Nabble.com.

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

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


Avoid multiple form submission

2010-01-27 Thread aveev

How can I avoid multiple form submission ??
I know that this topic has been discussed in other forums.
When a user submits a form, how can we prevent the user to submit the form
again and again ?
I read some threads in other forums. They use a session variable (writing a
value to a session variable when the user submits the form and check whether
this value exists upon next form submission) 
Does cake have a built-in way to avoid multiple form submission ?
What's the best way to avoid multiple form submission ??
Thanks

I use cakephp 1.2

-- 
View this message in context: 
http://old.nabble.com/Avoid-multiple-form-submission-tp27349363p27349363.html
Sent from the CakePHP mailing list archive at Nabble.com.

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

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


Re: 600+ models issue

2010-01-27 Thread tiberium911
No 600 is not extreme. We have over 600, all necessary, over about 7
database servers. Thanks for the link, helped quite a bit. Still need
to find some more speed improvements, but most of that will probably
be more caching.

On Jan 27, 7:36 pm, Miles J  wrote:
> Forgot to say, use a lazy loader.
>
> http://github.com/mcurry/lazy_loader
>
> On Jan 27, 4:34 pm, Miles J  wrote:
>
> > Does your site really have 600 database tables? That's a bit extreme
> > don't you think.
>
> > On Jan 27, 2:13 pm, tiberium911  wrote:
>
> > > Can cake handle a website with 600+ connected models? Right now the
> > > site takes 7-10 seconds as soon as cake initializes any model. I
> > > looked through the cake code, and it appears that cake initializes all
> > > 600+ models on any model initialization.

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

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


Re: 600+ models issue

2010-01-27 Thread Miles J
Forgot to say, use a lazy loader.

http://github.com/mcurry/lazy_loader

On Jan 27, 4:34 pm, Miles J  wrote:
> Does your site really have 600 database tables? That's a bit extreme
> don't you think.
>
> On Jan 27, 2:13 pm, tiberium911  wrote:
>
> > Can cake handle a website with 600+ connected models? Right now the
> > site takes 7-10 seconds as soon as cake initializes any model. I
> > looked through the cake code, and it appears that cake initializes all
> > 600+ models on any model initialization.

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

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


Re: 600+ models issue

2010-01-27 Thread Miles J
Does your site really have 600 database tables? That's a bit extreme
don't you think.

On Jan 27, 2:13 pm, tiberium911  wrote:
> Can cake handle a website with 600+ connected models? Right now the
> site takes 7-10 seconds as soon as cake initializes any model. I
> looked through the cake code, and it appears that cake initializes all
> 600+ models on any model initialization.

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

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


Re: Pretty URLs don't work without .htaccess ?

2010-01-27 Thread Miles J
Yes .htaccess is required because its uses mod_rewrite. If you didn't
your URLs would be like so:

index.php?url=/items/view/

On Jan 27, 1:18 pm, Johnny Cupcake  wrote:
> This issue was last discussed here in 2006, as far as I can tell.  I'd
> like to know if anything has changed since then.
>
> Are pretty URLs available without using .htaccess?  For example, with
> my Apache document root set to my app's webroot dir, a controller
> "items" and an action "view", and scaffolding on, I would expect
> something to be available athttp://myserver.com/items/view.  But it
> is not; the result is a 404 error message.
>
> IOW, the example given in the book (http://book.cakephp.org/view/105/
> Scaffolding) doesn't work.
>
> It DOES work if I tryhttp://myserver.com/index.php/items/view
> instead, but that isn't a very pretty URL.  So I wonder, is there
> anything I can do short of turning on .htaccess, to make the clean/
> pretty URLs available?  Using Cake v1.2.5, that is.  Thanks.

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

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


which is the actual ACL used today?

2010-01-27 Thread Alejo
Hi!
I want to use some ACL in CakePHP, but I´ve tried with : Authake
( http://conseil-recherche-innovation.net/authake ) and with PHPGacl
http://dev.sypad.com/installing-phpgacl-plugin-cakephp but this was
imposible to install with Cakephp 1.2.5 version.

Can you help me with some ideas to use ACL in Cakephp ? I´m a novice
with this framework.
I need to control users, groups and permissions.

Thanks for your time, God bless to you.

Alejo

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

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


Pretty URLs don't work without .htaccess ?

2010-01-27 Thread Johnny Cupcake
This issue was last discussed here in 2006, as far as I can tell.  I'd
like to know if anything has changed since then.

Are pretty URLs available without using .htaccess?  For example, with
my Apache document root set to my app's webroot dir, a controller
"items" and an action "view", and scaffolding on, I would expect
something to be available at http://myserver.com/items/view .  But it
is not; the result is a 404 error message.

IOW, the example given in the book (http://book.cakephp.org/view/105/
Scaffolding) doesn't work.

It DOES work if I try http://myserver.com/index.php/items/view
instead, but that isn't a very pretty URL.  So I wonder, is there
anything I can do short of turning on .htaccess, to make the clean/
pretty URLs available?  Using Cake v1.2.5, that is.  Thanks.

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

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


Re: scaffold isn't working

2010-01-27 Thread BrendonKoz
Okay, I just re-read that.  I don't know what he meant, but my last
reply will probably fix the issue.

On Jan 27, 11:27 am, BrendonKoz  wrote:
> I believe he meant the $name property within the controller.
>
> var $name = 'Author';
> ...should be...
> var $name = 'Authors';
>
> On Jan 26, 11:11 am, euromark  wrote:
>
>
>
> > but it is supposed to be plural
> > class BooksController extends AppController {
>
> > On 26 Jan., 16:30, "andrei.b"  wrote:
>
> > > I found the error. The name of the controllers was at the plural
> > > instead of singular.
>
> > > On Jan 26, 4:56 pm, "andrei.b"  wrote:
>
> > > > I did that. The select looks like this:
> > > > SELECT `Book`.`id`, `Book`.`isbn`, `Book`.`title`,
> > > > `Book`.`description`, `Book`.`author_id` FROM `books` AS `Book` WHERE
> > > > 1 = 1 LIMIT 20
>
> > > > I use Cake 1.2.5 and php 5.3.1 if this is relevant.
>
> > > > On Jan 26, 4:50 pm, Jeremy Burns  wrote:
>
> > > > > If it isn't already there, try turning debug to 2 as this clears the 
> > > > > model cache.
>
> > > > > You can find the setting, which looks like this:
>
> > > > > Configure::write('debug', 2);
>
> > > > > ...in app/config/core.php
>
> > > > > Jeremy Burns
>
> > > > > On 26 Jan 2010, at 14:47, andrei.b wrote:
>
> > > > > > Hello,
> > > > > > I have 2 tables: authors(id, name, email) and books(id, title,
> > > > > > author_id).
> > > > > > I've created models for authors and books:
>
> > > > > > class Author extends AppModel {
> > > > > >    var $name = 'Author';
> > > > > >    var $hasMany = 'Book';
> > > > > > }
>
> > > > > > class Book extends AppModel {
> > > > > >    var $name = 'Book';
> > > > > >    var $belongsTo = 'Author';
> > > > > > }
>
> > > > > > And the 2 controllers:
>
> > > > > > class AuthorsController extends AppController{
> > > > > >    var $name = 'Authors';
> > > > > >    var $scaffold;
> > > > > > }
>
> > > > > > class BooksController extends AppController {
> > > > > >  var $name = 'Books';
> > > > > >  var $scaffold;
> > > > > > }
>
> > > > > > When I runhttp://localhost/relationship/books/insteadofshowingat
> > > > > > author the name of the autor it shows me the id of the author.
> > > > > > Can somebody help me?
>
> > > > > > Check out the new CakePHP Questions 
> > > > > > sitehttp://cakeqs.organdhelpotherswiththeir CakePHP related 
> > > > > > questions.
>
> > > > > > You received this message because you are subscribed to the Google 
> > > > > > Groups "CakePHP" group.
> > > > > > To post to this group, send email to cake-php@googlegroups.com
> > > > > > To unsubscribe from this group, send email to
> > > > > > cake-php+unsubscr...@googlegroups.com For more options, visit this 
> > > > > > group athttp://groups.google.com/group/cake-php?hl=en-Hide quoted 
> > > > > > text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

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

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


600+ models issue

2010-01-27 Thread tiberium911
Can cake handle a website with 600+ connected models? Right now the
site takes 7-10 seconds as soon as cake initializes any model. I
looked through the cake code, and it appears that cake initializes all
600+ models on any model initialization.

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

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


Re: Html->link question in 1.3

2010-01-27 Thread Miles J
Just remove 'id' as an index.

array('action' =>'remover', $registro['Proprietario']['id'])

You only need to pass indexes for named params and for routing.

On Jan 27, 1:36 pm, Celso  wrote:
>         echo $this->Html->link('Remover',
>                         array(
>                         'action' =>'remover',
>                         'id' => $registro['Proprietario']['id']
>                         ),
>                         null,
>                         'Deseja realmente remover?' );
>
> create this:
>
> /proprietarios/remover/id:3
>
> and in the 1.2:
>
> /proprietarios/remover/3
>
> How change this in 1.3?
> Thanks,
> Celso.

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

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


Html->link question in 1.3

2010-01-27 Thread Celso
echo $this->Html->link('Remover',
array(
'action' =>'remover',
'id' => $registro['Proprietario']['id']
),
null,
'Deseja realmente remover?' );


create this:

/proprietarios/remover/id:3

and in the 1.2:

/proprietarios/remover/3

How change this in 1.3?
Thanks,
Celso.

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

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


Re: Marking comments as read

2010-01-27 Thread cricket
> and removing the viewed rows in the db when a comment is added

I don't understand what you mean by that. If it's what I think then
I'd guess it would require a lot of writes to the DB.

I did put something together last night. It's a bit rough around the
edges but it's a start. It involves code from a bunch of files, so you
can check it out here:

http://pastebin.ca/1768372

My first inclination was to create a behavior. Even though there are
two models involved directly--Post & Comments--I thought it could be
done. But I need access to the Session. I've chosen to pass it from
the controller to Post model. It's a cheat, but I can't think of any
way (that would be better) to do this with a behavior.

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

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


looking for developer (Were based in Cleveland, Ohio)

2010-01-27 Thread Andrew
Hi Guys!

I am looking for a developer. I have a small project might take a few
weeks. I am looking for someone who wants to donate some time to a
small startup. You can be anywhere in the world. The company is not
looking to become the next Google. We simply want to make the world a
little better.

--
Andrew

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

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


Re: PHP proxy in CakePHP

2010-01-27 Thread John Andersen
I googled after jsonp example and this article turned up, which from
what I read, seems to explain the whole concept in a very
understanding way. Give it a try:
http://www.ibm.com/developerworks/library/wa-aj-jsonp1/

Enjoy,
   John

On 27 Jan., 19:04, thomaus  wrote:
> I agree with you John and this makes sense. The problem is that I
> absolutely don't want to put any PHP in the requesting domain.
>
> It seems that the only remaining solution is to do JSON-P query. Is
> there a simple way to do a JSON-P query and to update a  with a
> full content of a Cake view?
>
> On Jan 27, 3:40 pm, John Andersen  wrote:
>
> > As far as I could understand the second article, you have to place the
> > proxy script in the "requesting" domain, not the CakePHP app domain.
> > The proxy script will then request the CakePHP app domain for the
> > information, receive it and pass it back to your JQuery processor.
> > Enjoy,
> >    John
>
> > On Jan 27, 4:14 pm, thomaus  wrote:
>
> > > Hi there,
>
> > > I need to do a JQuery ajax request to an action of my CakePHP app but
> > > with the Javascript in a different domain than the Cake app's one.
>
> > > After reading this very good article 
> > > :http://developer.yahoo.com/javascript/howto-proxy.html
> > > I created a proxy PHP file following these 
> > > explanations:http://stackoverflow.com/questions/660949/how-to-implement-a-cross-do...
>
> > > Well, if I put the proxy in /app/webroot (as explained in the second
> > > article) it doesn't work, which seems logical : why could a javascript
> > > call a php script in /app/webroot/ if he can't connect an action? It's
> > > the same problem.
>
> > > So my question is : where should I put my PHP proxy script so that it
> > > works fine???
>
> > > I read many articles on this subject but they all say the same and
> > > they don't answer my question.
>
> > > Thanks in advance

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

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


Re: How do you set the href title attribute for a ajax link

2010-01-27 Thread John Andersen
Add the title option as this:

[code]
link(
   'View Post',
   array( 'controller' => 'hello', 'action' => 'world', 1 ),
   array( 'update' => 'post', 'title' => 'your nice title for this
link' )
);
[/code]

Enjoy,
   John

On Jan 27, 5:54 pm, biofox  wrote:
> How do you set the href title attribute within a ajax->link call, i.e.
> to set the title to 'Todo Overview' in the example below
>
> 
>
> Here is an example ajax link
>
> link(
> 'View Post',
> array( 'controller' => 'hello', 'action' => 'world', 1 ),
> array( 'update' => 'post' )
> );

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

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


Re: datasource and count()

2010-01-27 Thread John Andersen
Ok, I would like to understand what is your issue here, because I do
not see a calculate method in the DataSource class! Do you mean the
DboSource?
   John

On Jan 27, 5:52 pm, fain182  wrote:
> 2010/1/26 John Andersen 
>
> > How do you search for your files that fulfill your criteria?
>
> > If you are using a pattern, like "*.txt", then you could just use the
> > function glob("*.txt") to return the filenames and dirnames that
> > comply with the pattern. The result is an array, which you can
> > count :)
>
> no, i need something more complex, and i want do it in the more cake-ish way
> possible..
>
> I have a model Image that use my datasource, and everything works, but if i
> want to know the number of row that will return a find i must have code
> like:
> count( $this->Image->find('all', array('conditions'=>...)) );
>
> but it's a little bit dirty..
> and i wanted to have something like:
> $this->Image->find('count', array('conditions'=>...))
>
> but i didn't found documentation on how to implement something like this,
> and reading the code, seems that find('count',...) is possible only for sql
> based datasource..
>
> > There is no need to worry about the reference to COUNT in MySql, that
> > is only if you are using a database.
>
> no, i want COUNT in a datasource that is not SQL..
>
> --
> pietro

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

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


Re: Blog tutorial trouble...

2010-01-27 Thread Andrew Poquette
Ok, so I changed Cake to use 'pretty urls' and turned mod_rewrite off
and it works now.

Now, I just need to figure out why it wasn't working in the first
place

On Jan 27, 11:17 am, Andrew Poquette  wrote:
> I got this when I restarted apache...
>
> * Restarting web server
> apache2                                                apache2: Could
> not reliably determine the server's fully qualified domain name, using
> 127.0.1.1 for ServerName
> apache2: Could not reliably determine the server's fully qualified
> domain name, using 127.0.1.1 for ServerName
> (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
> no listening sockets available, shutting down
> Unable to open logs
>
> On Jan 27, 11:12 am, Andrew Poquette  wrote:
>
>
>
> > Thank you for the help so far!  I enabled mod rewrite, no luck.
>
> > On Jan 27, 9:59 am, Akeda Bagus  wrote:
>
> > > On Wed, Jan 27, 2010 at 10:24 PM, Andrew Poquette  
> > > wrote:
> > > > So, I installed cake, set everything up, and have the welcome page
> > > > saying that Cake can connect to the database, and I'm good to go.
>
> > > > I created a model, a controller, and a view via the tutorial, but when
> > > > I go tohttp://localhost/posts/indexIgeta 404 error.  I've searched
> > > > the group here and I couldn't find a solution.
>
> > > > Totally new to cake, so I may have screwed something up but I'm
> > > > developing in Ubuntu and apache, php, and mysql are all installed and
> > > > working.
>
> > > > Does anyone have any ideas on why I wouldn't be able to see the view?
> > > > Everything is 100% copied from the tutorial!
>
> > > > Thanks for your help!
>
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers 
> > > > with their CakePHP related questions.
>
> > > > You received this message because you are subscribed to the Google 
> > > > Groups "CakePHP" group.
> > > > To post to this group, send email to cake-php@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > cake-php+unsubscr...@googlegroups.com For more options, visit this 
> > > > group athttp://groups.google.com/group/cake-php?hl=en
>
> > > is mod_rewrite enabled?
> > > $ sudo a2enmod rewrite
>
> > > --
> > > regards,
> > > gedex
>
> > > blog:http://gedex.web.id

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

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


Re: Blog tutorial trouble...

2010-01-27 Thread Andrew Poquette
I got this when I restarted apache...

* Restarting web server
apache2apache2: Could
not reliably determine the server's fully qualified domain name, using
127.0.1.1 for ServerName
apache2: Could not reliably determine the server's fully qualified
domain name, using 127.0.1.1 for ServerName
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs


On Jan 27, 11:12 am, Andrew Poquette  wrote:
> Thank you for the help so far!  I enabled mod rewrite, no luck.
>
> On Jan 27, 9:59 am, Akeda Bagus  wrote:
>
>
>
> > On Wed, Jan 27, 2010 at 10:24 PM, Andrew Poquette  
> > wrote:
> > > So, I installed cake, set everything up, and have the welcome page
> > > saying that Cake can connect to the database, and I'm good to go.
>
> > > I created a model, a controller, and a view via the tutorial, but when
> > > I go tohttp://localhost/posts/indexIget a 404 error.  I've searched
> > > the group here and I couldn't find a solution.
>
> > > Totally new to cake, so I may have screwed something up but I'm
> > > developing in Ubuntu and apache, php, and mysql are all installed and
> > > working.
>
> > > Does anyone have any ideas on why I wouldn't be able to see the view?
> > > Everything is 100% copied from the tutorial!
>
> > > Thanks for your help!
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
> > > with their CakePHP related questions.
>
> > > You received this message because you are subscribed to the Google Groups 
> > > "CakePHP" group.
> > > To post to this group, send email to cake-php@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > > athttp://groups.google.com/group/cake-php?hl=en
>
> > is mod_rewrite enabled?
> > $ sudo a2enmod rewrite
>
> > --
> > regards,
> > gedex
>
> > blog:http://gedex.web.id

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

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


Re: Blog tutorial trouble...

2010-01-27 Thread Andrew Poquette
Thank you for the help so far!  I enabled mod rewrite, no luck.

On Jan 27, 9:59 am, Akeda Bagus  wrote:
> On Wed, Jan 27, 2010 at 10:24 PM, Andrew Poquette  wrote:
> > So, I installed cake, set everything up, and have the welcome page
> > saying that Cake can connect to the database, and I'm good to go.
>
> > I created a model, a controller, and a view via the tutorial, but when
> > I go tohttp://localhost/posts/indexI get a 404 error.  I've searched
> > the group here and I couldn't find a solution.
>
> > Totally new to cake, so I may have screwed something up but I'm
> > developing in Ubuntu and apache, php, and mysql are all installed and
> > working.
>
> > Does anyone have any ideas on why I wouldn't be able to see the view?
> > Everything is 100% copied from the tutorial!
>
> > Thanks for your help!
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> is mod_rewrite enabled?
> $ sudo a2enmod rewrite
>
> --
> regards,
> gedex
>
> blog:http://gedex.web.id

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

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


Re: Routes Regex problem

2010-01-27 Thread ABCoder

I'm having the same prob... Don't know the solution :(

// subcategory routing
Router::connect(
'/:catslug/:subcatslug/*',
array('controller' => 'sub_categories', 'action' => 'view'),
array(
'pass' => array('catslug','subcatslug')
)
);

// product routing
Router::connect(
'/:catslug/:subcatslug/:prodslug',
array('controller' => 'products', 'action' => 'view'),
array(
'pass' => array('catslug','subcatslug','prodslug')
)
);

I want to do something like this. I know the code above is wrong, but I need
help to correct it. This is what I need to do:

domain.com/category/subcategory - this is subcategory page and it has
sorting/pagination feature. so the url could be
domain.com/category/subcategory/*

and for product page domain.com/category/subcategory/product - i want to use
product controller. But according to my (wrong) code it is pointing to
subcategory controller.

Please let me know the proper way to do this.

Thanks
Adnan


visskiss wrote:
> 
> 
> Good day to you all,
> 
> I have tried to solve this and it's killing me.
> 
> My site is working well, but I am trying to perfect the URL's to
> optimize for search.
> 
> The short question:
> 
> Doe anybody know how to get the routes regex working so that all
> queries EXCEPT those in a given list (say, all queries except those
> starting with certain keywords (Like Registration, Users, Pages) get
> forwarded to a specific controller and action?
> 
> I have tried everything I can muster.
> 
> 
> Regards,
> Danny
> --~--~-~--~~~---~--~~
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
> -~--~~~~--~~--~--~---
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Routes-Regex-problem-tp23077336p27343229.html
Sent from the CakePHP mailing list archive at Nabble.com.

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

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


Re: PHP proxy in CakePHP

2010-01-27 Thread thomaus
I agree with you John and this makes sense. The problem is that I
absolutely don't want to put any PHP in the requesting domain.

It seems that the only remaining solution is to do JSON-P query. Is
there a simple way to do a JSON-P query and to update a  with a
full content of a Cake view?

On Jan 27, 3:40 pm, John Andersen  wrote:
> As far as I could understand the second article, you have to place the
> proxy script in the "requesting" domain, not the CakePHP app domain.
> The proxy script will then request the CakePHP app domain for the
> information, receive it and pass it back to your JQuery processor.
> Enjoy,
>    John
>
> On Jan 27, 4:14 pm, thomaus  wrote:
>
> > Hi there,
>
> > I need to do a JQuery ajax request to an action of my CakePHP app but
> > with the Javascript in a different domain than the Cake app's one.
>
> > After reading this very good article 
> > :http://developer.yahoo.com/javascript/howto-proxy.html
> > I created a proxy PHP file following these 
> > explanations:http://stackoverflow.com/questions/660949/how-to-implement-a-cross-do...
>
> > Well, if I put the proxy in /app/webroot (as explained in the second
> > article) it doesn't work, which seems logical : why could a javascript
> > call a php script in /app/webroot/ if he can't connect an action? It's
> > the same problem.
>
> > So my question is : where should I put my PHP proxy script so that it
> > works fine???
>
> > I read many articles on this subject but they all say the same and
> > they don't answer my question.
>
> > Thanks in advance

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

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


Re: E-mail address validation problem + patch

2010-01-27 Thread BrendonKoz
Thank you for your work, Veres-Szentkiralya Andras.  Although I do not
work with the Cake team, I do know that sending this to the Google
Group isn't the proper place to submit change requests, and may go
unseen by the developers.

To submit bug reports/patches/fixes, you would want to use their
current ticket/repository system located (I believe) at Lighthouse:
http://cakephp.lighthouseapp.com/home

On Jan 26, 11:31 pm, "Veres-Szentkiralyi Andras"  wrote:
> Hi,
> the e-mail address validator in CakePHP considers addresses in the form of
> f...@bar.com invalid because of the regular expression used for this purpose
> in cake/libs/validation.php. Although RFC 5322 specifies that the local-part
> of an e-mail address cannot end with a dot, some providers (e.g. freemail.hu,
> with 3 million mailboxes) allow users to get and use such e-mail addresses.
>
> From a technical viewpoint I agree that such addresses shouldn't be allowed to
> be used, but saying "go away, leave our beloved RFC alone" to every user who
> visits a CakePHP-based webshop or other website is not a solution either.
>
> I attached a patch, which fixes this particular problem, consider applying it.
>
> --
> Veres-Szentkirályi András
>
>  0001-Fixing-the-e-mail-validation-regexp-foo.-bar.com.patch
> < 1KViewDownload

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

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


Re: I need help with checkbox

2010-01-27 Thread Lance Willett
> $form->input('Curse.0.curse_id',array('type' => 'checkbox', 'value' =>  
> 13));
>
> how do I recoup the fields checked for edition?

The data will be in $this->data['Curse'] in the controller.

>   $this->data = $this->User->read(null, $id);

By doing this you are completely blowing away the form submitted
data. ;) Not a good idea.
Instead, assign the user to another variable so you don't overwrite
the form data passed in.

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

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


Re: scaffold isn't working

2010-01-27 Thread BrendonKoz
I believe he meant the $name property within the controller.

var $name = 'Author';
...should be...
var $name = 'Authors';

On Jan 26, 11:11 am, euromark  wrote:
> but it is supposed to be plural
> class BooksController extends AppController {
>
> On 26 Jan., 16:30, "andrei.b"  wrote:
>
>
>
> > I found the error. The name of the controllers was at the plural
> > instead of singular.
>
> > On Jan 26, 4:56 pm, "andrei.b"  wrote:
>
> > > I did that. The select looks like this:
> > > SELECT `Book`.`id`, `Book`.`isbn`, `Book`.`title`,
> > > `Book`.`description`, `Book`.`author_id` FROM `books` AS `Book` WHERE
> > > 1 = 1 LIMIT 20
>
> > > I use Cake 1.2.5 and php 5.3.1 if this is relevant.
>
> > > On Jan 26, 4:50 pm, Jeremy Burns  wrote:
>
> > > > If it isn't already there, try turning debug to 2 as this clears the 
> > > > model cache.
>
> > > > You can find the setting, which looks like this:
>
> > > > Configure::write('debug', 2);
>
> > > > ...in app/config/core.php
>
> > > > Jeremy Burns
>
> > > > On 26 Jan 2010, at 14:47, andrei.b wrote:
>
> > > > > Hello,
> > > > > I have 2 tables: authors(id, name, email) and books(id, title,
> > > > > author_id).
> > > > > I've created models for authors and books:
>
> > > > > class Author extends AppModel {
> > > > >    var $name = 'Author';
> > > > >    var $hasMany = 'Book';
> > > > > }
>
> > > > > class Book extends AppModel {
> > > > >    var $name = 'Book';
> > > > >    var $belongsTo = 'Author';
> > > > > }
>
> > > > > And the 2 controllers:
>
> > > > > class AuthorsController extends AppController{
> > > > >    var $name = 'Authors';
> > > > >    var $scaffold;
> > > > > }
>
> > > > > class BooksController extends AppController {
> > > > >  var $name = 'Books';
> > > > >  var $scaffold;
> > > > > }
>
> > > > > When I runhttp://localhost/relationship/books/insteadofshowingat
> > > > > author the name of the autor it shows me the id of the author.
> > > > > Can somebody help me?
>
> > > > > Check out the new CakePHP Questions 
> > > > > sitehttp://cakeqs.organdhelpotherswith their CakePHP related 
> > > > > questions.
>
> > > > > You received this message because you are subscribed to the Google 
> > > > > Groups "CakePHP" group.
> > > > > To post to this group, send email to cake-php@googlegroups.com
> > > > > To unsubscribe from this group, send email to
> > > > > cake-php+unsubscr...@googlegroups.com For more options, visit this 
> > > > > group athttp://groups.google.com/group/cake-php?hl=en- Hide quoted 
> > > > > text -
>
> - Show quoted text -

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

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


Re: bindModel

2010-01-27 Thread yazan suleiman
Thanks again.  So I have 2 followup questions.

Does the containable behavior apply for insert too?
In theory, bind/unbind should work according to documentation, no?

I will look more into contanable, it was next on my list to explore.  Thank
you

On Wed, Jan 27, 2010 at 9:39 AM, Jeremy Burns  wrote:

> You can set recursion and containment restrictively in app_model:
>
> var $actsAs = array('Containable');
> var $recursive = -1;
>
> ...then undo it as you need. Take a look at the section on the contain
> behaviour in the online book -
> http://book.cakephp.org/view/474/Containable - I'd recommend adopting it
> wholeheartedly. Once you get to grips with it you'll love it.
>
> Jeremy Burns
> jeremybu...@me.com 
> (Skype) +44 208 123 3822 (jeremy_burns)
> (m) +44 7973 481949
> (h) +44 208 530 7573
>
> On 27 Jan 2010, at 15:31, yazan suleiman wrote:
>
> Thats a very good question.  In fact, I am still exploring CakePHP and
> trying to find out more about the ins and outs.  Anyway.  I did that and it
> worked.  However, my reasoning for not using associations in the model was
> the following:
>
> If I do use association the model, then any select on Users table (model)
> will fetch the rest of the associated tables.  I know about recursive and I
> can specify its value.  But I am using Auth and the login function fetch
> everything associated to users eventhough it only needs username and
> password.  In addition  What if I only want a user and his/her profile, can
> I exclude Resume.  So these are the questions I had and didnot know the
> answer to.  So I thought my best route is to bind/unbind these
> associations.  Please let me know whether my reasoning is not valid.  And
> thank you for your reply.
>
> On Wed, Jan 27, 2010 at 9:24 AM, Jeremy Burns  wrote:
>
>> Can I pose the question "Why are you not defining associations in your
>> models?"  They are incredibly powerful.
>>
>> Jeremy Burns
>> jeremybu...@me.com
>> (Skype) +44 208 123 3822 (jeremy_burns)
>> (m) +44 7973 481949
>> (h) +44 208 530 7573
>>
>> On 27 Jan 2010, at 04:36, YS wrote:
>>
>> > I am very new to cakephp and having problems understanding bindModel.
>> > I have read the documentation several times but bindModel is not
>> > behaving as I expect.  This is my issue:
>> >
>> > I have user who has one profile and one resume.  I am storing resume
>> > in a separate table and I am not defining association in my models and
>> > only using binding 'bindModel'.  In my controller I do the following:
>> >
>> > $this->User->bindModel(array('hasOne' => array('Profile', 'Resume')));
>> > if ($this->User->saveAll($this->data, array('validate'=>'first'))){
>> >  
>> > }
>> >
>> > So I get the following error (the error is referring to Resume):
>> >
>> > Warning (512): SQL Error: 1364: Field 'user_id' doesn't have a default
>> > value.  I know I am doing something wrong because this behavior does
>> > not match the one in the documentation (examples).  I cannot figure
>> > out where the problem is however.
>> >
>> > I was not sure what other information you may need to look into this
>> > and thought the above is sufficient for now.  (let me know if you need
>> > more information).
>> >
>> > Any help is really appreciated.
>> >
>> > Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>> >
>> > You received this message because you are subscribed to the Google
>> Groups "CakePHP" group.
>> > To post to this group, send email to cake-php@googlegroups.com
>> > To unsubscribe from this group, send email to
>> > cake-php+unsubscr...@googlegroups.comFor
>> >  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php?hl=en
>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+u

Re: Dynamic Navigations

2010-01-27 Thread Jeremy Burns
I got this working (although I have amended the model since but not updated 
this article - perhaps I should!). This might help as  a starting place.

http://www.jeremy-burns.co.uk/2009/11/cakephp-dynamic-navigation-bars/

Jeremy Burns

On 27 Jan 2010, at 16:06, Dave wrote:

> I m trying to figure out the best way to create dynamic navigation but not 
> sure where to start.
>  
> The idea is have a "manager" for main nav, left side, right side, footer so 
> the admin can create or edit each nav from the manager. They most likely will 
> not change from page to page so all the navs will be the same when used. I 
> was thinking
>  
> tables
> sections:
> id
> navigation_id
> title => about Us
> controller => information
> action => index
>  
> navigations:
> id
> name => main, left, right, footer
>  
> Ideas?
>  
> Thanks,
>  
> Dave
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>  
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

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

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


Re: Dynamic Navigations

2010-01-27 Thread Nathan Lane
You could create XML sitemaps from which you draw the actual urls and text
for your navigation links. Then create an admin tool (page) to administer
those XML files. That is pretty common in professional web development.

On Wed, Jan 27, 2010 at 9:06 AM, Dave  wrote:

>  I m trying to figure out the best way to create dynamic navigation but
> not sure where to start.
>
> The idea is have a "manager" for main nav, left side, right side, footer so
> the admin can create or edit each nav from the manager. They most likely
> will not change from page to page so all the navs will be the same when
> used. I was thinking
>
> tables
> sections:
> id
> navigation_id
> title => about Us
> controller => information
> action => index
>
> navigations:
> id
> name => main, left, right, footer
>
> Ideas?
>
> Thanks,
>
> Dave
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Nathan Lane
Blog, http://blog.nathandelane.com

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

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


How do you set the href title attribute for a ajax link

2010-01-27 Thread biofox
How do you set the href title attribute within a ajax->link call, i.e.
to set the title to 'Todo Overview' in the example below



Here is an example ajax link

link(
'View Post',
array( 'controller' => 'hello', 'action' => 'world', 1 ),
array( 'update' => 'post' )
);

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

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


Dynamic Navigations

2010-01-27 Thread Dave
I m trying to figure out the best way to create dynamic navigation but not
sure where to start.
 
The idea is have a "manager" for main nav, left side, right side, footer so
the admin can create or edit each nav from the manager. They most likely
will not change from page to page so all the navs will be the same when
used. I was thinking 
 
tables 
sections:
id
navigation_id
title => about Us
controller => information
action => index
 
navigations:
id 
name => main, left, right, footer
 
Ideas?
 
Thanks,
 
Dave

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

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


Re: Blog tutorial trouble...

2010-01-27 Thread Akeda Bagus
On Wed, Jan 27, 2010 at 10:24 PM, Andrew Poquette  wrote:
> So, I installed cake, set everything up, and have the welcome page
> saying that Cake can connect to the database, and I'm good to go.
>
> I created a model, a controller, and a view via the tutorial, but when
> I go to http://localhost/posts/index I get a 404 error.  I've searched
> the group here and I couldn't find a solution.
>
> Totally new to cake, so I may have screwed something up but I'm
> developing in Ubuntu and apache, php, and mysql are all installed and
> working.
>
> Does anyone have any ideas on why I wouldn't be able to see the view?
> Everything is 100% copied from the tutorial!
>
> Thanks for your help!
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

is mod_rewrite enabled?
$ sudo a2enmod rewrite

-- 
regards,
gedex

blog: http://gedex.web.id

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

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


Re: datasource and count()

2010-01-27 Thread fain182
2010/1/26 John Andersen 

> How do you search for your files that fulfill your criteria?
>
> If you are using a pattern, like "*.txt", then you could just use the
> function glob("*.txt") to return the filenames and dirnames that
> comply with the pattern. The result is an array, which you can
> count :)
>
no, i need something more complex, and i want do it in the more cake-ish way
possible..

I have a model Image that use my datasource, and everything works, but if i
want to know the number of row that will return a find i must have code
like:
count( $this->Image->find('all', array('conditions'=>...)) );

but it's a little bit dirty..
and i wanted to have something like:
$this->Image->find('count', array('conditions'=>...))

but i didn't found documentation on how to implement something like this,
and reading the code, seems that find('count',...) is possible only for sql
based datasource..

> There is no need to worry about the reference to COUNT in MySql, that
> is only if you are using a database.
>
no, i want COUNT in a datasource that is not SQL..

-- 
pietro

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

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


Re: bindModel

2010-01-27 Thread Jeremy Burns
You can set recursion and containment restrictively in app_model:

var $actsAs = array('Containable');
var $recursive = -1;

...then undo it as you need. Take a look at the section on the contain 
behaviour in the online book - http://book.cakephp.org/view/474/Containable - 
I'd recommend adopting it wholeheartedly. Once you get to grips with it you'll 
love it.

Jeremy Burns
jeremybu...@me.com
(Skype) +44 208 123 3822 (jeremy_burns)
(m) +44 7973 481949
(h) +44 208 530 7573

On 27 Jan 2010, at 15:31, yazan suleiman wrote:

> Thats a very good question.  In fact, I am still exploring CakePHP and trying 
> to find out more about the ins and outs.  Anyway.  I did that and it worked.  
> However, my reasoning for not using associations in the model was the 
> following:
> 
> If I do use association the model, then any select on Users table (model) 
> will fetch the rest of the associated tables.  I know about recursive and I 
> can specify its value.  But I am using Auth and the login function fetch 
> everything associated to users eventhough it only needs username and 
> password.  In addition  What if I only want a user and his/her profile, can I 
> exclude Resume.  So these are the questions I had and didnot know the answer 
> to.  So I thought my best route is to bind/unbind these associations.  Please 
> let me know whether my reasoning is not valid.  And thank you for your reply.
> 
> On Wed, Jan 27, 2010 at 9:24 AM, Jeremy Burns  wrote:
> Can I pose the question "Why are you not defining associations in your 
> models?"  They are incredibly powerful.
> 
> Jeremy Burns
> jeremybu...@me.com
> (Skype) +44 208 123 3822 (jeremy_burns)
> (m) +44 7973 481949
> (h) +44 208 530 7573
> 
> On 27 Jan 2010, at 04:36, YS wrote:
> 
> > I am very new to cakephp and having problems understanding bindModel.
> > I have read the documentation several times but bindModel is not
> > behaving as I expect.  This is my issue:
> >
> > I have user who has one profile and one resume.  I am storing resume
> > in a separate table and I am not defining association in my models and
> > only using binding 'bindModel'.  In my controller I do the following:
> >
> > $this->User->bindModel(array('hasOne' => array('Profile', 'Resume')));
> > if ($this->User->saveAll($this->data, array('validate'=>'first'))){
> >  
> > }
> >
> > So I get the following error (the error is referring to Resume):
> >
> > Warning (512): SQL Error: 1364: Field 'user_id' doesn't have a default
> > value.  I know I am doing something wrong because this behavior does
> > not match the one in the documentation (examples).  I cannot figure
> > out where the problem is however.
> >
> > I was not sure what other information you may need to look into this
> > and thought the above is sufficient for now.  (let me know if you need
> > more information).
> >
> > Any help is really appreciated.
> >
> > Check out the new CakePHP Questions site http://cakeqs.org and help others 
> > with their CakePHP related questions.
> >
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> > http://groups.google.com/group/cake-php?hl=en
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
> 
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>  
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

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

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


Re: Blog tutorial trouble...

2010-01-27 Thread Andrew Poquette
I double checked, and they are all there.

On Jan 27, 9:31 am, Jeremy Burns  wrote:
> It might not be this, but I've done it in the past. Check that when you 
> installed Cake you also copied over the .htacces files. They exist in the 
> root, in /app and in /app/webroot. If these files are hidden it is easy to 
> overlook them, especially the one in the root.
>
> Jeremy Burns
> On 27 Jan 2010, at 15:24, Andrew Poquette wrote:
>
>
>
> > So, I installed cake, set everything up, and have the welcome page
> > saying that Cake can connect to the database, and I'm good to go.
>
> > I created a model, a controller, and a view via the tutorial, but when
> > I go tohttp://localhost/posts/indexI get a 404 error.  I've searched
> > the group here and I couldn't find a solution.
>
> > Totally new to cake, so I may have screwed something up but I'm
> > developing in Ubuntu and apache, php, and mysql are all installed and
> > working.
>
> > Does anyone have any ideas on why I wouldn't be able to see the view?
> > Everything is 100% copied from the tutorial!
>
> > Thanks for your help!
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en

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

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


Re: Blog tutorial trouble...

2010-01-27 Thread Jeremy Burns
It might not be this, but I've done it in the past. Check that when you 
installed Cake you also copied over the .htacces files. They exist in the root, 
in /app and in /app/webroot. If these files are hidden it is easy to overlook 
them, especially the one in the root.

Jeremy Burns
On 27 Jan 2010, at 15:24, Andrew Poquette wrote:

> So, I installed cake, set everything up, and have the welcome page
> saying that Cake can connect to the database, and I'm good to go.
> 
> I created a model, a controller, and a view via the tutorial, but when
> I go to http://localhost/posts/index I get a 404 error.  I've searched
> the group here and I couldn't find a solution.
> 
> Totally new to cake, so I may have screwed something up but I'm
> developing in Ubuntu and apache, php, and mysql are all installed and
> working.
> 
> Does anyone have any ideas on why I wouldn't be able to see the view?
> Everything is 100% copied from the tutorial!
> 
> Thanks for your help!
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

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

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


Re: bindModel

2010-01-27 Thread yazan suleiman
Thats a very good question.  In fact, I am still exploring CakePHP and
trying to find out more about the ins and outs.  Anyway.  I did that and it
worked.  However, my reasoning for not using associations in the model was
the following:

If I do use association the model, then any select on Users table (model)
will fetch the rest of the associated tables.  I know about recursive and I
can specify its value.  But I am using Auth and the login function fetch
everything associated to users eventhough it only needs username and
password.  In addition  What if I only want a user and his/her profile, can
I exclude Resume.  So these are the questions I had and didnot know the
answer to.  So I thought my best route is to bind/unbind these
associations.  Please let me know whether my reasoning is not valid.  And
thank you for your reply.

On Wed, Jan 27, 2010 at 9:24 AM, Jeremy Burns  wrote:

> Can I pose the question "Why are you not defining associations in your
> models?"  They are incredibly powerful.
>
> Jeremy Burns
> jeremybu...@me.com
> (Skype) +44 208 123 3822 (jeremy_burns)
> (m) +44 7973 481949
> (h) +44 208 530 7573
>
> On 27 Jan 2010, at 04:36, YS wrote:
>
> > I am very new to cakephp and having problems understanding bindModel.
> > I have read the documentation several times but bindModel is not
> > behaving as I expect.  This is my issue:
> >
> > I have user who has one profile and one resume.  I am storing resume
> > in a separate table and I am not defining association in my models and
> > only using binding 'bindModel'.  In my controller I do the following:
> >
> > $this->User->bindModel(array('hasOne' => array('Profile', 'Resume')));
> > if ($this->User->saveAll($this->data, array('validate'=>'first'))){
> >  
> > }
> >
> > So I get the following error (the error is referring to Resume):
> >
> > Warning (512): SQL Error: 1364: Field 'user_id' doesn't have a default
> > value.  I know I am doing something wrong because this behavior does
> > not match the one in the documentation (examples).  I cannot figure
> > out where the problem is however.
> >
> > I was not sure what other information you may need to look into this
> > and thought the above is sufficient for now.  (let me know if you need
> > more information).
> >
> > Any help is really appreciated.
> >
> > Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
> >
> > You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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

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


Blog tutorial trouble...

2010-01-27 Thread Andrew Poquette
So, I installed cake, set everything up, and have the welcome page
saying that Cake can connect to the database, and I'm good to go.

I created a model, a controller, and a view via the tutorial, but when
I go to http://localhost/posts/index I get a 404 error.  I've searched
the group here and I couldn't find a solution.

Totally new to cake, so I may have screwed something up but I'm
developing in Ubuntu and apache, php, and mysql are all installed and
working.

Does anyone have any ideas on why I wouldn't be able to see the view?
Everything is 100% copied from the tutorial!

Thanks for your help!

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

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


Re: bindModel

2010-01-27 Thread Jeremy Burns
Can I pose the question "Why are you not defining associations in your models?" 
 They are incredibly powerful.

Jeremy Burns
jeremybu...@me.com
(Skype) +44 208 123 3822 (jeremy_burns)
(m) +44 7973 481949
(h) +44 208 530 7573

On 27 Jan 2010, at 04:36, YS wrote:

> I am very new to cakephp and having problems understanding bindModel.
> I have read the documentation several times but bindModel is not
> behaving as I expect.  This is my issue:
> 
> I have user who has one profile and one resume.  I am storing resume
> in a separate table and I am not defining association in my models and
> only using binding 'bindModel'.  In my controller I do the following:
> 
> $this->User->bindModel(array('hasOne' => array('Profile', 'Resume')));
> if ($this->User->saveAll($this->data, array('validate'=>'first'))){
>  
> }
> 
> So I get the following error (the error is referring to Resume):
> 
> Warning (512): SQL Error: 1364: Field 'user_id' doesn't have a default
> value.  I know I am doing something wrong because this behavior does
> not match the one in the documentation (examples).  I cannot figure
> out where the problem is however.
> 
> I was not sure what other information you may need to look into this
> and thought the above is sufficient for now.  (let me know if you need
> more information).
> 
> Any help is really appreciated.
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

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

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


Fatal error: require_once() error while using captcha component

2010-01-27 Thread annamalai,cakephp
Hi

 i try to integrate the captcha component with my login form. after
install all the files i try the following error  coming ..


Fatal error: require_once() [function.require]: Failed opening
required 'D:\wamp\www\furniture_project\app\vendors\phpcaptcha\php-
captcha.inc' (include_path='D:\wamp\www\furniture_project;D:\wamp\www
\furniture_project\app\;.;C:\php5\pear') in D:\wamp\www
\furniture_project\app\controllers\components\captcha.php on line 2

pleas help me...


thanks in advance

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

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


Re: Table Joins

2010-01-27 Thread Annamalai
Hi,

Tables :
1.user_profiles
  fields :-> userid (PK)

2. Memberships
  fields :->membid , userid (reference to users profile )

Can you help me over this issue.?



Solution :
  user_profiles table : id

memberships table: id, user_profile_id (it will refers the user_profile
table)

* please read the basic naming conventions

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

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


Submit form data with ajax helper only work when the debug is on

2010-01-27 Thread Jeruliu
As captioned, this is very strange that i can't figure it out till now

But it's true that the database table only got refreshed when i set
the debug to on.

Nothing will be inserted into the table when debug is off.

Does anyone have any idea what's going on with cakephp debug? PLS PLS

Many thanks.

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

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


bindModel

2010-01-27 Thread YS
I am very new to cakephp and having problems understanding bindModel.
I have read the documentation several times but bindModel is not
behaving as I expect.  This is my issue:

I have user who has one profile and one resume.  I am storing resume
in a separate table and I am not defining association in my models and
only using binding 'bindModel'.  In my controller I do the following:

$this->User->bindModel(array('hasOne' => array('Profile', 'Resume')));
if ($this->User->saveAll($this->data, array('validate'=>'first'))){
  
}

So I get the following error (the error is referring to Resume):

Warning (512): SQL Error: 1364: Field 'user_id' doesn't have a default
value.  I know I am doing something wrong because this behavior does
not match the one in the documentation (examples).  I cannot figure
out where the problem is however.

I was not sure what other information you may need to look into this
and thought the above is sufficient for now.  (let me know if you need
more information).

Any help is really appreciated.

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

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


E-mail address validation problem + patch

2010-01-27 Thread Veres-Szentkiralyi Andras
Hi,
the e-mail address validator in CakePHP considers addresses in the form of 
f...@bar.com invalid because of the regular expression used for this purpose 
in cake/libs/validation.php. Although RFC 5322 specifies that the local-part 
of an e-mail address cannot end with a dot, some providers (e.g. freemail.hu, 
with 3 million mailboxes) allow users to get and use such e-mail addresses.

>From a technical viewpoint I agree that such addresses shouldn't be allowed to 
be used, but saying "go away, leave our beloved RFC alone" to every user who 
visits a CakePHP-based webshop or other website is not a solution either.

I attached a patch, which fixes this particular problem, consider applying it.

-- 
Veres-Szentkirályi András

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

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
From 52c9e17a1ef837b6c850c7f61edc7ed37604692c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= 
Date: Wed, 27 Jan 2010 05:02:27 +0100
Subject: [PATCH] Fixing the e-mail validation regexp (f...@bar.com)

---
 cake/libs/validation.php |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cake/libs/validation.php b/cake/libs/validation.php
index 20324dd..4a887a8 100644
--- a/cake/libs/validation.php
+++ b/cake/libs/validation.php
@@ -387,7 +387,7 @@ class Validation extends Object {
 		}
 
 		if (is_null($regex)) {
-			$regex = '/^[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@' . self::$__pattern['hostname'] . '$/i';
+			$regex = '/^[\.a-z0-9!#$%&\'*+\/=?^_`{|}~-]+@' . self::$__pattern['hostname'] . '$/i';
 		}
 		$return = self::_check($check, $regex);
 		if ($deep === false || $deep === null) {
-- 
1.6.5



Re: PHP proxy in CakePHP

2010-01-27 Thread John Andersen
As far as I could understand the second article, you have to place the
proxy script in the "requesting" domain, not the CakePHP app domain.
The proxy script will then request the CakePHP app domain for the
information, receive it and pass it back to your JQuery processor.
Enjoy,
   John

On Jan 27, 4:14 pm, thomaus  wrote:
> Hi there,
>
> I need to do a JQuery ajax request to an action of my CakePHP app but
> with the Javascript in a different domain than the Cake app's one.
>
> After reading this very good article 
> :http://developer.yahoo.com/javascript/howto-proxy.html
> I created a proxy PHP file following these 
> explanations:http://stackoverflow.com/questions/660949/how-to-implement-a-cross-do...
>
> Well, if I put the proxy in /app/webroot (as explained in the second
> article) it doesn't work, which seems logical : why could a javascript
> call a php script in /app/webroot/ if he can't connect an action? It's
> the same problem.
>
> So my question is : where should I put my PHP proxy script so that it
> works fine???
>
> I read many articles on this subject but they all say the same and
> they don't answer my question.
>
> Thanks in advance

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

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


Re: PHP proxy in CakePHP

2010-01-27 Thread Pablo Viojo
app/webroot is the right place.

Try accesing /url_proxy.php directly from the browser and see what happens

Regards!


Pablo Viojo
pvi...@gmail.com
http://pviojo.net

¿Que necesitas?
http://www.needish.com


On Wed, Jan 27, 2010 at 11:14 AM, thomaus  wrote:

> Hi there,
>
> I need to do a JQuery ajax request to an action of my CakePHP app but
> with the Javascript in a different domain than the Cake app's one.
>
> After reading this very good article :
> http://developer.yahoo.com/javascript/howto-proxy.html
> I created a proxy PHP file following these explanations:
>
> http://stackoverflow.com/questions/660949/how-to-implement-a-cross-domain-ajax-request-using-cakephp-and-jquery
>
> Well, if I put the proxy in /app/webroot (as explained in the second
> article) it doesn't work, which seems logical : why could a javascript
> call a php script in /app/webroot/ if he can't connect an action? It's
> the same problem.
>
> So my question is : where should I put my PHP proxy script so that it
> works fine???
>
> I read many articles on this subject but they all say the same and
> they don't answer my question.
>
> Thanks in advance
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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

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


PHP proxy in CakePHP

2010-01-27 Thread thomaus
Hi there,

I need to do a JQuery ajax request to an action of my CakePHP app but
with the Javascript in a different domain than the Cake app's one.

After reading this very good article : 
http://developer.yahoo.com/javascript/howto-proxy.html
I created a proxy PHP file following these explanations:
http://stackoverflow.com/questions/660949/how-to-implement-a-cross-domain-ajax-request-using-cakephp-and-jquery

Well, if I put the proxy in /app/webroot (as explained in the second
article) it doesn't work, which seems logical : why could a javascript
call a php script in /app/webroot/ if he can't connect an action? It's
the same problem.

So my question is : where should I put my PHP proxy script so that it
works fine???

I read many articles on this subject but they all say the same and
they don't answer my question.

Thanks in advance

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

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


Re: app_controller problem

2010-01-27 Thread John Andersen
Hi Chander,

Please show the code from the AppController which you would like to
use in another Controller.
Also the code in the controller that you have the issue.
Then we may better be able to help you!

Enjoy,
   John

On Jan 27, 1:53 pm, Chander Bhan  wrote:
> I am unable to  get all the properties of app_controller in a
> controller which extends app Controller and using the method of
> another controller which also extends app controller

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

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


Re: No output from debug() in controllers, etc. only in views

2010-01-27 Thread Rick
Thanks - I looked at the page source and it is there - Apparently I've
screwed up the CSS so it doesn't appear.

Rick


On Jan 25, 8:50 pm, euromark  wrote:
> usually it is printed before the  tag starts
> in a normal browser environment it would display as ugly code at the
> very top
>
> maybe its somehow hidden in your case (some css rule?)
> but it should still be in the html output (open the source of the page
> to confirm this)
>
> On 26 Jan., 01:53, Rick  wrote:
>
> > I haven't used debug in a while...
>
> > when I put it in a view it outputs debug data as it should to the
> > page.  However when I put a debug(...) in a controller or model no
> > debug output appears on the page.
>
> > I've also tried echo, print, Debugger::trace() and none of these give
> > any output.  The output does have an sql trace at the bottom.
>
> > I have debug set to 2 in core.php.  Caching is off.
>
> > Any ideas?

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

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


Re: routes.php - getting missing controller issue

2010-01-27 Thread Chad Smith
Hey Leaf,

We've done a lot of rewriting with our sites and mainly with
http://theeasyapi.com, and http://www.countycriminal.com.  One thing
that I have found is that you must always use the controller name in
the URL even when you are rewriting which controller picks it up.

In your example I would use instead of /hp/12345 I would use /users/
12345 ... try that and see if you get a valid result.  Like I said I
know it's not the best approach as you obviously want to have /hp/ = /
homepage/ but sometimes there are just a few things that just don't
work in cake for some reason.

The other thing you COULD do is a custom modification in
your .htaccess.  Change your routes to look for /homepage/ but then in
your .htaccess put a rewrite rule in there to convert /hp/ to /
homepage/ so the URL at the top stays the same but it does pass in /
homepage/ instead.  Keeps the same look and feel but does break the
"cakeified" mentality.

It's up to you and check out http://theeasyapi.com you can see a live
site where we rewrite URL's and do a lot of really interesting things
with our routes file.

Have a wonderful day,
Chad

On Jan 26, 5:43 am, leafchild  wrote:
> circket, thank you for the replay.
>
> actually i set to 'id'=>'[0-9a-zA-Z]+' in the beginning but make it
> simple since nothing was working for me.
>
> code below gives me a "Missing controller error" it say I don't have a
> Hp Controller
> =
> Router::connect('/hp/:id/', array(
>              'controller' => 'users',
>                  'action' => 'homepage',
>                  ), array(
>                         'id'=>'[0-9a-zA-Z]', 'pass'=>'id'
>         ));
> =
>
> then if i have this code then it bring  to home page
> =
> Router::connect('/hp/:id/', array(
>              'controller' => 'users',
>                  'action' => 'homepage',
>                  ), array(
>                         'id'=>'[0-9a-zA-Z]+', 'pass'=>'id'
>         ));
> =
>
> What am I missing?
>
> On Jan 25, 5:08 pm, cricket  wrote:
>
> > What does the error msg say? That UsersController is missing, or
> > something else?
>
> > Are your usernames limited to lowercase letters only and no digits?
>
> > And you might want to pass the ID to your action:
>
> > Router::connect(
> >     '/hp/:id/',
> >     array('controller' => 'users', 'action' => 'homepage'),
> >     array('id'=>'[a-z]', 'pass' => 'id')
> > );
>
> > On Jan 25, 5:19 pm, leafchild  wrote:
>
> > > I'm tring to fix URL
>
> > >www.mysite.com/users/homepage/{user's login name}
> > > ->www.mysite.com/{user's login name}
>
> > > but I couldn't figure it out so I'm tesing with this 
> > > firstwww.mysite.com/users/homepage/{user's login name}
> > > ->www.mysite.com/hp/{user's login name}
>
> > > Router::connect('/hp/:id/', array( 'controller' => 'users',  'action'
> > > => 'homepage', ),
> > >                               array('id'=>'[a-z]',  )
> > >                        );
>
> > > then when I access, mysite.com/hp/{user's login name}, I'm getting a
> > > missing controller error.
>
> > > What I'm I doing wrong? I was expected to see the page with this URL.

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

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


[HELP PLEASE] Question: HABTM

2010-01-27 Thread Douglas Pacheco Cardoso
Hi,

I have a question about HABTM.

I'm making a access permission system itself, because I don't need the
complexity of the ACL.
I have 3 tables:
  - Users
  - Locals -> access locals of the system.
  - Permissions -> Table N:M with the fields (id, user_id, local_id, _add,
_read, _delete, _update)

I created a page for managing permissions, but I have a problem, because
when I execute saveAll method, is saving only the fields: user_id and
local_id, not the specific fields.

Anybody have a tip for me?

thank you,

Douglas Pacheco Cardoso

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

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


app_controller problem

2010-01-27 Thread Chander Bhan
I am unable to  get all the properties of app_controller in a
controller which extends app Controller and using the method of
another controller which also extends app controller

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

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


Re: Subdomains

2010-01-27 Thread Jeremy Burns
I resolved this, and it was quite easy.

I created a folder within app/webroot (let's call it appfolder), installed the 
program there and pointed my subdomain at the folder. Now I can access the 
application either by going to www.domain.com/appfolder or appfolder.domain.com

Hope this helps some others.

Jeremy Burns
jeremybu...@me.com
(Skype) +44 208 123 3822 (jeremy_burns)
(m) +44 7973 481949
(h) +44 208 530 7573

On 7 Jan 2010, at 18:11, Juan Luis Baptiste wrote:

> On Thu, Jan 7, 2010 at 12:22 PM, Jeremy Burns  wrote:
>> My hosting company do allow me to create subdomains and point them to 
>> different directories. I have created both, but when I go to 
>> subdomain.[mydomain].com I get:
>> 
>> Error 500 - Internal server error
>> 
>> An internal server error has occured!
>> Please try again later.
>> 
>> I figured this might have something to with .htaccess or something - an area 
>> I am hideously bad at.
> 
> Try first checking out the virtual hosts are working fine. Put a
> simple html page on the virtual host directory and see if it shows up
> when you enter to your subdomain. For the error you sohuld check the
> error logs for that virtual host.
> 
> 
> Juancho
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

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

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


Re: Login from won't work from Home Page

2010-01-27 Thread Ponch316
I fixed the problem and I thought I would post the solution here in
case someone came across the same problem.

After WEEKS of trying to figure it out, I found the solution by
accident. I accidentally commented the $components variable in my
users_controller.php file and it suddenly started working.

I started removing components to narrow down the problem and realized
that, for some reason, the Security component was being the cause of
these problems. Without it, after submitting I got access to the
controller's actions, including login, without a single issue.

I have no idea if this is a bug or an expected behavior, if someone
knows I would greatly appreciate if you told me.

Best,
P.

On Jan 5, 1:58 am, Ponch316  wrote:
> Hello,
>
> I've been trying to add a little Login module to my homepage and my
> Layout. I'm using the Auth component and have the following code:
>
> //app_controller.php:
>     function beforeFilter() {
>         $this->Auth->allow('display');
>         $this->Auth->autoRedirect = false;
>         $this->Auth->fields = array('username' => 'email', 'password'
> => 'password');
>         $this->Auth->loginAction = array('admin' => false,
> 'controller' => 'users', 'action' => 'login');
>         $this->Auth->loginRedirect = array('controller'=>'dashboard',
> 'action'=>'index');
>         $this->Auth->logoutRedirect = array('admin' => false,
> 'controller' => 'pages', 'action' => 'home');
>
>     }
>
> //users_controller.php
>     function login() {
>                 if ($this->Auth->user()) {
>                         if (!empty($this->data) && 
> $this->data['User']['remember_me']) {
>                                 $cookie = array();
>                                 $cookie['email'] = 
> $this->data['User']['email'];
>                                 $cookie['password'] = 
> $this->data['User']['password'];
>                                 $this->Cookie->write('Auth.User', $cookie, 
> true, '+2 weeks');
>                                 unset($this->data['User']['remember_me']);
>                         }
>                          $this->redirect($this->Auth->redirect());
>                 }
>                 if(empty($this->data)) {
>                         $cookie = $this->Cookie->read('Auth.User');
>                         if (!is_null($cookie)) {
>                                 if ($this->Auth->login($cookie)) {
>                                         $this->Session->del('Message.auth');
>                                          
> $this->redirect($this->Auth->redirect());
>                                 } else {
>                                 $this->Cookie->del('Auth.User');
>                                 }
>                         }
>                 }
>     }
>
> //(pages) home.ctp  and  (users) login.ctp
>                                                                                  echo $form->create('User', 
> array('action' => 'login',
> 'style'=>'margin: 5px 0 0 18px;'));
>                                         echo ' "label">E-mail';
>                                         echo $form->input('email', 
> array('label' => ''));
>                                         echo ' "label">Password';
>                                         echo $form->input('password', 
> array('label' => ''));
>                                         echo $form->input('remember_me', 
> array('type' =>
> 'checkbox','label'=>'Remember Me'));
>                                         echo $form->end(array
> ('label'=>'Login','class'=>'b2','style'=>'margin-top: 13px;'));
>                                         ?>
>
> The problem is that the Login only works when I access it directly
> from /users/login, but if I try to login from the Homepage (or
> anywhere else for that matter) with the exact same code, it gives me a
> 404 NOT FOUND error.
>
> I've been browsing all over the Internet for a way to do this (a login
> element or a login form in the layout) but no luck yet. Any idea of
> what might be happening?
>
> Thanks in advance!
> Ponch

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

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


Re: Marking comments as read

2010-01-27 Thread asbestospiping
Its a good idea, but i want to be able to see when a user has viewed a
comment, and then act upon that at the end of the day. The solution
i'm going with is tracking the post views, as opposed to the comment
views, and removing the viewed rows in the db when a comment is added.
any thought?

On Jan 26, 9:20 pm, cricket  wrote:
> I think the most efficient thing to do would be to update a timestamp
> whenever a user views a post. Maybe have a posts_users table with an
> extra column and use contain to include it in your results. Update the
> column in afterFind() maybe?
>
> Then, in the view, compare the original ts that you got from your find
> () with the Comment.created value. Any newer comments get a class
> "NewComment".
>
> I've never done this, btw. But I happen to be just starting on a
> posts_controller. I think I'll give it a go.
>
> On Jan 26, 11:31 am, asbestospiping  wrote:> Hi 
> all, I am trying to do something, and cant work out where to start.
> > I have the blog app running, and have the comments paginated under the
> > post. I have auth working, and would like to track when a user views a
> > comment (Think marking as read)
>
> > I have a db table viewedcomments, with the fields id, user_id,
> > comment_id
>
> > I simply want to add the relevent data when a comment is displayed,
> > either on its own, or as part of the post page.
>
> > Any ideas?

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

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


When use ACL and when use HABTM for control access

2010-01-27 Thread marco.rizze...@gmail.com
Hi
I'm newbie on cakephp
I have a big doubt about if use ACL or HABTM in my web application. I
would ask you some suggestion.
My system is:

Model:
User , Organization , Document

Organization HABTM Recipient (User)
Organization HABTM Administrator (User)

Document belongsTo Organization
Document HABTM Recipient (User) (a subset of Recipients of the
organization which belongs the document)

I must control that a user can read only to documents which it is a
recipient.
I must control that a user can read only to organizations which it is
a recipient.
I must control that a user can edit only to documents which belongs to
organization which it is a administrator.
I must control that a user can edit only to organizations which it is
a administrator.

In this situation what is the best pattern to use? Is it sufficient to
do a method "isAccessible"  in model Document and a method
"isAccessible" in model Organization ?

Many Thanks

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

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


Re: Dojo toolkit integration with CakePHP now supported!!

2010-01-27 Thread mufti ali
 Great jobs, this library very helpfull for dojo lover.



Mufti Ali
087831163105
http://wordtaps.com
http://blogfreakz.com

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

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


Re: question about automagic 'modified' field

2010-01-27 Thread Zaky Katalan-Ezra
You can write trigger in the database

On Mon, Jan 25, 2010 at 5:25 PM, Javier wrote:

> Is it possible to automagically update 'modified' field in a
> 'belongsTo' table when a table is updated.
>
> my example is this: I have two tables with 'modified'
> fields...'families' and 'family_members'. models are Family hasMany
> FamiyMember, FamilyMember belongsTo Family.
>
> When I edit an existing family_member the 'modified' field gets
> updated in 'family_members' table. I would like 'modified' to get
> updated in the 'families' table as well. How can I do that?
>
> thanx in advance
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Regards,
Zaky Katalan-Ezra
QA Administrator
www.IGeneriX.com
Sites.IGeneriX.com
054-7762312

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

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