Re: Can someone explain ORM

2010-02-12 Thread WebbedIT
When using pagination with on the fly binds you need to specify the
last parameter as false to make the bind last for multiple queries.

$this->LocalInfo->bindModel(array('belongsTo'=>array(
  'Cat'=>array(
'foreignKey'=>false,
'type'=>'INNER',
'conditions'=>array('Subcat.cat_id = Cat.id')
  ),
  'Location'=>array(
'foreignKey'=>false,
'type'=>'INNER',
'conditions'=>array('Cat.location_id = Location.id')
  )
)), false);

When using contain and specifying deep relations they need to be done
as follows

$this->LocalInfo->Behaviors->attach('Containable');
$this->paginate['LocalInfo'] = array(
  'contain' => array('Subcat'=>array(
'Cat'=>array(
  'Location'
)
  )),
  'order' => 'LocalInfo.title'
);

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


getting Zend Lucene running in CakePHP 1.3

2010-02-12 Thread Zoltan
I've been running into a lot of problems getting Zend Framework's
Lucene module running.

Basically what I'm doing is:

Lucene is in the vendor folder (/Zend/Search/Lucene.php) along with a
file in the vendor folder:



I'm importing using:
App::import('Vendor', 'zend_include_path'); // the above file
App::import('Vendor', 'Zend_Search_Lucene', true, false, 'Zend/Search/
Lucene.php');

I'm running 1.6.2 of Zend because my XAMPP server is running PHP 5.2

Now it seems like things load ok, but I keep getting this error:
"Hex number is too big: 0x1 [CORE\Zend\Search\Lucene\Storage
\File.php"

Any idea what I might be missing?
Zoltan

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: Model Relations / Performance

2010-02-12 Thread Miles J
If the model you need can be found as the child of another model, use
that one.

Its the same as creating a new object of the same name. But using the
previous method stops you from instantiating duplicate objects.

On Feb 12, 1:07 pm, Dave  wrote:
> Just wondering if there is a performace loss when "chaining" models
> together such as $this->User->Player->Team->Division
>
> as oppsed to
> Controller::loadModel('Division');
> $this->Division->function($foo, $bar);
>
> Is it better to flow thru the relations or just grab the data directly
> rather than going thru the relationships if you need data from the end
> Model?

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


Model Relations / Performance

2010-02-12 Thread Dave
Just wondering if there is a performace loss when "chaining" models
together such as $this->User->Player->Team->Division

as oppsed to
Controller::loadModel('Division');
$this->Division->function($foo, $bar);

Is it better to flow thru the relations or just grab the data directly
rather than going thru the relationships if you need data from the end
Model?

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: Can someone explain ORM

2010-02-12 Thread koala kid
I just tried using Containable:

$this->LocalInfo->Behaviors->attach('Containable');
$this->paginate['LocalInfo'] = array(
'contain' => array('Subcat', 'Cat', 'Location'),
'order' => 'LocalInfo.title'
);

but got these errors:

Warning (512): Model "LocalInfo" is not associated with model
"Subcat" [CORE/cake/libs/model/behaviors/containable.php, line 340]
Warning (512): Model "LocalInfo" is not associated with model
"Cat" [CORE/cake/libs/model/behaviors/containable.php, line 340]
Warning (512): Model "LocalInfo" is not associated with model
"Location" [CORE/cake/libs/model/behaviors/containable.php, line 340]


On Feb 12, 2:54 pm, koala kid  wrote:
> Paul,
>
> I was just trying your bindModel trick on the index function of the
> same controller, but this one uses the Paginator component to make it
> easier for the user to sort through results. However doing this the
> bind doesn't seem to be taking place as I am getting SQL errors. Any
> suggestions?
>
> Warning (512): SQL Error: 1054: Unknown column 'Subcat.cat_id' in
> 'where clause' [CORE/cake/libs/model/datasources/dbo_source.php, line
> 525]
>
> $sql    =       "SELECT `Cat`.`id`, `Cat`.`title`, `Cat`.`location_id`,
> `Cat`.`created`, `Cat`.`modified` FROM `cats` AS `Cat`   WHERE
> `Subcat`.`cat_id` = `Cat`.`id`   "
> $error  =       "1054: Unknown column 'Subcat.cat_id' in 'where clause'"
>
> $sql    =       "SELECT `Location`.`id`, `Location`.`city`, 
> `Location`.`state`,
> `Location`.`country`, `Location`.`info`, `Location`.`order`,
> `Location`.`meta_url`, `Location`.`meta_title`,
> `Location`.`meta_desc`, `Location`.`meta_tags`, `Location`.`created`,
> `Location`.`modified` FROM `locations` AS `Location`   WHERE
> `Cat`.`location_id` = `Location`.`id`   "
> $error  =       "1054: Unknown column 'Cat.location_id' in 'where clause'"
>
> On Feb 12, 11:45 am, koala kid  wrote:
>
> > Paul, sorry for the late reply, I wasn't notified of your response.
> > Your trick worked like a charm, thanks man, I've been scratching my
> > head over this for ages. So it's not just me going crazy then, I am
> > having problems in a few places getting ORM to return my results, as I
> > am newish to Cake I kept thinking I must be doing something wrong, its
> > nice to know I'm not a complete idiot.
>
> > Thanks.
>
> > On Feb 11, 3:41 am, WebbedIT  wrote:
>
> > > Now people keep telling me that I am wrong here, but I have always had
> > > problems with deep belongsTo associations not being fetched with
> > > recursive alone.
>
> > > In your instance LocalInfo belongsTo Subcat which belongsTo Cat which
> > > belongsTo Location and your find recursive stops after the first
> > > belongsTo only finding LocalInfo and Subcat.
>
> > > There are a few things you can do.
>
> > > 1. Force a join from LocalInfo to Cat by doing the following in the
> > > controller before the find
>
> > > $this->LocalInfo->bindModel(array('belongsTo'=>array(
> > >   'Cat'=>array(
> > >     'foreignKey'=>false,
> > >     'type'=>'INNER',
> > >     'conditions'=>array('Subcat.cat_id = Cat.id')
> > >   )
> > > )), true);
>
> > > The last condition defaults to true so you dont actually need to pass
> > > it, but if your paginating results needs to be set to true to make the
> > > bind persistent otherwise the bind only exists for the first find that
> > > follows it.
>
> > > If you need also need data from Location you would need to bind that
> > > too as follows:
>
> > > $this->LocalInfo->bindModel(array('belongsTo'=>array(
> > >   'Cat'=>array(
> > >     'foreignKey'=>false,
> > >     'type'=>'INNER',
> > >     'conditions'=>array('Subcat.cat_id = Cat.id')
> > >   ),
> > >   'Location'=>array(
> > >     'foreignKey'=>false,
> > >     'type'=>'INNER',
> > >     'conditions'=>array('Cat.location_id = Location.id')
> > >   )
> > > )), true);
>
> > > 2. The 2nd option is to use containable, which I use all the time and
> > > is great as long as you're not needing to place any conditions on the
> > > deep tables, in which case you must do the above.
>
> > >http://book.cakephp.org/view/474/Containable
>
> > > HTH
>
> > > Paul.

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 to make a form post to named parameters ?

2010-02-12 Thread Miles J
I wouldn't use JS because you don't have access to Cakes functions.
Furthermore, if you use a Helper you want have the Controllers
functionality.

Its best to create a dummy action in the AppController, or use a
Component.

On Feb 12, 12:09 pm, "Greg S."  wrote:
> Oh, yes, come to think about it, that makes sense...
>
> Maybe another workaround would be to generate some bit of javascript
> that would intercept the submit event, and do a redirect with the
> named parameters.
>
> I'm going to write a component or a helper that does that.
>
> What do you think?
>
> On Feb 12, 8:45 pm, Miles J  wrote:
>
> > Its impossible, that functionality is part of HTTP and your browser.
>
> > The work around is posting to another page, and having that page
> > redirect with the named parameters.
>
> > I wrote a component that does this automatically, but I haven't really
> > tested it in a 
> > while:http://github.com/milesj/data_kit/blob/master/controllers/components/...
>
> > On Feb 12, 11:37 am, "Greg S."  wrote:
>
> > > Hi guys,
>
> > > I have a simple form in my view. Currently, the form is posting the
> > > data back to my controller. I would like to post the data to named
> > > parameters instead.
>
> > > Say for example I have this :
>
> > >  > >   echo $form->create(false, array('action' => 'index'));
> > >   echo $form->input('search');
> > >   echo $form->end('search');
> > > ?>
>
> > > How do I make this form load the 
> > > urlwww.example.com/controller/search:some+keywords
> > > ?
>
> > > I've tried setting 'type'=>'get' in the $form->create options array,
> > > but it will generate a ugly, old-fashioned url instead of using the
> > > nice named parameters.
>
> > > Any ideas ?
>
> > > 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: How to make a form post to named parameters ?

2010-02-12 Thread Greg S.
Oh, yes, come to think about it, that makes sense...

Maybe another workaround would be to generate some bit of javascript
that would intercept the submit event, and do a redirect with the
named parameters.

I'm going to write a component or a helper that does that.

What do you think?


On Feb 12, 8:45 pm, Miles J  wrote:
> Its impossible, that functionality is part of HTTP and your browser.
>
> The work around is posting to another page, and having that page
> redirect with the named parameters.
>
> I wrote a component that does this automatically, but I haven't really
> tested it in a 
> while:http://github.com/milesj/data_kit/blob/master/controllers/components/...
>
> On Feb 12, 11:37 am, "Greg S."  wrote:
>
>
>
> > Hi guys,
>
> > I have a simple form in my view. Currently, the form is posting the
> > data back to my controller. I would like to post the data to named
> > parameters instead.
>
> > Say for example I have this :
>
> >  >   echo $form->create(false, array('action' => 'index'));
> >   echo $form->input('search');
> >   echo $form->end('search');
> > ?>
>
> > How do I make this form load the 
> > urlwww.example.com/controller/search:some+keywords
> > ?
>
> > I've tried setting 'type'=>'get' in the $form->create options array,
> > but it will generate a ugly, old-fashioned url instead of using the
> > nice named parameters.
>
> > Any ideas ?
>
> > 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: Can someone explain ORM

2010-02-12 Thread koala kid
Paul,

I was just trying your bindModel trick on the index function of the
same controller, but this one uses the Paginator component to make it
easier for the user to sort through results. However doing this the
bind doesn't seem to be taking place as I am getting SQL errors. Any
suggestions?

Warning (512): SQL Error: 1054: Unknown column 'Subcat.cat_id' in
'where clause' [CORE/cake/libs/model/datasources/dbo_source.php, line
525]

$sql=   "SELECT `Cat`.`id`, `Cat`.`title`, `Cat`.`location_id`,
`Cat`.`created`, `Cat`.`modified` FROM `cats` AS `Cat`   WHERE
`Subcat`.`cat_id` = `Cat`.`id`   "
$error  =   "1054: Unknown column 'Subcat.cat_id' in 'where clause'"

$sql=   "SELECT `Location`.`id`, `Location`.`city`, `Location`.`state`,
`Location`.`country`, `Location`.`info`, `Location`.`order`,
`Location`.`meta_url`, `Location`.`meta_title`,
`Location`.`meta_desc`, `Location`.`meta_tags`, `Location`.`created`,
`Location`.`modified` FROM `locations` AS `Location`   WHERE
`Cat`.`location_id` = `Location`.`id`   "
$error  =   "1054: Unknown column 'Cat.location_id' in 'where clause'"

On Feb 12, 11:45 am, koala kid  wrote:
> Paul, sorry for the late reply, I wasn't notified of your response.
> Your trick worked like a charm, thanks man, I've been scratching my
> head over this for ages. So it's not just me going crazy then, I am
> having problems in a few places getting ORM to return my results, as I
> am newish to Cake I kept thinking I must be doing something wrong, its
> nice to know I'm not a complete idiot.
>
> Thanks.
>
> On Feb 11, 3:41 am, WebbedIT  wrote:
>
> > Now people keep telling me that I am wrong here, but I have always had
> > problems with deep belongsTo associations not being fetched with
> > recursive alone.
>
> > In your instance LocalInfo belongsTo Subcat which belongsTo Cat which
> > belongsTo Location and your find recursive stops after the first
> > belongsTo only finding LocalInfo and Subcat.
>
> > There are a few things you can do.
>
> > 1. Force a join from LocalInfo to Cat by doing the following in the
> > controller before the find
>
> > $this->LocalInfo->bindModel(array('belongsTo'=>array(
> >   'Cat'=>array(
> >     'foreignKey'=>false,
> >     'type'=>'INNER',
> >     'conditions'=>array('Subcat.cat_id = Cat.id')
> >   )
> > )), true);
>
> > The last condition defaults to true so you dont actually need to pass
> > it, but if your paginating results needs to be set to true to make the
> > bind persistent otherwise the bind only exists for the first find that
> > follows it.
>
> > If you need also need data from Location you would need to bind that
> > too as follows:
>
> > $this->LocalInfo->bindModel(array('belongsTo'=>array(
> >   'Cat'=>array(
> >     'foreignKey'=>false,
> >     'type'=>'INNER',
> >     'conditions'=>array('Subcat.cat_id = Cat.id')
> >   ),
> >   'Location'=>array(
> >     'foreignKey'=>false,
> >     'type'=>'INNER',
> >     'conditions'=>array('Cat.location_id = Location.id')
> >   )
> > )), true);
>
> > 2. The 2nd option is to use containable, which I use all the time and
> > is great as long as you're not needing to place any conditions on the
> > deep tables, in which case you must do the above.
>
> >http://book.cakephp.org/view/474/Containable
>
> > HTH
>
> > Paul.

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 to make a form post to named parameters ?

2010-02-12 Thread Miles J
Its impossible, that functionality is part of HTTP and your browser.

The work around is posting to another page, and having that page
redirect with the named parameters.

I wrote a component that does this automatically, but I haven't really
tested it in a while: 
http://github.com/milesj/data_kit/blob/master/controllers/components/proxy.php

On Feb 12, 11:37 am, "Greg S."  wrote:
> Hi guys,
>
> I have a simple form in my view. Currently, the form is posting the
> data back to my controller. I would like to post the data to named
> parameters instead.
>
> Say for example I have this :
>
>    echo $form->create(false, array('action' => 'index'));
>   echo $form->input('search');
>   echo $form->end('search');
> ?>
>
> How do I make this form load the 
> urlwww.example.com/controller/search:some+keywords
> ?
>
> I've tried setting 'type'=>'get' in the $form->create options array,
> but it will generate a ugly, old-fashioned url instead of using the
> nice named parameters.
>
> Any ideas ?
>
> 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


How to make a form post to named parameters ?

2010-02-12 Thread Greg S.
Hi guys,

I have a simple form in my view. Currently, the form is posting the
data back to my controller. I would like to post the data to named
parameters instead.

Say for example I have this :

create(false, array('action' => 'index'));
  echo $form->input('search');
  echo $form->end('search');
?>

How do I make this form load the url 
www.example.com/controller/search:some+keywords
?

I've tried setting 'type'=>'get' in the $form->create options array,
but it will generate a ugly, old-fashioned url instead of using the
nice named parameters.

Any ideas ?

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


[OT] Redis, Memcached and CakePHP

2010-02-12 Thread Pablo Viojo
Sorry for the OT and the quite general questions

Has anybody used Redis and Memcached with a CakePHP app?

Any comments about performance, scalability, etc will be great appreciated

Thanks in advance!

Regards

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

¿Que necesitas?
http://www.needish.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: Can't configure Memcached properly

2010-02-12 Thread Pablo Viojo
I was having issues using memcached for cake internal cache and memcached
has a maximum size for each stored object (1 MB) so I prefer to use File for
the internal cache. I defined

Cache::config('_cake_core_', array('engine' => 'File'));
Cache::config('_cake_model_', array('engine' => 'File'));

before

Cache::config('default', ...

If you do this, remember to check if app/tmp/cache/models
 app/tmp/cache/persistent and app/tmp/cache/views exists and has read/write
privileges


Regards

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

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


On Fri, Feb 12, 2010 at 3:08 PM, Kareem Sabri  wrote:

> Thanks for the tip. However, that didn't solve the issue.
>
> Any other advice?
>
> On Feb 12, 5:55 am, majna  wrote:
> > Example:
> >
> >  Cache::config('default', array(
> >   'engine' => 'Memcache', //[required]
> >   'duration'=> 30, //[optional]
> >   'servers' => array('192.168.1.11:11211 '),
> >   'compress' => false,
> >   ));
> >
> > use your server IP
> >
> > On Feb 11, 11:43 pm, Kareem Sabri  wrote:
> >
> >
> >
> > > Hello,
> >
> > > Hopefully someone can help me out here.
> >
> > > I have installed Memcached and all its dependencies. I have verified
> > > it is running correctly and I can connect via port 11211 (in command
> > > line, not with cake)
> >
> > > My core.config is the default:
> >
> > > Cache::config('default',
> > > array(
> > > 'engine' => 'Memcache',
> > > 'duration' => 30
> > > )
> > > );
> >
> > > I am running on a Linux box, no issues with Windows I saw on some
> > > other threads. And I haven't modified the default directory structure
> > > at all, everything is currently in my public_html directory.
> >
> > > However, I get: Warning (512): Cache not configured properly. Please
> > > check Cache::config(); in APP/config/core.php [CORE/cake/libs/
> > > configure.php, line 663] and Cake falls back to using the FileEngine
> > > for Cacheing.
> >
> > > Any help would be greatly appreciated, 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.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: Can't configure Memcached properly

2010-02-12 Thread Kareem Sabri
Thanks for the tip. However, that didn't solve the issue.

Any other advice?

On Feb 12, 5:55 am, majna  wrote:
> Example:
>
>  Cache::config('default', array(
>               'engine' => 'Memcache', //[required]
>               'duration'=> 30, //[optional]
>               'servers' => array('192.168.1.11:11211 '),
>               'compress' => false,
>       ));
>
> use your server IP
>
> On Feb 11, 11:43 pm, Kareem Sabri  wrote:
>
>
>
> > Hello,
>
> > Hopefully someone can help me out here.
>
> > I have installed Memcached and all its dependencies. I have verified
> > it is running correctly and I can connect via port 11211 (in command
> > line, not with cake)
>
> > My core.config is the default:
>
> >         Cache::config('default',
> >                 array(
> >                         'engine' => 'Memcache',
> >                         'duration' => 30
> >                 )
> >         );
>
> > I am running on a Linux box, no issues with Windows I saw on some
> > other threads. And I haven't modified the default directory structure
> > at all, everything is currently in my public_html directory.
>
> > However, I get: Warning (512): Cache not configured properly. Please
> > check Cache::config(); in APP/config/core.php [CORE/cake/libs/
> > configure.php, line 663] and Cake falls back to using the FileEngine
> > for Cacheing.
>
> > Any help would be greatly appreciated, 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: Saving related table data

2010-02-12 Thread koala kid
Hi John,

thanks for your fix, its now working. I had assumed that as I was
defining the relationship as a hasOne and belongsTo Cake would
automatically know to Update rather than Insert as it was a 1 - 1
relationship, using the Rental.id.

This is where I am really struggling with Cake, so much is taken care
for you that you don't know where it stops, and the documentation,
although much improved, still makes it hard on occasion to find out.

Anyway thanks again.

On Feb 11, 3:02 am, John Andersen  wrote:
> Your problem lies in this part:
>
>     [Rate] => Array
>         (
>             [s1_title] => title 1
>             [s1_day] => day 1
>             [s1_week] =>
>             [s1_month] =>
>             [extra_info] =>
>         )
>
> I assume that this information was at first retrieved from the
> database and presented to the user. The user then changed something
> and saved.
>
> The above information lacks the Rate.id information - without which
> CakePHP assumes that you are saving a new record in the Rate model.
>
> You have to add the Rate.id as a hidden field in the view (worst
> solution) or get it from somewhere else.
> Hope this will help you on the way,
>    John
>
> On Feb 10, 8:09 pm, koala kid  wrote:
>
> > Hi, I'm still struggling with saving information to related tables. I
> > have a form which updates info about a rental property and I have an
> > associated Rates table which holds data about the rental rates for the
> > property.
>
> > I've defined my relationship as :
>
> > Rental -> hasOne
> > Rate -> belongsTo
>
> > My save action looks like this:
>
> > $this->Rental->saveAll($this->data);
>
> > However this save action is creating a new entry in the Rates table
> > rather than updating the existing one. I'm pretty sure my form data is
> > in the correct format:
>
> > Array
> > (
> >     [Rental] => Array
> >         (
> >             [id] => 45
> >             [rental_code] => PDSSerena
> >             [location_id] => 19
> >             [rental_agent] =>
> >             [rental_meta_url] =>
> >             [rental_meta_title] =>
> >             [rental_meta_desc] =>
> >             [rental_meta_tags] =>
> >         )
>
> >     [Rate] => Array
> >         (
> >             [s1_title] => title 1
> >             [s1_day] => day 1
> >             [s1_week] =>
> >             [s1_month] =>
> >             [extra_info] =>
> >         )
>
> > )
>
> > Do I need to explicitly set the rental_id in my Rate form data, such
> > as:
>
> > [Rate] => Array
> >         (
> >             [rental_id] => 45
> >         )

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: Can someone explain ORM

2010-02-12 Thread koala kid
Paul, sorry for the late reply, I wasn't notified of your response.
Your trick worked like a charm, thanks man, I've been scratching my
head over this for ages. So it's not just me going crazy then, I am
having problems in a few places getting ORM to return my results, as I
am newish to Cake I kept thinking I must be doing something wrong, its
nice to know I'm not a complete idiot.

Thanks.

On Feb 11, 3:41 am, WebbedIT  wrote:
> Now people keep telling me that I am wrong here, but I have always had
> problems with deep belongsTo associations not being fetched with
> recursive alone.
>
> In your instance LocalInfo belongsTo Subcat which belongsTo Cat which
> belongsTo Location and your find recursive stops after the first
> belongsTo only finding LocalInfo and Subcat.
>
> There are a few things you can do.
>
> 1. Force a join from LocalInfo to Cat by doing the following in the
> controller before the find
>
> $this->LocalInfo->bindModel(array('belongsTo'=>array(
>   'Cat'=>array(
>     'foreignKey'=>false,
>     'type'=>'INNER',
>     'conditions'=>array('Subcat.cat_id = Cat.id')
>   )
> )), true);
>
> The last condition defaults to true so you dont actually need to pass
> it, but if your paginating results needs to be set to true to make the
> bind persistent otherwise the bind only exists for the first find that
> follows it.
>
> If you need also need data from Location you would need to bind that
> too as follows:
>
> $this->LocalInfo->bindModel(array('belongsTo'=>array(
>   'Cat'=>array(
>     'foreignKey'=>false,
>     'type'=>'INNER',
>     'conditions'=>array('Subcat.cat_id = Cat.id')
>   ),
>   'Location'=>array(
>     'foreignKey'=>false,
>     'type'=>'INNER',
>     'conditions'=>array('Cat.location_id = Location.id')
>   )
> )), true);
>
> 2. The 2nd option is to use containable, which I use all the time and
> is great as long as you're not needing to place any conditions on the
> deep tables, in which case you must do the above.
>
> http://book.cakephp.org/view/474/Containable
>
> HTH
>
> Paul.

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: Pagination: URL for last page

2010-02-12 Thread Ragnis
No, i need the url.
I want to put that link on other site.

On Feb 2, 7:13 pm, Jeremy Burns  wrote:
> echo $paginator->last('>>');
>
> Jeremy Burns
>
> On 2 Feb 2010, at 17:11, Ragnis wrote:
>
>
>
> > How can i go to the last page, if i don't know the count of items?
>
> > 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: simple question about CakePHP syntax

2010-02-12 Thread majna
http://hr.php.net/manual/en/language.types.string.php

On Feb 12, 12:50 pm, sebb86  wrote:
> Hello,
>
> i have a question about some signs. Is the use of this   "sample"
> always equal to this   'sample'  ?
>
> 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: Email doesn't work

2010-02-12 Thread bujanga
Are you able to send email using the PHP mail function? See
http://us3.php.net/manual/en/function.mail.php

Gary

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: "Powered by" CakePHP logos?

2010-02-12 Thread sphereweb
http://www.pixelsaur.us/themed/default/img/cakephp-logo.gif

On Feb 11, 9:21 pm, Raven  wrote:
> Still wondering if anyone knows of any collections or uses any
> different cake icons...

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


cakephp and google data (especially contacts API)?

2010-02-12 Thread euromark
i could not find anything on google data API in cake
zend for example has quite a powerful library build in

wouldnt that be something awesome cake should have too?
it would then be possible to easily exchange all kinds of information
with different google APIs.
i am especially interested in some kind of datasource, lib class or
component which is able to work on the new "contacts API" in order to
sync google mail contacts with contacts in my app

re-building the zend framework classes for cake could be a real big
deal i imagine...
but we could focus on those few important ones
might be worth creating a enhancement ticket

or has anyone already built something similar? using core httpsocket
and xml classes?

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: Web Service cakePHP

2010-02-12 Thread Chad Smith
Ivan,

I know there are a lot of Web Services out there that are using cake.
Mostly because Cake offers a lot of flexibility with the ability of
creating subdomains and using the bootstrap file to grab the subdomain
and pass the $_GET['url'] with the name of the account being the
subdomain.

I've setup a major service named The Easy API, you can find it at
http://theeasyapi.com what we do is provide an API that interfaces and
standardizes other API's together into one commonly accessible API.
Another one I setup is County Criminal at http://www.countycriminal.com
where it offers an API in the backend and also uses a lot of sub-
domain rewriting but is all done with cake.

Web services have a lot of advantages, the main one being the ability
to update your code without having to send program updates.  It also
allows you to have control over security and new features.  Web
services are really powerful because it doesn't rely on the person who
is using the web service's server.  Most the time when you get new
software the software has to ensure it will work on whatever machine
it's going on.  Not true with Web Services, since the modern web
services operate without dependencies on the remote server.

Take care and hope I answered your question,
Chad

On Feb 10, 11:52 pm, ivan  wrote:
> Please give me teory to webservice cakePHP. How webservice CakePHP
> work? What the advantages of using webservice in cakePHP?

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: Email doesn't work

2010-02-12 Thread anl hp
I always use smtp delivery, try using this

--
anl


On Fri, Feb 12, 2010 at 2:27 PM, szusty  wrote:

> Hi all.
>
> I have a problem with Email i cakePHP. I'm check a example from
> http://book.cakephp.org/pl/view/269/Sending-a-basic-message end nothig
> do. So I'm find a some other example and I don't know why against
> don't work mi ;/
>
> Please help mi.
>
>
>  class MailerController extends AppController {
>
>var $name = 'Mailer';
>
>var $uses = '';
>
>
>function sendSimpleMail() {
>$this->Email->to = 'ass...@o2.pl';
>$this->Email->subject = 'Cake test simple email';
>$this->Email->replyTo = 'nore...@example.com';
>$this->Email->from = 'Cake Test Account
> ';
>$this->Email->template = null;
>
>if ( $this->Email->send('Here is the body of the email') ) {
>$this->Session->setFlash('Simple email sent');
>} else {
>$this->Session->setFlash('Simple email not sent');
>}
>$this->redirect('/');
>}
> }
> ?>
>
>
> This code should be work but I also hawe info 'Simple email not
> sent' ;/
>
> 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


Email doesn't work

2010-02-12 Thread szusty
Hi all.

I have a problem with Email i cakePHP. I'm check a example from
http://book.cakephp.org/pl/view/269/Sending-a-basic-message end nothig
do. So I'm find a some other example and I don't know why against
don't work mi ;/

Please help mi.


Email->to = 'ass...@o2.pl';
$this->Email->subject = 'Cake test simple email';
$this->Email->replyTo = 'nore...@example.com';
$this->Email->from = 'Cake Test Account
';
$this->Email->template = null;

if ( $this->Email->send('Here is the body of the email') ) {
$this->Session->setFlash('Simple email sent');
} else {
$this->Session->setFlash('Simple email not sent');
}
$this->redirect('/');
}
}
?>


This code should be work but I also hawe info 'Simple email not
sent' ;/

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: CSV file not working in live server

2010-02-12 Thread Annamalai
Hi i used a CSV helper from
> http://bakery.cakephp.org/articles/view/csv-helper-php5..
> my problem is in my local its working properly , while i export working
> fine..
> in my live server whe i export, the contents opening in other window with a
> text data.. what i need to do
> any 777 permission to any where ??
>
> Please 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
<<333.png>>

Re: How to include a button which links to a view?

2010-02-12 Thread sebb86
Hello all,

i finally got it working!!! :-)

i merged some ideas i found in the google-group, so the following code
works for me. It is an image, which links to a delete-view and it
outputs a confirm message with the current row number (id).

[code]
link($html->image("delete.png", array("alt" =>
"delete", "title" => "delete")), $html -> url(array("controller" =>
"sample_controllers", "action" => "delete", $row['SampleController']
['id'])), array(), sprintf(__('Are you sure you want to delete # %s?',
true), $row['SampleController']['id']), false); ?>
[/code]

With "title", you can show something when you move the mouse over the
image.

Hope this helps!

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: confirm message

2010-02-12 Thread sebb86
arif, paulos

Hello,

i merged your ideas, this code works for me. It is a image, which
links to a view and it outputs a confirm message with the current row
number (id).
I used this for a delete option.

[code]
link($html->image("delete.png", array("alt" =>
"delete", "title" => "delete")), $html -> url(array("controller" =>
"sample_controllers", "action" => "delete", $row['SampleController']
['id'])), array(), sprintf(__('Are you sure you want to delete # %s?',
true), $row['SampleController']['id']), false); ?>
[/code]

With "title", it appears "title" => "value" when you move the mouse
over the image.

Hope this helps!

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


simple question about CakePHP syntax

2010-02-12 Thread sebb86
Hello,

i have a question about some signs. Is the use of this   "sample"
always equal to this   'sample'  ?

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: Creating new rows

2010-02-12 Thread anl hp
try with this:

$itemId = $this->getLastInsertID();


--
anl


On Fri, Feb 12, 2010 at 12:07 PM, Jeremy Burns  wrote:

> I have this function in the items model:
>
> function addNewItem() {
>
>$this->save();
>
>$itemId = $this->id;
>
>return $itemId;
>
> }
>
> When called from a controller it does what it is supposed to do;
> creates a new row in the table and returns the id of the new row.
>
> Here's the odd part; it is creating two rows in the database and
> returning the id of the first row. So if the returned id is 100, I'll
> also find id 101 in the table. Any ideas what might be going wrong?
>
> 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


Creating new rows

2010-02-12 Thread Jeremy Burns
I have this function in the items model:

function addNewItem() {

$this->save();

$itemId = $this->id;

return $itemId;

}

When called from a controller it does what it is supposed to do;
creates a new row in the table and returns the id of the new row.

Here's the odd part; it is creating two rows in the database and
returning the id of the first row. So if the returned id is 100, I'll
also find id 101 in the table. Any ideas what might be going wrong?

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: Can't configure Memcached properly

2010-02-12 Thread majna
Example:

 Cache::config('default', array(
  'engine' => 'Memcache', //[required]
  'duration'=> 30, //[optional]
  'servers' => array('192.168.1.11:11211 '),
  'compress' => false,
  ));

use your server IP

On Feb 11, 11:43 pm, Kareem Sabri  wrote:
> Hello,
>
> Hopefully someone can help me out here.
>
> I have installed Memcached and all its dependencies. I have verified
> it is running correctly and I can connect via port 11211 (in command
> line, not with cake)
>
> My core.config is the default:
>
>         Cache::config('default',
>                 array(
>                         'engine' => 'Memcache',
>                         'duration' => 30
>                 )
>         );
>
> I am running on a Linux box, no issues with Windows I saw on some
> other threads. And I haven't modified the default directory structure
> at all, everything is currently in my public_html directory.
>
> However, I get: Warning (512): Cache not configured properly. Please
> check Cache::config(); in APP/config/core.php [CORE/cake/libs/
> configure.php, line 663] and Cake falls back to using the FileEngine
> for Cacheing.
>
> Any help would be greatly appreciated, 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: address bar contain database names

2010-02-12 Thread WebbedIT
Hard to tell from a URL alone, but looks like the site is searching
using javascript and serialized data, how about using a form and
posting that data?

Not sure why a search request would include all those field names
mind?!?

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: Getting values from drop down select

2010-02-12 Thread Annamalai
In controller set
 $states = $this->State->find('list',array(
'conditions' => array(
'State.is_active = ' => 1
),'fields' =>array('State.id','State.name'), 'recursive' => -1));


$this->set('states',$states);

and try in ur view


On Fri, Feb 12, 2010 at 7:48 AM, aveev  wrote:

>
> I want to get value from a table to be populated in drop down select in a
> form. Here's the table and the fields for example:
> States
> fields:id, name
> In add function in StatesController, I add this piece of code (as I learnt
> from the tutorial):
> $state = $this->State->find('list');
> $this->set('states',$state);
>
> and I add this code in my view:
> echo $form->select('state', array($states));
>
> when I debug the value of state drop down select, what I get is the id of
> state, not the name...what I want is the name, not the id..How can I do
> that
> ?
> Any help would be appreciated..
> Thanks...
>
>
> --
> View this message in context:
> http://old.nabble.com/Getting-values-from-drop-down-select-tp27557819p27557819.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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
(¨`·.·´¨)
 `·.¸(¨`·.·´¨)
`·.¸.·´  S.Annamalai

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 to include a button which links to a view?

2010-02-12 Thread Jeremy Burns
I agree, but sites must degrade nicely. With no java, the standard baked delete 
function deletes without warning. That is not nice degradation. If a site 
doesn't reorder a list without refreshing the page, that's OK.

Jeremy Burns
jeremybu...@me.com


On 12 Feb 2010, at 10:20, WebbedIT wrote:

>> I struggled with this for while as I don't like relying on java being 
>> switched on.
> 
> I think the worry as to whether javascript is turned on or not is
> becoming more and more mute.  Look at really big sites/applications,
> they heavily rely on javascript for a lot of their features yet it
> does not negatively impact on their global online dominance.
> 
> How many Web 2.0 (for want of a better term) sites do not use Ajax?
> Take Ebay's ability to alter the ordering of their listing pages, turn
> off javascript it's rendered useless.
> 
> Is this a case of coding for the minority at the detriment of the
> majority?
> 
> @ Guillermo: if you agree that the use of javascript is not an issue
> then you use the following
> 
> $html->link('Delete', array('action' => 'delete', $row['Model']
> ['id']), null, 'Are you sure?')
> 
> It's part of Cake's core automagic so the dev team obviously don't
> have a problem with relying on javascript.
> 
> 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: How to include a button which links to a view?

2010-02-12 Thread WebbedIT
> I struggled with this for while as I don't like relying on java being 
> switched on.

I think the worry as to whether javascript is turned on or not is
becoming more and more mute.  Look at really big sites/applications,
they heavily rely on javascript for a lot of their features yet it
does not negatively impact on their global online dominance.

How many Web 2.0 (for want of a better term) sites do not use Ajax?
Take Ebay's ability to alter the ordering of their listing pages, turn
off javascript it's rendered useless.

Is this a case of coding for the minority at the detriment of the
majority?

@ Guillermo: if you agree that the use of javascript is not an issue
then you use the following

 $html->link('Delete', array('action' => 'delete', $row['Model']
['id']), null, 'Are you sure?')

It's part of Cake's core automagic so the dev team obviously don't
have a problem with relying on javascript.

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


CSV file not working in live server

2010-02-12 Thread Annamalai
Hi i used a CSV helper from
http://bakery.cakephp.org/articles/view/csv-helper-php5..
my problem is in my local its working properly , while i export working
fine..
in my live server whe i export, the contents opening in other window with a
text data.. what i need to do
any 777 permission to any where ??

Please 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
<<333.png>>

Re: How to include a button which links to a view?

2010-02-12 Thread sebb86
Guillermo

No, i'd like something like a pop-up warning window, which says: "are
you sure you want to delete?".
Is this possible with an image-link?

[code]
image("delete.png", array("alt" => "delete",
'url' => array('controller' => 'hardware_units', 'action' => 'delete',
'id' => $hardware_unit['HardwareUnit']['id'])));?>
[\code]

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: sanitize and redirect

2010-02-12 Thread Nicolas Maleve
Thanks. If I get the principle right, there are two moments where
sanitizing must take place:
- before sending parameters in custom queries
- before output in the views with h()

,n
Le Jeu 11 février 2010 19:48, anl hp a écrit :
> Not you don't ... because you should not worry about that, if an id is
> invalid and you want handle the situation elegant, you could do something
> like this:
> if (!is_numeric($id)) {
>   $this->setFlash('ooopss, dont do that!');
>   $this->redirect();
> }
>
>
> anl
>
>
> On Thu, Feb 11, 2010 at 7:05 PM, Nicolas Maleve
> wrote:
>
>> Hello,
>>
>> Just a doubt. It looks like Cake takes care of sanitizing data in save
>> and
>> find, ie. Do I need to sanitize $id when using
>> $this->redirect(array('action'=>'edit','id'=>$id)); Or is there some
>> cleaning happening inside redirect?
>>
>> Thanks
>>
>> nicolas
>>
>>
>> *
>>*
>>  *
>>  *
>>   *
>> *
>>   *
>>  *
>>  *
>>  C O N S T A N T
>>   V Z W
>>
>>
>>
>>
>> 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
>


 *
*
  *
  *
   *
 *
   *
  *
  *
  C O N S T A N T
   V Z W




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