'] = 'FLW' . $result['Model'] ['id'];
}
return $results; //
}
-Messaggio originale-
Da: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Per conto
di djiize
Inviato: sabato 17 marzo 2007 19.35
A: Cake PHP
Oggetto: Re: Format ID field throughout
try
:[EMAIL PROTECTED] Per conto
di djiize
Inviato: sabato 17 marzo 2007 19.35
A: Cake PHP
Oggetto: Re: Format ID field throughout
try to play with the Model's function afterFind
A quick try, in your model:
function afterFind($results) {
foreach ($results as $result_id = $result) {
$results
PROTECTED] Per conto
di djiize
Inviato: sabato 17 marzo 2007 19.35
A: Cake PHP
Oggetto: Re: Format ID field throughout
try to play with the Model's function afterFind
A quick try, in your model:
function afterFind($results) {
foreach ($results as $result_id = $result
Hi,
I am looking for the best way to format an ID field every time it
appears, without having to specifcally tell it to. Let me explain a
bit further:
I have a table called Projects, each project has an ID (numeric auto
increment) so a typical output from a db call would be:
ID, Project Name,
try to play with the Model's function afterFind
A quick try, in your model:
function afterFind($results) {
foreach ($results as $result_id = $result) {
$results[$result_id]['Model']['id'] = 'FLW' . $result['Model']
['id'];
}
}
On 17 mar, 13:30, Mike Digital Egg [EMAIL PROTECTED] wrote:
:[EMAIL PROTECTED] Per conto
di djiize
Inviato: sabato 17 marzo 2007 19.35
A: Cake PHP
Oggetto: Re: Format ID field throughout
try to play with the Model's function afterFind
A quick try, in your model:
function afterFind($results) {
foreach ($results as $result_id = $result) {
$results