HABTM with an extra field (saving)

2010-10-08 Thread jwerd
I have an issue where my HABTM save isn't quite working.  I mean it
is, but it's throwing a few notices to Cake, which I'm concerned
about:
Notice (8): Undefined index: id [CORE/cake/libs/model/model.php, line
1391]
Notice (8): Undefined index: id [CORE/cake/libs/model/model.php, line
1329]

I know if I turn off debug, these messages won't show but still, it's
a cause for concern for me.

So I have 3 tables in total...

reviews table:
id
title
(more fields, but irrelevant)

criterias table
id
title
(more fields but irrelevant)

and a joining table, which is HABTM

criteria_review table
criteria_id
review_id
value *

* that's the extra field I'm talking about.

now, in my view code, I copied the way the standard automagic multi-
select named stuff and came up with this:

Form->input('Criteria.Criteria.'.
$i.'.criteria_id', array('label' => false, 'type'=>'hidden', 'value'=>
$key)); ?>
Form->input('Criteria.Criteria.'.$i.'.value',
array('label' => false, 'type'=>'select', 'options'=>array('1'=>'1 out
of 5','2'=>'2 out of 5','3'=>'3 out of 5','4'=>'4 out of 5','5'=>'5
out of 5'))); ?>

It saves ok, but it throws those notices up there.  Any ideas on what
I'm doing wrong or what could be causing that?

Or if you have a better way to deal with EXACTLY what I'm going thru,
please, by all means, explain your way.

Thanks,
Jake

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: Header already sent error after saving data.

2010-10-08 Thread Ashwani Kumar
Thanks a lot for your help.

You're absolutely right "This usually happens if you have ANY character
printed out before the view actually renders. It can be a single space after
the closing php tag of a php file (controller, model, ...)."

Actually, I had a lot of space in my model file after closing php tags ?>.
So i removed closing php tag from my model file and it worked just fine.

So, I've just one think to ask to you that should i skip closing php tag in
my every controller and model file. and can i also skip in view file 

Thank you once again...

On Fri, Oct 8, 2010 at 11:25 PM, euromark wrote:

> This usually happens if you have ANY character printed out before the
> view actually renders. It can be a single space after the closing php
> tag of a php file (controller, model, ...). Therefore you should not
> use ?> at the end of php files (CakePHP took the same path in summer
> 2010). It prevents this from happening.
>
>
> On 8 Okt., 19:23, Ashwani Kumar  wrote:
> > Hi all
> >I'm trying to save some data using add() method in cakephp. This is
> > add () method :
> >
> > function add() {
> > if (!empty($this->data)){
> > if ($this->Book->save($this->data)) {
> > $this->Session->setFlash('Data
> has been saved Successfully!',
> > true);
> > $this->redirect(array('action' =>
> 'index'));
> > }
> > }
> > }
> > Data is getting saved, but i'm getting following error
> onhttp://localhost/data-access/books/addpage.
> >
> > Warning (2): Cannot modify header information - headers already sent
> > by (output started at C:\webs\test\data-access\models\book.php:8) [CORE
> > \cake\libs\controller\controller.php, line 644]
> >
> > 3 queries took 8 ms Nr  Query   Error   AffectedNum. rows
> Took (ms)
> > 1   DESCRIBE `books`5   5   7
> > 2   INSERT INTO `books` (`isbn`, `title`, `description`,
> `author_name`)
> > VALUES ('123', 'test book', 'hi! this is a test.', 'author xyz')
>1   1
> > 3   SELECT LAST_INSERT_ID() AS insertID 1   1   0
> >
> > I'm not a cakephp expert, rather i'm learning cakephp. Any reply will
> > be appreciated. Thanks in advanced.
> >
> > Ashwani
> > ashwani.mail...@gmail.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
>

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: Redirect to XML

2010-10-08 Thread nurvzy
Read through the RequestHandler area of the cookbook then head over to
parse extension part of the router section.  Lastly take a look at the
XML helper to output your content into xml.  You'll get a good head
start on all you'll need to do to accomplish this.

http://book.cakephp.org/view/1291/Request-Handling

http://book.cakephp.org/view/945/Routes-Configuration#File-extensions-952

http://book.cakephp.org/view/1473/XML

The basic idea is pretty simple.
1) Setup your app to receive xml extensions
Router::parseExtension('xml');

2) Now setup an xml layout and view wherever you need it.  Use the XML
helper in those areas.
Create Layout views/layouts/xml/default.ctp
Create Controller/Action xml views
 -- views/some_controller/xml/some_action.ctp

3) Now that you have that all setup you can detect incoming extensions
and parse them however you choose with either the Router, or
RequestHandler.
function beforeFilter(){
  if($this->RequestHandler->isMobile()){
$this->redirect(array('ext' => 'xml'));
  }
}

That will redirect any action to its xml view if the incoming request
is detected as a mobile device.

Hope that gets you started.  Good luck!

Nick

On Oct 8, 4:55 pm, calzone  wrote:
> I may be totally wrong, but my inclination would be to code it in
> beforeFilter() in app_controller.php... set the layout, the response
> type, and a flag in there
>
> On Oct 8, 3:07 pm, Jonas  wrote:
>
>
>
>
>
>
>
> > Hello,
>
> > I am creating a mobile application interface and I'd like to call the
> > regular webbaddresses but redirect the output to an XML view instead
> > of a HTML one.
>
> > Where do I add this functionality the simplest way? Do I just make a
> > check in beforeFilter if it's coming in from a mobile device or is
> > there a better way?
>
> > Thank you,
>
> > Regards,
> > Jonas

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


Protect against XSS attacks but keep usual html

2010-10-08 Thread huoxito
I was wondering if every time I'd display some data I have to Sanatize
data against XSS attacks?

And also It seems to me that cakephp Sanitize Component can't sanatize
against XSS attacs and keep the sytles of a text

How do you clean your data against XSS and still keep styles in 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: Redirect to XML

2010-10-08 Thread calzone
I may be totally wrong, but my inclination would be to code it in
beforeFilter() in app_controller.php... set the layout, the response
type, and a flag in there

On Oct 8, 3:07 pm, Jonas  wrote:
> Hello,
>
> I am creating a mobile application interface and I'd like to call the
> regular webbaddresses but redirect the output to an XML view instead
> of a HTML one.
>
> Where do I add this functionality the simplest way? Do I just make a
> check in beforeFilter if it's coming in from a mobile device or is
> there a better way?
>
> Thank you,
>
> Regards,
> Jonas

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


Redirect to XML

2010-10-08 Thread Jonas
Hello,

I am creating a mobile application interface and I'd like to call the
regular webbaddresses but redirect the output to an XML view instead
of a HTML one.

Where do I add this functionality the simplest way? Do I just make a
check in beforeFilter if it's coming in from a mobile device or is
there a better way?

Thank you,

Regards,
Jonas

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: Plug-in Models

2010-10-08 Thread Dave Maharaj
Thanks!

Will give it a go.

Dave

-Original Message-
From: Miles J [mailto:mileswjohn...@gmail.com] 
Sent: October-08-10 6:46 PM
To: CakePHP
Subject: Re: Plug-in Models

That is how you use it. If you want to use plugin models within a
plugin, you must define the plugin.

public $uses = array('User' => array('className' => 'Member.User'));

On Oct 7, 6:46 pm, "Dave Maharaj"  wrote:
> I have various controllers such as confirmations, passwords, members that
I
> would like to package as a plugin to keep them in 1 spot. So going thru
the
> cookbook it mentions nothing about using existing models within a plugin.
>
> My Member plugin will use the regular User model. How can this be done?
>
> 
>                 var $name = 'MemberConfirmation';
>
> var $uses = array('User');
>
> }
>
> ?>
>
> Something like that?
>
> Any insight would be great. First attempt so bare with me.
>
> 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: App::objects

2010-10-08 Thread euromark
darn^^
this 3rd parameter cache was somehow invoked before (defaults to true)
and it used a cached version
fixed it

On 8 Okt., 23:07, euromark  wrote:
> App::objects just doesnt look under the app controller folder
>
> i would expect
> App::objects('controller');
> or
> App::objects('controller', APP.'controllers'.DS);
> to look in /app/controllers
>
> but if I call this function inside a plugin it will just give me the
> plugin controllers
> 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: Plug-in Models

2010-10-08 Thread Miles J
That is how you use it. If you want to use plugin models within a
plugin, you must define the plugin.

public $uses = array('User' => array('className' => 'Member.User'));

On Oct 7, 6:46 pm, "Dave Maharaj"  wrote:
> I have various controllers such as confirmations, passwords, members that I
> would like to package as a plugin to keep them in 1 spot. So going thru the
> cookbook it mentions nothing about using existing models within a plugin.
>
> My Member plugin will use the regular User model. How can this be done?
>
> 
>                 var $name = 'MemberConfirmation';
>
> var $uses = array('User');
>
> }
>
> ?>
>
> Something like that?
>
> Any insight would be great. First attempt so bare with me.
>
> 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


App::objects

2010-10-08 Thread euromark
App::objects just doesnt look under the app controller folder

i would expect
App::objects('controller');
or
App::objects('controller', APP.'controllers'.DS);
to look in /app/controllers

but if I call this function inside a plugin it will just give me the
plugin controllers
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: Am Stuck Need Help

2010-10-08 Thread euromark
1.
nl2br(h($var)) is fine


On 8 Okt., 20:52, Xoubaman  wrote:
> 1. Use nl2br PHP function in the view. You may also take a look at the
> sanitize class to prevent output 
> problems:http://book.cakephp.org/view/1183/Data-Sanitization
>
> 2. In the action use set method (http://book.cakephp.org/view/1031/
> Saving-Your-Data). You can also use a custom SQL query with $this-
>
> >Modelname->query('sql')
>
> 3.http://book.cakephp.org/view/1411/File-Fields. You can save
> image's path or name in your database to access it easily.
>
> On Oct 8, 1:35 pm, tubiz  wrote:
>
> > Please i am working on a CakePHP application and i have some little
> > problem.
> > 1. I am trying to save some text into the database and would like to
> > preserve the backspace as it is when it is displayed.
> > 2. I also want to increase a field in the database table  by one when
> > an action is carried out, please how do i do these
> > 3. How do i upload images using cakephp and display them as well.

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


Delete Sessions

2010-10-08 Thread Dave Maharaj
How do you delete sessions in the db based on user? 

I only want to allow each user to be logged in from 1 location at a time. 

So 1 user can not share their account info allowing multiple user access
under 1 account simultaneously.

 

So User1 logs in, another person (User2)logs in with User1 credentials then
delete all active sessions except for the last person who logged in. So when
User2 logs delete all other session(s) associated with User1 credentials.

 

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: Am Stuck Need Help

2010-10-08 Thread Xoubaman
1. Use nl2br PHP function in the view. You may also take a look at the
sanitize class to prevent output problems: 
http://book.cakephp.org/view/1183/Data-Sanitization

2. In the action use set method (http://book.cakephp.org/view/1031/
Saving-Your-Data). You can also use a custom SQL query with $this-
>Modelname->query('sql')

3. http://book.cakephp.org/view/1411/File-Fields . You can save
image's path or name in your database to access it easily.


On Oct 8, 1:35 pm, tubiz  wrote:
> Please i am working on a CakePHP application and i have some little
> problem.
> 1. I am trying to save some text into the database and would like to
> preserve the backspace as it is when it is displayed.
> 2. I also want to increase a field in the database table  by one when
> an action is carried out, please how do i do these
> 3. How do i upload images using cakephp and display them as well.

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: Why is this SQL query so slow?

2010-10-08 Thread Sanza
Can you explain better what you wont to count, please?
This query seem a bit strange, can you explain the kinds of relations?
You can check/add the indexes on foreign keys and may be you can
change: "LEFT JOIN authors" with "INNER JOIN authors" (if article
hasOne author ) ... and:...  "LEFT JOIN websites" with "INNER JOIN
websites" if article hasOne website , but all depends of yours
relations..
Sanza

On 8 Ott, 12:08, victor piousbox  wrote:
> I have a website with a bunch of articles. This is one of the queries
> executed by I assume the Paginator:
>
> SELECT COUNT(*) AS `count` FROM `articles` AS `Article` LEFT JOIN
> `authors` AS `Author` ON (`Article`.`author_id` = `Author`.`id`) LEFT
> JOIN `websites` AS `Website` ON (`Article`.`website_id` =
> `Website`.`id`) LEFT JOIN `articles` AS `ParentArticle` ON
> (`Article`.`article_id` = `ParentArticle`.`id`) LEFT JOIN `articles`
> AS `ChildArticle` ON (`ChildArticle`.`article_id` = `Article`.`id`)
> WHERE 1 = 1
>
> It takes 2ms when I just go to /articles/index, but if I edit and save
> an article, the same query takes 123000ms (that's two minutes). I have
> 3300 articles.
>
> Why does this happen? And how can I avoid it?
>
> _V

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: Strange behaviour with saveAll referring to hasOnes....

2010-10-08 Thread DerBjörn
@cricket:

Nope, doesn't work. Thanks for your suggestion anyway.
Generally if you use saveAll() you doesn't need a create(). This only
is necessary for the normal save().

So i am still looking for a solution! :) 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: Header already sent error after saving data.

2010-10-08 Thread euromark
This usually happens if you have ANY character printed out before the
view actually renders. It can be a single space after the closing php
tag of a php file (controller, model, ...). Therefore you should not
use ?> at the end of php files (CakePHP took the same path in summer
2010). It prevents this from happening.


On 8 Okt., 19:23, Ashwani Kumar  wrote:
> Hi all
>    I'm trying to save some data using add() method in cakephp. This is
> add () method :
>
> function add() {
>                         if (!empty($this->data)){
>                                 if ($this->Book->save($this->data)) {
>                                         $this->Session->setFlash('Data has 
> been saved Successfully!',
> true);
>                                         $this->redirect(array('action' => 
> 'index'));
>                                 }
>                         }
>                 }
> Data is getting saved, but i'm getting following error 
> onhttp://localhost/data-access/books/addpage.
>
> Warning (2): Cannot modify header information - headers already sent
> by (output started at C:\webs\test\data-access\models\book.php:8) [CORE
> \cake\libs\controller\controller.php, line 644]
>
> 3 queries took 8 ms Nr  Query   Error   Affected        Num. rows       Took 
> (ms)
> 1       DESCRIBE `books`                5       5       7
> 2       INSERT INTO `books` (`isbn`, `title`, `description`, `author_name`)
> VALUES ('123', 'test book', 'hi! this is a test.', 'author xyz')              
>   1               1
> 3       SELECT LAST_INSERT_ID() AS insertID             1       1       0
>
> I'm not a cakephp expert, rather i'm learning cakephp. Any reply will
> be appreciated. Thanks in advanced.
>
> Ashwani
> ashwani.mail...@gmail.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: Problem with hasOne Relation

2010-10-08 Thread Raphi
Ok let me try to explain.

I have two tables involved: users, user_profiles

Of course there is a model-file to any of the tables so: user.php,
user_profile.php
The models are linked via a "hasOne"(parent key user_id) relationship.
(which is working perfectly).

But now I want to implement a method that gives users the possibility
to alter their own profiles. Therefore I created an "editProfile"
method in the UsersController and a corresponding view-file
"edit_profile.ctp" in views/users.

Within this view-file I created a form using the formhelper:

echo $form->create('UserProfile');
echo $form->input('id');
echo $form->input('name');
echo $form->end('Save changes');

That is great because creating the form using "$form-
>create('UserProfile');" makes it automatically fill in the values
from the database. My problem occurs when it comes to submitting the
form. Cake recognizes the "UserProfile" model and tries to use the
"UserProfileController" which does not exist. I want to use the
UsersController to do that job. I mean I know I could use "$form-
>create('User');" in order to get it working but that makes it
impossible for cake to fill out the form automatically. I don't really
get why using the "User" model doesn't work. For there is an existing
relationship the "User" model should be able to pass on the
user_profiles datas.


On 4 Okt., 20:16, cricket  wrote:
> On Sun, Oct 3, 2010 at 4:49 PM, Raphi  wrote:
> > Hi, thank you for you quick response. Unfortunately I neither do use
> > AJAX nor have the data saved in the users table. I guess I have to use
> > two controllers anyway. :(
>
> Well, perhaps you could state your problem clearer, then. What is the
> schema of the tables you are using? And explain what this means:
>
> > My problem is that I want to
> > have an editable automagic form on that page that is linked to the
> > user_profiles table.

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


Header already sent error after saving data.

2010-10-08 Thread Ashwani Kumar
Hi all
   I'm trying to save some data using add() method in cakephp. This is
add () method :

function add() {
if (!empty($this->data)){
if ($this->Book->save($this->data)) {
$this->Session->setFlash('Data has been 
saved Successfully!',
true);
$this->redirect(array('action' => 
'index'));
}
}
}
Data is getting saved, but i'm getting following error on
http://localhost/data-access/books/add page.

Warning (2): Cannot modify header information - headers already sent
by (output started at C:\webs\test\data-access\models\book.php:8) [CORE
\cake\libs\controller\controller.php, line 644]

3 queries took 8 ms Nr  Query   Error   AffectedNum. rows   Took 
(ms)
1   DESCRIBE `books`5   5   7
2   INSERT INTO `books` (`isbn`, `title`, `description`, `author_name`)
VALUES ('123', 'test book', 'hi! this is a test.', 'author xyz')
1   1
3   SELECT LAST_INSERT_ID() AS insertID 1   1   0

I'm not a cakephp expert, rather i'm learning cakephp. Any reply will
be appreciated. Thanks in advanced.

Ashwani
ashwani.mail...@gmail.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


Relationship Help

2010-10-08 Thread Dave Maharaj
I been trying to figure this out and it just seems messed up to me.

 

Basic idea is User can create sub accounts under their main account for
associates to login into their account to manage articles. So if there are
100 articles the account holder can assign different people articles to
manage.

 

So Main User creates a User saving id as normal and in the db is account_id
which is the account holder id so then 

User model:

 

var $hasMany = array(

'User' => array(

'className' => 'User',

'foreignKey' =>
'associate_id',

'dependent' => false

)

);

 

var $belongsTo = array(

'User' => array(

'className' => 'User',

'foreignKey' => 'id'

),

 that just seems wrong no? 

 

And same with the Article. It belongs to the Users Profile so article has
profile_id (profile hasMany Article <-> belongsTo Profile) but the Article
is also going to be assigned to an associate_id

 

Lost..

 

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: Why is this SQL query so slow?

2010-10-08 Thread frazjp65
If you are using MySQL, you can look at the explain plan and see where
you can add indexes to help.

http://dev.mysql.com/doc/refman/5.0/en/explain.html

Joe

On Oct 8, 11:08 am, victor piousbox  wrote:
> I have a website with a bunch of articles. This is one of the queries
> executed by I assume the Paginator:
>
> SELECT COUNT(*) AS `count` FROM `articles` AS `Article` LEFT JOIN
> `authors` AS `Author` ON (`Article`.`author_id` = `Author`.`id`) LEFT
> JOIN `websites` AS `Website` ON (`Article`.`website_id` =
> `Website`.`id`) LEFT JOIN `articles` AS `ParentArticle` ON
> (`Article`.`article_id` = `ParentArticle`.`id`) LEFT JOIN `articles`
> AS `ChildArticle` ON (`ChildArticle`.`article_id` = `Article`.`id`)
> WHERE 1 = 1
>
> It takes 2ms when I just go to /articles/index, but if I edit and save
> an article, the same query takes 123000ms (that's two minutes). I have
> 3300 articles.
>
> Why does this happen? And how can I avoid it?
>
> _V

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: Why is this SQL query so slow?

2010-10-08 Thread frazjp65
What database are you using and what indexes are on the tables?  If
you  use MySQL, you can explain (http://dev.mysql.com/doc/refman/5.0/
en/explain.html) the query and see what the problem.  If you don't
understand the results, paste them here.

On Oct 8, 11:08 am, victor piousbox  wrote:
> I have a website with a bunch of articles. This is one of the queries
> executed by I assume the Paginator:
>
> SELECT COUNT(*) AS `count` FROM `articles` AS `Article` LEFT JOIN
> `authors` AS `Author` ON (`Article`.`author_id` = `Author`.`id`) LEFT
> JOIN `websites` AS `Website` ON (`Article`.`website_id` =
> `Website`.`id`) LEFT JOIN `articles` AS `ParentArticle` ON
> (`Article`.`article_id` = `ParentArticle`.`id`) LEFT JOIN `articles`
> AS `ChildArticle` ON (`ChildArticle`.`article_id` = `Article`.`id`)
> WHERE 1 = 1
>
> It takes 2ms when I just go to /articles/index, but if I edit and save
> an article, the same query takes 123000ms (that's two minutes). I have
> 3300 articles.
>
> Why does this happen? And how can I avoid it?
>
> _V

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


Am Stuck Need Help

2010-10-08 Thread tubiz
Please i am working on a CakePHP application and i have some little
problem.
1. I am trying to save some text into the database and would like to
preserve the backspace as it is when it is displayed.
2. I also want to increase a field in the database table  by one when
an action is carried out, please how do i do these
3. How do i upload images using cakephp and display them as well.

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


JsTree CakePHP

2010-10-08 Thread nithiz
Hi everyone,

I have integrated jstree within my cakephp application. Now, what i
want is to delete everything related to a tree node. Ofcourse i could
do that with model relations if JsTree (from jstree.com) would have
some sort of CakePHP plugin. The thing used now is a standalone php
class to make the queries.

Does anyone know about any CakePHP support on the JsTree? Can't seem
to find anyone who has rewritten the database/query class from JsTree
to CakePHP.

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


Error Acl behavior

2010-10-08 Thread Tássio Ricardo Batista Santos
Hi mates,
Firstly, sorry for my english basic..
I'm following the Examples in the main page of the book.cakephp.org to
do a ACL
It was all right until that part Acts As a Requester, when I put that
code var $actsAs = array('Acl' => 'requester') (ACL Behavior) into
user model  the application shows a error like that 'Error: the URL /
users/login was not found on this server. ...
It took me 2 days and I do'nt know what to do.
I hope that you can help me.
Hugs

-- 
Tássio Ricardo

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


ACL ERROR - pages was not found

2010-10-08 Thread tassio.batista
Hi mates,
Firstly, sorry for my english basic..
I'm following the Examples in the main page of the book.cakephp.org to
do a ACL
It was all right until that part Acts As a Requester, when I put that
code var $actsAs = array('Acl' => 'requester') (ACL Behavior) into
user model  the application shows a error like that 'Error: the URL /
users/login was not found on this server. ...
It took me 2 days and I do'nt know what to do.
I hope that you can help me.
Hugs

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


yes no button go to next page logic

2010-10-08 Thread roll4life24x7
I have just started with cake today and I am new to programming and I
am attempting to create a mini survey but I am confused as to how to
direct the user from one page to the next.

I have a few pages created with radio and checkbox questions
firstquestion.ctp
are you alive?
'Yes','N'=>'No');
$attributes=array('legend'=>false);
echo $form->radio('storechd',$options,$attributes);
?>

button('Next', array('type'=>'submit'));
?>

If I understand correctly the logic for this needs to be in my
controllers files
the pseudo code would be something like:
If isset $options = Yes
Then on submit redirect to secondquestion
else on submit redirect to youclickedno

right now all that I have come up with in my questions_controller is
this, but it does not work as I am missing a lot of information:
function firstquestion() {
if (isset($options['Y'])) {
$this->redirect(array('action' => 'secondquestion'));
} else {
 if (isset($options['N'])) {
   $this->redirect(array('action' =>
'youclickedno'));
 }
   }
}

function secondquestion() {
}
function youclickedno() {
}

Basically the problem is I do not know what syntax to use to tell cake
to perform a particular action when the next button is clicked on the
first page.  Does cake have to put this information into the database
first and then retrieve it, or can it simply look at the web page and
see that one of the options is set?

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: FileUpload behavior and multiple models

2010-10-08 Thread Deek
In order to get around this issue of having multiple models using the
FileUpload.FileUpload behavior I did the following:

created two additional behavior files:

private_file_upload.php and public_file_upload.php in /app/plugins/
file_upload/models/behaviors

containing the following code respectively:





then in the model configurations I changed

var $actsAs = array(
   'FileUpload.FileUpload'

to

var $actsAs = array(
   'FileUpload.PrivateFileUpload'

and

var $actsAs = array(
   'FileUpload.PublicFileUpload'


This has allowed me to use two separate configurations for each upload
type, you can probably use this same method, just create separate
behavior files to extend the base FileUpload for each different
configuration you want to have.

On Sep 22, 12:05 am, Wanna be baker  wrote:
> I have a Shirt which has many different images
> - shirt_image
> - thumb_on_image
> - thumb_off_image
> - price_banner_image
>
> The files get stored in separate places (or are supposed to be).  What
> I've found (using a model like what is show here:http://pastebin.com/gbnLpxN0)
> is that the value ofuploadDirgets overwritten.  Net, the last
> declaration of it affects all of the other executions.  Couple this
> with the fact that I can't figure out how to get DS into theuploadDir
> declaration, has caused me some good sized headaches.
>
> At the moment, with the constructor call commented out and the .{DS}.
> in the actsAs, this blows up...  but it does work if I use  the
> constructor method; it'sjustthat the files get stored in the wrong
> spots...
>
> The variable issue lead me to try using the constructor to affect that
> option.  However, even that has the same issues with the value being
> overridden.
>
> As a result, I have two questions...  One specific and one high level.
>
> Specific: how can I get this declaration ofuploadDirset correctly so
> that different models can have different uploadDirs?
>
> High-level: How does this get instantiated (this plugin)?  Does it
> instantiate one instance of the behavior at run time or does it create
> one for each model?  If it's the latter, it's not working as I would
> expect.  Also, where's a good tutorial that would help me understand
> the OO nature and instantiation order in CakePHP?
>
> 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: FileUpload behavior and multiple models

2010-10-08 Thread Deek
I'm currently experiencing the same issue, and have begun digging into
the plugin code to see if there is a way to extend the plugin to
support multiple instances of the same behavior. I'll tell you a
little bit about the problem I'm trying to solve, so that you may have
a better understanding of the actions I take to solve this problem.

I'm in the process of building a simple content management system for
our company website. The files uploaded for unauthenticated users
should be stored in the /app/webroot/files directory so that they are
publicly accessible. Files uploaded for authenticated users are
accessed through a controller using a download() function that sends
the file using the MediaView. This way we can move the files to a
private directory under /app/ and use our authentication component to
control who can download what. I have set two different configurations
for the respective models, but everything is being uploaded to the
same directory, same as you.

I'm by no means a CakePHP expert, but what I'm thinking is extending
the FileUpload behavior into two new behaviors, one for public uploads
and one for private uploads. I don't know if it will work or how it
fits cake convention, so I'm open to comments/suggestions...


On Sep 22, 12:05 am, Wanna be baker  wrote:
> I have a Shirt which has many different images
> - shirt_image
> - thumb_on_image
> - thumb_off_image
> - price_banner_image
>
> The files get stored in separate places (or are supposed to be).  What
> I've found (using a model like what is show here:http://pastebin.com/gbnLpxN0)
> is that the value of uploadDir gets overwritten.  Net, the last
> declaration of it affects all of the other executions.  Couple this
> with the fact that I can't figure out how to get DS into the uploadDir
> declaration, has caused me some good sized headaches.
>
> At the moment, with the constructor call commented out and the .{DS}.
> in the actsAs, this blows up...  but it does work if I use  the
> constructor method; it's just that the files get stored in the wrong
> spots...
>
> The variable issue lead me to try using the constructor to affect that
> option.  However, even that has the same issues with the value being
> overridden.
>
> As a result, I have two questions...  One specific and one high level.
>
> Specific: how can I get this declaration of uploadDir set correctly so
> that different models can have different uploadDirs?
>
> High-level: How does this get instantiated (this plugin)?  Does it
> instantiate one instance of the behavior at run time or does it create
> one for each model?  If it's the latter, it's not working as I would
> expect.  Also, where's a good tutorial that would help me understand
> the OO nature and instantiation order in CakePHP?
>
> 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


Bake Add function don't works

2010-10-08 Thread FABINHO
I've just created my pages with cake bake all, but when I submit data
by the forms nothing happens (neither error messages).
With the old versions worked perfectly, but now that I'm using version
1.3.4, it don't works.
There's something different I have to do in this new version?

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: Why is this SQL query so slow?

2010-10-08 Thread Jeremy Burns | Class Outfit
What are your indexes like on your table?

Jeremy Burns
Class Outfit

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

On 8 Oct 2010, at 16:08, victor piousbox wrote:

> I have a website with a bunch of articles. This is one of the queries
> executed by I assume the Paginator:
> 
> SELECT COUNT(*) AS `count` FROM `articles` AS `Article` LEFT JOIN
> `authors` AS `Author` ON (`Article`.`author_id` = `Author`.`id`) LEFT
> JOIN `websites` AS `Website` ON (`Article`.`website_id` =
> `Website`.`id`) LEFT JOIN `articles` AS `ParentArticle` ON
> (`Article`.`article_id` = `ParentArticle`.`id`) LEFT JOIN `articles`
> AS `ChildArticle` ON (`ChildArticle`.`article_id` = `Article`.`id`)
> WHERE 1 = 1
> 
> It takes 2ms when I just go to /articles/index, but if I edit and save
> an article, the same query takes 123000ms (that's two minutes). I have
> 3300 articles.
> 
> Why does this happen? And how can I avoid it?
> 
> _V
> 
> 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


Why is this SQL query so slow?

2010-10-08 Thread victor piousbox
I have a website with a bunch of articles. This is one of the queries
executed by I assume the Paginator:

SELECT COUNT(*) AS `count` FROM `articles` AS `Article` LEFT JOIN
`authors` AS `Author` ON (`Article`.`author_id` = `Author`.`id`) LEFT
JOIN `websites` AS `Website` ON (`Article`.`website_id` =
`Website`.`id`) LEFT JOIN `articles` AS `ParentArticle` ON
(`Article`.`article_id` = `ParentArticle`.`id`) LEFT JOIN `articles`
AS `ChildArticle` ON (`ChildArticle`.`article_id` = `Article`.`id`)
WHERE 1 = 1

It takes 2ms when I just go to /articles/index, but if I edit and save
an article, the same query takes 123000ms (that's two minutes). I have
3300 articles.

Why does this happen? And how can I avoid it?

_V

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: Convert Text to Images to Protect your Email from Search

2010-10-08 Thread euromark
if you succeed you might want to post your result
i am sure it can be useful to other as well :)
or we can give you ideas for improvements

On 8 Okt., 13:47, hoss7  wrote:
> 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: Fatal error: Call to undefined method CookieComponent::del()

2010-10-08 Thread Tilen Majerle
use "delete" method not "del" :D
--
Tilen Majerle
http://majerle.eu



2010/10/8 n4thancake 

> Hi to all I have this strange error in my code. I want to make a
> cookie system with cakephp, and in app_controller.php I include
>
> var $components = array('Auth', 'Cookie'); var $helpers =
> array('Html', 'Form', 'Session');
>
> but everytime I click on Logout link the error appears. This is the
> function
>
> function logout() {
>$cookie = $this->Cookie->read('User');
>  if($cookie)
>  $this->Cookie->del('User');
>$this->Session->setFlash('Logout');
>$this->redirect($this->Auth->logout());
> }
> Where I can look for a solution? Thank you dude
>
> 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


Fatal error: Call to undefined method CookieComponent::del()

2010-10-08 Thread n4thancake
Hi to all I have this strange error in my code. I want to make a
cookie system with cakephp, and in app_controller.php I include

var $components = array('Auth', 'Cookie'); var $helpers =
array('Html', 'Form', 'Session');

but everytime I click on Logout link the error appears. This is the
function

function logout() {
$cookie = $this->Cookie->read('User');
  if($cookie)
  $this->Cookie->del('User');
$this->Session->setFlash('Logout');
$this->redirect($this->Auth->logout());
}
Where I can look for a solution? Thank you dude

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 use ORDER BY within Containable Behavior

2010-10-08 Thread Paul Bricks
But if i would do it like your way: "$this->Post->Tag->Category-
>find...",
i have to change my view.
Because
['Post']['Tag']['Category']
is now
['Category']['Tag']['Post']

And what, if i would like to orderBy "Tag.name"?
Than i have do set up three different view-loops to print out the
result array!

Yesterday, there comes a little idea in my mind: I could do that with
a
database-view. So i will have only one cake-view-loop to print out my
posts
and can sort it like i want to. What do you think about that way??

Another User named "teknoid" said, that it would work with "joins"-key
on the "find()" clause. Didnt get this work with "joins" in cakephp
until now.
Read it here:
http://nuts-and-bolts-of-cakephp.com/2008/07/17/forcing-an-sql-join-in-cakephp/

May be you get it work with joins??


On 7 Okt., 06:28, cricket  wrote:
> On Tue, Oct 5, 2010 at 6:03 PM, Paul Bricks
>
>
>
>  wrote:
> > I would like to have a sorted-array (order by) to print out in my Post-
> > View.
> > The Problem is, that the order-by-attribute (Category.name) lies
> > deeper
> > than attributes (Post.id, Tag.id, ...), which have to be ordered.
>
> > Here is my example:
>
> > Relations:
> > Post --> hasMany --> Tag --> belongsTo --> Category
>
> > PostsController:
> > ...
> > $posts = $this->Post->find('all', array (
> >        'contain' => array (
> >                'Tag' => array (
> >                        'Category' => array (
> >                                'fields' => array (
> >                                        'id',
> >                                        'name'
> >                                )
> >                        )
> >                )
> >        )
> > ));
> > $this->set('posts', $posts);
> > ...
>
> > Now i would like to to print out the posts-aray in my Post-View
> > to get this ordered table (order-by Category.name ASC):
>
> > Post.id         Tag.id          Category.name
> > -
> > 1                       3                       Basketball
> > 1                       2                       Football
> > 2                       4                       Hockey
> > 4                       1                       Tennis
>
> > And my Question is:
> > Where do i have to put the "order"-clause to get this array, shown
> > above.
> > And if this will not work like this way, how will it work otherwise?
>
> So, you want to order the Posts by Category? Is that correct?
>
> Normally, one can include an 'order' param at the same level one would
> put 'fields', at whatever level under 'contain'. However, I don't
> think what you want to do is possible with a find() on Post. What you
> could do, though, is run the find() on Category, taking advantage of
> the chain of associations.
>
> $data = $this->Post->Tag->Category->find(
>         'all',
>         array(
>                 'fields' => array(
>                         'Category.id',
>                         'Category.name'
>                 ),
>                 'order' => array('Category.name' => 'ASC'),
>                 'contain' => array(
>                         'Tag' => array(
>                                 'fields' => array(
>                                         'Tag.id',
>                                         'Tag.name' // for example
>                                 ),
>                                 'Post' => array(
>                                         'fields' => array(
>                                                 'Post.id',
>                                                 'Post.title' // for example
>                                         )
>                                 )
>                         )
>                 )
>         )
> );
>
> Note that you should specify the fields for Post or you'll fetch
> everything (which it appears you don't want). Also, you should get in
> the habit of specifying the model name. There are situations where not
> doing so can lead to bad queries (eg. "Column 'id' in field list is
> ambiguous").

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: Convert Text to Images to Protect your Email from Search

2010-10-08 Thread hoss7
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: Convert Text to Images to Protect your Email from Search

2010-10-08 Thread euromark
you could create a cakephp helper, though, which does exactly that,
what xoubaman proposes.
not that difficult, i guess.


On 8 Okt., 11:47, Xoubaman  wrote:
> It's a PHP task, not related to Cake.
>
> Take a look athttp://www.php.net/manual/en/function.imagefttext.php
>
> On Oct 8, 10:39 am, hoss7  wrote:
>
> > i need some helper for convert email to image,
> > i am new 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: Convert Text to Images to Protect your Email from Search

2010-10-08 Thread Xoubaman
It's a PHP task, not related to Cake.

Take a look at http://www.php.net/manual/en/function.imagefttext.php

On Oct 8, 10:39 am, hoss7  wrote:
> i need some helper for convert email to image,
> i am new 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


Convert Text to Images to Protect your Email from Search

2010-10-08 Thread hoss7
i need some helper for convert email to image,
i am new 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