Re: Paradigm shift :: Procedural - OO Paterns based development

2006-08-03 Thread TimO

kestrelid,

If you set up the model associations correctly, you'll be able to save
associations in one transaction. HasMany + HasAndBelongsToMany can both
be saved in one cake 'method call'. But this doesn't mean your data is
brought back to you by just one query or updated by one.
But there's nothing wrong with that. Espically not when its a small and
private app like this one.
Have a look at the api, if you search for the controller methods youll
find a lot of usefull stuff.

You can, if you want, hack all the code you please into cake, that's
what makes it great, no limitations. If you want to build a function
directly in your view you can :-) but cake has helpers so you don't
have to. The same with everything else.

goodluck!


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



What can Cake do for me?

2006-08-03 Thread Peter Boosten

Hi all,

Just wondering:

I've written an online survey in plain PHP (to be used in near future)
which
pulls its questions from MySQL and puts the answers (after presented
via a
form) back into a table.

It's getting complicated: the questions belong to a certain category,
which
belong to a certain survey (so I can have more surveys in the database
with
their questions). Each category has one 'answer type' (possible answers
to
one question).

So far I 'baked' this data model in Cake.

Can Cake do what I want? Is it possible to create a controller pulling
all that data from my database (from 5 different tables) and put the
output of the form in a sixth table?

Thanks in advace for your answer.

Peter
-- 
http://www.boosten.org


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



Re: OthAuth and sql error

2006-08-03 Thread CraZyLeGs

you need at least mySQL 4.x for the joins.


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



Re: hasMany works with scaffolding but not baking a controller and view

2006-08-03 Thread ByteDoc

Did you bake it giving the right answers to the questions?
Relation of the models? Use of other models?

Check following line in your controller:
var $uses = array(

It should look like this:
var $uses = array('Article', 'User');
(unless there are other models to use as well ...)

as far as I know ...


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



Re: OthAuth and sql error

2006-08-03 Thread lorenzo


CraZyLeGs ha scritto:

 you need at least mySQL 4.x for the joins.
ah, ok, tnk you :)


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



Advanced Validation - tagIsInvalid() and isFieldError()

2006-08-03 Thread Shutter

Hi,

I'm using the Advanced Validation approach by CakeBaker
(http://wiki.cakephp.org/tutorials:advanced_validation), and trying to
get errors to display properly if a save() fails. In a nutshell, it
doesn't display errors because the FormHelper expects
HtmlHelper::tagIsInvalid() to return 1 if there is an error.

Advanced Validation sets the $validationErrorrs[$model][$field] to a
_string_ value if I provide an error message.

However, when I use the FormHelper's generateFields() function and it
generates tags / errors, it requires tagIsInvalid to return the number
1:

function isFieldError($field) {
$error=1;
$this-Html-setFormTag($field);

if ($error == $this-Html-tagIsInvalid($this-Html-model,
$this-Html-field)) {
return true;
} else {
return false;
}
}

But HtmlHelper::tagIsInvalid() returns the error string I set above,
not the number one. The documentation says it returns true on errors,
but it doesn't:

function tagIsInvalid($model, $field) {
return empty($this-validationErrors[$model][$field]) ? 0 :
$this-validationErrors[$model][$field];
}

Thus, isFieldError() always returns false, and the FormHelper class
will refuse to display any error messages.

I could be wrong here, but is there something I'm missing or should
tagIsInvalid() return 1 instead? I'm still a little foggy on the
validation stuff, since I need to use Advanced Validation to use
multiple error messages for the same field. Any insight would be
helpful.

Thanks,

Shutter


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



Re: Switching Layouts

2006-08-03 Thread Mark Quinn

On 7/31/06, lorenzo [EMAIL PROTECTED] wrote:

 nate ha scritto:

  but that's controller code.  You should, however, still be able to use
  $this-layout in your view templates.
 Sure ... but is better in controller than in view ;)


I've just been using

? $this-layout = 'other_layout'; ?

which works just fine.

My current problem is how to get a view to set a variable that is
available in the layout. From everything i've read. this should be
easy, but i'm just not getting any loving.

I baked a trivial example:

my layout contains
  pmy favourite cheese is ?= $cheese ?/p

my view contains
?
  $this-controller-set( 'cheese', 'cheddar' );
  $cheese = 'brie';
?

but the variable always comes out blank.

Can anyone help?

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



Help on saving a blob

2006-08-03 Thread francky06l

Hello,

I have a small problem saving a file that I uploaded. The file is
uploaded correctly on temp directory and I want to insert it into the
DB using the save or saveField method.
I just do :

  $this-model-saveField('image', $filename);

the $file name contains the correct location of the file (actually temp
directory of Apache), the record is saved, but instead of the blob i
get only 25 bytes into the blob field and they actually are the name
of the files, but the content of it..

I am sure I do something stupid but can't find the error, so if someone
just recognize a blob-beginner error, tell me..

Thanks
Franck


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



Re: Advanced Validation - tagIsInvalid() and isFieldError()

2006-08-03 Thread Mark Quinn

isFieldError takes the full errorString, throws it away and then only
returns true or false; This means that the errors are not avilable to
you to display. strange that this is the case, i'm assuming its some
sort of bug, or something leftover as the code has switched between 2
designs.

I'm not a massively experienced baker, so i did the following.

change cake/libs/views/helpers/form.php

  function generateInputDiv($tagName, $prompt, $required = false,
$errorMsg = null, $size = 20, $htmlOptions = null) {
$htmlAttributes = $htmlOptions;
$htmlAttributes['size'] = $size;
$str = $this-Html-input($tagName, $htmlAttributes);
$strLabel = $this-labelTag($tagName, $prompt);
$divClass = optional;
if ($required) {
  $divClass = required;
}
$strError = ;


if ($this-isFieldError( $tagName )) {
  $fieldErrorMessage = $this-getFieldError( $tagName );
  $strError = $this-pTag('error', $fieldErrorMessage);
  $divClass = sprintf(%s error, $divClass);
}
$divTagInside = sprintf(%s %s %s, $strError, $strLabel, $str);
return $this-divTag($divClass, $divTagInside);
  }

see that it now includes a call to getFieldError()

this is a new function that I added which returns the actual error (in
fact, the mostly recently set error for a particular field, as cake
throws others away, afaict)

  function getFieldError( $field ) {
return $this-Html-tagIsInvalid( $this-Html-model, $this-Html-field );
  }



If a more experienced baker can improve this methodology, please do so.
On 8/3/06, Shutter [EMAIL PROTECTED] wrote:

 Hi,

 I'm using the Advanced Validation approach by CakeBaker
 (http://wiki.cakephp.org/tutorials:advanced_validation), and trying to
 get errors to display properly if a save() fails. In a nutshell, it
 doesn't display errors because the FormHelper expects
 HtmlHelper::tagIsInvalid() to return 1 if there is an error.

 Advanced Validation sets the $validationErrorrs[$model][$field] to a
 _string_ value if I provide an error message.

 However, when I use the FormHelper's generateFields() function and it
 generates tags / errors, it requires tagIsInvalid to return the number
 1:

 function isFieldError($field) {
 $error=1;
 $this-Html-setFormTag($field);

 if ($error == $this-Html-tagIsInvalid($this-Html-model,
 $this-Html-field)) {
 return true;
 } else {
 return false;
 }
 }

 But HtmlHelper::tagIsInvalid() returns the error string I set above,
 not the number one. The documentation says it returns true on errors,
 but it doesn't:

 function tagIsInvalid($model, $field) {
 return empty($this-validationErrors[$model][$field]) ? 0 :
 $this-validationErrors[$model][$field];
 }

 Thus, isFieldError() always returns false, and the FormHelper class
 will refuse to display any error messages.

 I could be wrong here, but is there something I'm missing or should
 tagIsInvalid() return 1 instead? I'm still a little foggy on the
 validation stuff, since I need to use Advanced Validation to use
 multiple error messages for the same field. Any insight would be
 helpful.

 Thanks,

 Shutter


 


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



Re: Advanced Validation - tagIsInvalid() and isFieldError()

2006-08-03 Thread Mark Quinn

You may want to consider using Flexifix for this. I could not get it
to work for helpers (only controllers and models) but ymmv.

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



Re: What can Cake do for me?

2006-08-03 Thread John David Anderson (_psychic_)


On Aug 3, 2006, at 4:15 AM, Peter Boosten wrote:


 Hi all,

 Just wondering:

 I've written an online survey in plain PHP (to be used in near future)
 which
 pulls its questions from MySQL and puts the answers (after presented
 via a
 form) back into a table.

 It's getting complicated: the questions belong to a certain category,
 which
 belong to a certain survey (so I can have more surveys in the database
 with
 their questions). Each category has one 'answer type' (possible  
 answers
 to
 one question).

 So far I 'baked' this data model in Cake.

 Can Cake do what I want? Is it possible to create a controller pulling
 all that data from my database (from 5 different tables) and put the
 output of the form in a sixth table?

Well if you would  have said just four tables I would have said yes,  
but five is really pushing it.

Just kidding. ;)

You should be able to associate your models and get it done - seems  
workable, to be sure. If you have specific questions, ask them here  
or in our IRC channel.

-- John

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



Re: Help on saving a blob

2006-08-03 Thread francky06l

Hello,

I have progressed on my stupid mistake..
I found a solution but also searching the way to give a value to a
field without the quote..indeed for loading a blob mysql as a function
LOAD_FILE, very convenient ..The problem is if I set the value of the
field such as :

$this-params['data']['model']['field'] = 'LOAD_FILE(\'localfile\')';

Mysql will not load the file since I have passed a string. I have
manage to write a complete string and call the execute and this works,
but I would prefer to save everything in one call.
Actually I use save the first time and get the last insert id, then I
update the blob using execute ..

Is there anyway to pass DB function as values for a field ?

Thanks
Franck


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



Re: Help on saving a blob

2006-08-03 Thread Bret Kuhns

If you're doing what I think you are, then you're trying to save the
contents of the file itself into a blob field of your database.
However, your first example seems to be inserting the file*name* of the
file into your blob field. You need the binary data of the file itself
and store it in your table. Something like:

$file = file_get_contents($filename);
$this-model-saveField('image', $file);

Now all of the binary data will be stored in a blob in your table
(don't let the skeptics scare you away from this approach, I've seen
benchmarks that show blobbing images into a database is *faster* than
finding the location in the database, then reading the data from the
filesystem). And it'll probably help to keep track of the image's MIME
content-type with another table column if you're going to have a PHP
script that outputs the blob field data.

I hope that helps :)


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



Re: Advanced Validation - tagIsInvalid() and isFieldError()

2006-08-03 Thread Shutter

Interesting... I tried Flexifix just now, but it didn't work with
helpers properly.

The effect of this bug is that I can't use the Advanced Validation
technique unless I go in and change the FormHelper manually... the
downside being I can't just drop in new versions of Cake in the
future. Ah well maybe I'll force myself to use subversion.


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



Re: Switching Layouts

2006-08-03 Thread lorenzo


Mark Quinn ha scritto:



 my view contains
 ?
   $this-controller-set( 'cheese', 'cheddar' );
   $cheese = 'brie';
 ?
put this in your controller:
$this-set('cheese','padano');


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



Need help on association

2006-08-03 Thread Golfer001

Sorry, I tried to use the search, but I don't even know what keyword to
look for:  Here is my database structure

CREATE TABLE `customers` (
  `id` int(10) unsigned NOT NULL,
  `name` varchar(64) NOT NULL,
  PRIMARY KEY  (`id`)
)

CREATE TABLE `products` (
  `id` int(10) unsigned NOT NULL,
  `name` varchar(64) NOT NULL,
  PRIMARY KEY  (`id`)
)

CREATE TABLE `orders` (
  `id` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `customer_id` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`id`)
)

I want to list all the rows in table 'orders', with each product_id and
customer_id associated with their names.  I assume using hasMany is the
key here.

var $hasMany = array('Product' =
   array('className'   = 'Product',
   'foreignKey'  =
'product_id',
   'dependent'   = true,
   'exclusive'   = false,
   'finderSql'   = ''
   ),
 'Customer' =
   array('className'   =
'Customer',
   'foreignKey'  =
'customer_id',
   'dependent'   = true,
   'exclusive'   = false,
   'finderSql'   = ''
   )
);

The above doesn't seem to work, when I call Order-findAll(), I don't
see each customer_id and product_id being associated with their
respective names.  Basically, I am trying to do this: SELECT
orders.id,customers.name,products.name FROM orders,customers,products
WHERE orders.product_id = products.id AND orders.customer_id =
customers.id; What did I miss here?  Thanks.


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



Re: Need help on association

2006-08-03 Thread John David Anderson (_psychic_)

On Aug 3, 2006, at 10:25 AM, Golfer001 wrote:
snip
 The above doesn't seem to work, when I call Order-findAll(), I don't
 see each customer_id and product_id being associated with their
 respective names.  Basically, I am trying to do this: SELECT
 orders.id,customers.name,products.name FROM orders,customers,products
 WHERE orders.product_id = products.id AND orders.customer_id =
 customers.id; What did I miss here?  Thanks.

If there are keys in the `orders` table, then it belongsTo rather  
than hasMany. Think of those foreign keys like little labels that  
mark it as belonging to something else in the database. The way you  
have it keyed, Order belongsTo Customer, Order belongsTo Product, and  
both Product and Customer hasMany Order.

-- John

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



Re: Help on saving a blob

2006-08-03 Thread francky06l

Exactly what I want to do and on the way to do it ..
Actually using the mysql LOAD_FILE is easier for me (I do not know what
is faster or less consuming in term of resources..)
Anyway thanks a lot, next steps would be to generate thumbnails and
have possibility to display the complete image ..
If you have some advises to do this ... I'll be glad..

Actually the fact of saving into DB also simplify the maintenance and
so on .. I get everything in the DB and can add another web if needed
without worrying about file location and so on. Also simplify backup
operations..

Thanks
Franck


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



Re: Help on saving a blob

2006-08-03 Thread Chris Lamb

Hi,

 Bret Kuhns [EMAIL PROTECTED] wrote:

 Now all of the binary data will be stored in a blob in your table
 (don't let the skeptics scare you away from this approach

This[0] is an interesting read (check the comments too!) on this
subject.

 And it'll probably help to keep track of the image's MIME
 content-type with another table column if you're going to have a PHP
 script that outputs the blob field data.

Don't forget that the uploaded MIME type can be faked[1]. You may want
to look into using the command 'magic' or getimagesize()[2] to get a
real MIME type.


Regards,

--Lamby


[0]
http://mysqldump.azundris.com/archives/36-Serving-Images-From-A-Database.html
[1] http://uk2.php.net/features.file-upload
[2] http://uk.php.net/manual/en/function.getimagesize.php

-- 
 Chris Lamb, Cambridgeshire, UK WWW: http://chris-lamb.co.uk
  Q. Why is top posting bad? GPG: 0x634F9A20
  A. Because it breaks the logical sequence of discussion


signature.asc
Description: PGP signature


Re: Need help on association

2006-08-03 Thread Golfer001

Doh, I accidentally put the $hasMany/$belongsTo declarations in
Controller, instead of in models.  No wonder it didn't work no matter
how I reworked the db and naming conventions. lol

John David Anderson (_psychic_) wrote:
 On Aug 3, 2006, at 10:25 AM, Golfer001 wrote:
 snip
  The above doesn't seem to work, when I call Order-findAll(), I don't
  see each customer_id and product_id being associated with their
  respective names.  Basically, I am trying to do this: SELECT
  orders.id,customers.name,products.name FROM orders,customers,products
  WHERE orders.product_id = products.id AND orders.customer_id =
  customers.id; What did I miss here?  Thanks.

 If there are keys in the `orders` table, then it belongsTo rather
 than hasMany. Think of those foreign keys like little labels that
 mark it as belonging to something else in the database. The way you
 have it keyed, Order belongsTo Customer, Order belongsTo Product, and
 both Product and Customer hasMany Order.
 
 -- John


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



Special characters from the model and str_replace()

2006-08-03 Thread anarchitect

Good afternoon everbody, i have some troubles turning special
characters into clean characters to use for a slug (read: clean url
string). I am running a str_replace() over the data that i receive from
the model, yet it seams that special characters (such as öäü...) are
encoded in something special, so that str_replace() won't work.

$title = $entry['Post']['title'];
$title = strtolower($title);
$umlaute = array (ü, ö, ä, ß);
$replace  = array (ue, oe, ae, ss);
$title = str_replace($umlaute, $replace, $title);
$title = preg_replace(/\W/, , $title);
$entry['Post']['slug'] = $title;

Any hints how i could turn de-code them from the model?

Thanks for any help


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



Re: Help on saving a blob

2006-08-03 Thread francky06l

Well true that the mime type can be tricky or fake. I eventually
succeed to make the fileinfo php function working, a really terrible
mess.. but after grabing magic from Apache2 and GnuWin32 it seems ok to
recognize or guess the mime type.

If someone needs to make this work, give me shout...

Thanks
Franck


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



Re: Special characters from the model and str_replace()

2006-08-03 Thread anarchitect

@John: Yes, i can and it works technically, as the created slug works
as expected. Yet esthetically this is not that nice:

posts/view/%DCberschrift

In German - and i think this counts for other languages - there are
replacements for  special characters. As indicated in the code above.
Therefore it would be nice if i actually could access (find and
replace) the special characters that are entered in the form.

@Chris: could you be a bit more specific. I guess i have no clue what
multibyte string manipulation means.

Does anybody know how data is encoded before saved via the model in the
database and how this could be decoded to access as described above?
Thanks again.


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



social networking

2006-08-03 Thread salimk786

Hello,

Can you guys provide some constructive criticism on  this :

http://salimk786.wordpress.com/

Please leave comments on that site or you can email them to me.

Thank you.

[EMAIL PROTECTED]


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



Selective Association?

2006-08-03 Thread Golfer001

What is the correct way to deal with selective association? e.g., I
have a 'order' model that belongsTo 'customer', 'product' models.  In
the list action of Orders Controller, I don't want the 'order' model
associated to anybody so I can return all the orders id faster.  When
viewing the individual order itself, I want 'order' associated with
'customer' and 'product' to get more detailed info.

Is creating two different 'order' models (one associated, one isn't)
the way to accomplish this?  Thanks.


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



Re: Special characters from the model and str_replace()

2006-08-03 Thread anarchitect

Okay i got it working now. The result coming from the model/database is
encoded as something different then UTF-8. Therefore utf8_encode() will
do the job.

The thing is i am a bit confused now. The pages rendered by cake are
not UTF-8 but seem to be something like ISO-8859-1. I would like to go
all UTF-8. How can i do this? Is there a setting to fetch the data from
the model in UTF-8? Is there anything to read and learn in regard to
encoding and cake?

Thanks guys for pointing me in the right direction.


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



Re: Selective Association?

2006-08-03 Thread John David Anderson (_psychic_)


On Aug 3, 2006, at 3:35 PM, Golfer001 wrote:


 What is the correct way to deal with selective association? e.g., I
 have a 'order' model that belongsTo 'customer', 'product' models.  In
 the list action of Orders Controller, I don't want the 'order' model
 associated to anybody so I can return all the orders id faster.  When
 viewing the individual order itself, I want 'order' associated with
 'customer' and 'product' to get more detailed info.

When you set $this-Order-recursive = 0, associated models wont get  
fetched. Turning up $recursive allows you to tell Cake how many  
levels deep you want it to go.

-- John



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



Comment in Simple User Authentication example is wrong

2006-08-03 Thread ebourqui

Not really a question, but a statement, since I couldn't submit a bug
at trac.cakephp.org;

The comment in the Simple User Authentication section of the CakePHP
manual (as of 8/3/2006) is wrong. It says:

// Note: hopefully your password in the DB is hashed,
// so your comparison might look more like:
// md5($somone['User']['password']) == ...

it should read:

// Note: hopefully your password in the DB is hashed,
// so your comparison might look more like:
// ... == md5($this-data['User']['password']))

because $someone is the data pulled from the database, which would
already be hashed, whereas $this-data['User']['password'] is the data
from the form, which has not been hashed yet.


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



Re: Websites vs. Web Applications

2006-08-03 Thread Felix Geisendörfer




What's a "full blown website"? Yes, CakePHP can serve static html files
alongside with
application pages if that's what you are asking for.

--
http://www.thinkingphp.org
http://www.fg-webdesign.de



webbo11 wrote:

  I am new to using CakePHP.  A very light but powerful framework indeed
it is.  My question is merely based on what type of development CakePHP
should be used for.  For that matter, what type of development should
any framework be used for?  Is cakephp better used for web applications
(i.e. creating blogs, guestbooks, etc.) or is it equally as powerful
when creating full blown websites?




  


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





Re: Websites vs. Web Applications

2006-08-03 Thread Felix Geisendörfer




What's a "full blown website"? Yes, CakePHP can serve static html files
alongside with
application interfaces if that's what you are asking for.

--
http://www.thinkingphp.org
http://www.fg-webdesign.de



webbo11 wrote:

  I am new to using CakePHP.  A very light but powerful framework indeed
it is.  My question is merely based on what type of development CakePHP
should be used for.  For that matter, what type of development should
any framework be used for?  Is cakephp better used for web applications
(i.e. creating blogs, guestbooks, etc.) or is it equally as powerful
when creating full blown websites?




  


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





HABTM with 3 tables

2006-08-03 Thread [EMAIL PROTECTED]

Firstly, there is already a post about this but it did not help.

I'm building a simple little time tracker and there is what I think to
be a 3 HABTM association between Projects, Users and Roles as follows:

  - A Project has many Users
  - A User has many Roles
  - A Project has many Roles

In other words, each project has multiple users that each have a
project role (e.g. developer, manager) so the table looks like:

id  | project_id  | user_id  | role_id

Not only am I unclear of how the associations code should work, I'm
also unclear of where creating, editing, deleting project user roles
would sit in my application in terms of controllers and actions? Is it
actions of the project controller or is it it's own controller
ProjectUserRoles?

If I've adequately described myself, you'll see this is a question not
only about Cake Associations, but also Cake Application Design and I
really hope someone can help and I promise that if we successfully nail
this problem, a good wiki tutorial will follow.

Thanks heaps in advance,
Ryno


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



Re: Websites vs. Web Applications

2006-08-03 Thread webbo11

I suppose i meant just a website.  Say, that a client comes to me
needing a website developed.  A 10 - 15 page website with dynamic
content a few forms, etc.  Would it be better to use procedural
programming or a cms such as drupal, or does cakephp work well serving
websites.


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



Re: Re: Websites vs. Web Applications

2006-08-03 Thread Samuel DeVore

heck I even did a essentially static website with all the content
stored as markdown styled text and just rendered into a site on the
fly.  The client then edits the text files that are synced with the
server

http://www.glicksmanlaw.com/

Sam D

On 8/3/06, webbo11 [EMAIL PROTECTED] wrote:

 I suppose i meant just a website.  Say, that a client comes to me
 needing a website developed.  A 10 - 15 page website with dynamic
 content a few forms, etc.  Would it be better to use procedural
 programming or a cms such as drupal, or does cakephp work well serving
 websites.


 


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



Pages Controller Subpages

2006-08-03 Thread John Zimmerman [gmail]
In the code for the pages controller there are variables there for subpages.Is anyone using static subpages with the pages controller?I browsed around for documentation about it, but came up empty.

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


Another Refresh question

2006-08-03 Thread KN

Hi,

In my index page, I have given the sorttable listing along with other
views. And each item is an element.
And whole elements given in the following way.
div // Main div
   div
   Element1
   /div
   div
   Element2
   /div
   div
   Element3
   /div
/div

And drag-drop things are working fine. After dropping an element, I
need to update the order of that element in the database through Ajax
and the new order will reflect in the index page. After dropping the
element , I am calling one javascript function and using ajaxupdate
(scriptulous) i am calling my controller action. The updation is
working fine. But it is asking for view. So I created a blank view with
the action name. After that that element is replaced by the blank view.
Once we refresh the page manually all things are coming fine.How I can
I refresh (ajax) the things through code  ? Should I need to create
pages instead of elements.

I have gone through refreshing multiple divs , ajax refresh etc etc.
But all invain.. Any help ?


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