Re: how to configure the $scaffold?

2006-04-30 Thread V

One possible solution is to rewrite make your own scaffolding. There
you can change whatever you want. You can find the original one under
cake/libs/controller and the views are under
libs/views/templates/scaffolds. I would suggest to you to start with
the views, because you can use your own templates if you want.

The code is:
http://api.cakephp.org/scaffold_8php-source.html

V


--~--~-~--~~~---~--~~
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: Multi file upload

2006-04-30 Thread RosSoft

See these links:

http://www.thinkingphp.org/2006/04/27/an-ajax-file-upload-progressbar/
http://cakeforge.org/snippet/detail.php?type=snippetid=52


--~--~-~--~~~---~--~~
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: about cake and jpgraph

2006-04-30 Thread [EMAIL PROTECTED]

And what's more , I guessed if there is an existed class definition
somewhere else in my project
, So I just change all the redeclared class name to a new name, but
again , I am told that this new class
is redeclared.

PS:
   I just use straight include statement in my project to import
jpgraphp libs.


--~--~-~--~~~---~--~~
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: about cake and jpgraph

2006-04-30 Thread [EMAIL PROTECTED]

I post my error report here:

Fatal error: Cannot redeclare _phperrorhandler() (previously declared
in /usr/local/www/jplib/jpgraph.php:494) in
/usr/local/www/jplib/jpgraph.php on line 499

the code segment is here:

function _phpErrorHandler($errno,$errmsg,$filename, $linenum, $vars) {
   //line 494
// Respect current error level
if( $errno  error_reporting() ) {
JpGraphError::RaiseL(25003,basename($filename),$linenum,$errmsg);
}
}  //line 499

if( INSTALL_PHP_ERR_HANDLER ) {
set_error_handler(_phpErrorHandler);
}


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Can cakephp do association save? Please help...

2006-04-30 Thread amir

Hi...

A bit explanations,

Let say i have 2 tables, with hasMany association
1. questions, and
2. answers, where it has foreignkey referred to question, question_id

This 2 tables ofcourse will turn to 2 models Question and Answer with
their association variables set-up.
1. Question has many answer so...in Question model $hasMany = array(
'Answer' = array( 'className' = 'Answer'));
2. Answer belongs to question so..in Answer module $belongsTo = array(
'Question' = array('className' = 'Question'));

Then, I have this array of data...both question and answer data. like
structure below:

Array{
 [Question] = (
  ...,
  [Answer] = {
[0] =(
...),
[1]
=(),
 }
  )
 }

My question is,
1. Can i save both Question and Answer records using
$this-Question-save() ONLY?
2. or do i have to do trigger 2 separate save $this-Question-save and
$this-Answer-save?
3. How can do this with transaction like begin, commit and rollback
trans?

regards
Amir


--~--~-~--~~~---~--~~
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: custom queries

2006-04-30 Thread Timm

Isn't there a solution?

Could the CakePHP framework build this query internally? (I haven't
dealt with associations 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: custom queries

2006-04-30 Thread AD7six


Timm wrote:
 Could the CakePHP framework build this query internally? (I haven't
 dealt with associations yet)
Yes - you need to look into associations, but it's not that hard:
Here's a good starting point
http://wiki.cakephp.org/tutorials:book_titles.

If you set DEBUG to 2, you will see all the SQL queries at the bottom
of your page.

Cheers,

AD7six


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Wiki Future and Wiki Search

2006-04-30 Thread AD7six

Hi all,

What's the future of the Cake wiki?

I notice that it's back online but the search nolonger returns many
results (http://wiki.cakephp.org/?do=searchid=Tutorials). I say many
rather than any as some searches do return _some_ results
(http://wiki.cakephp.org/?do=searchid=class).


Cheers,

AD7six


--~--~-~--~~~---~--~~
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: Can cakephp do association save? Please help...

2006-04-30 Thread AD7six

Hi Amir,

Multiple saves:
I'm pretty sure the answer is that you will need to save each object
individually - if you set Debug to 2 and try it yourself, you'll see
the generated SQL and therefore have you answer, at the foot of the
page after you save.

Transactions:
I don't think there is any support right now, but I'd be glad to be
corrected ;o)

Cheers,

AD7six


--~--~-~--~~~---~--~~
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: custom queries

2006-04-30 Thread Timm

Thanks for your advice. I have already played with associations, but I
could not figure out, how I can get the number of comments associated
with each post. (see the query I presented in the initial post)
In the source code of the CakePHP framework I discovered an attribute
counterQuery (part of the hasMany array), but it seems that the
functionality isn't implemented yet.

But to get back to the inital question:
Suppose a certain very complex query cannot be rewritten with the use
of associations: How can I refer to table names in a flexible manner,
so that prefixes are added by the framework automatically?



 Yes - you need to look into associations, but it's not that hard:
 Here's a good starting point
 http://wiki.cakephp.org/tutorials:book_titles.

 If you set DEBUG to 2, you will see all the SQL queries at the bottom
 of your page.
 
 Cheers,
 
 AD7six


--~--~-~--~~~---~--~~
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: data from multiple 'model' definitions in one 'view'

2006-04-30 Thread AD7six

Hi b,

Are these models related? If you are just wanting all Bs linked to A,
you can easily do this by specifying the recursive parameter for your A
model and searching class A. Ref:
http://groups.google.com/group/cake-php/browse_frm/thread/bef70558f7854732/865df96b0d8b2420?q=recursive+naternum=1#865df96b0d8b2420

If the models are not related, you can define all the models you want
to use in your controller uses variable, and they will be avaliable to
use directly off the controller.

e.g.
class LotsofModelsController extends AppController
{
var $uses = Array(Stuff,Thingy,Thought);

function index();
   $allStuffs = $this-Stuff-findAll();
   $allThingies = $this-Thingy-findAll();
   $allThoughts = $this-Thought-findAll();
...

Hope it helps,

Cheers,

AD7six


--~--~-~--~~~---~--~~
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: Session variables won't save on windowsXP, apache 2.0 and PHP 4.4.0

2006-04-30 Thread welja

Sorry AD7six,

I develop always with FireFox 1.5.0.2 and also tested this with IE 6,
both with the same results.

Further more I don't think it is a wrong server setting on my local
system, the other applications i program also use sessions without
problems. So i really think something is wrong with cake's session
handling on windows. ( but i don't know that much about cake ofcourse )

Because i don't really know what kind of details are needed i'll post
as much as i can think of.


1. A piece of code which sets the session var and a detailed
description of what (should) happen:

?php
class AuthController extends AppController
{

function index()
{

//login actions
if (empty ($this-params['data']))
{
//show form
//a echo for debugging
echo $_SESSION['user'];

}
else // validate post
{
if( $this-Auth-validate(
$this-params['data']['Auth']['username'],
$this-params['data']['Auth']['password'] ) ){
  //$this-Session-write(
'Auth.user',$this-params['data']['Auth']['username'] );
   // tested with cake way and the ordinary
way
$_SESSION['user'] = 
$this-params['data']['Auth']['username'];
$this-flash('OK', '/auth', 1);
}
else
{
$this-Session-delete( 'Auth.user' );
$this-flash('NOT OK', '/auth', 1);
}
}
}

}
?

a. First i call this controller. I am then required to login.
b. When my password validates a session vars Auth.user is written in
the session and
c. a flash ( ok ) is given. ( by the way; the flash never redirects me
automatic? maybe a piece of the puzzle?)
d. I click on the link to the same controller, it should now echo my
previously set session var.
On my windows server it does not do this.
On my nix server it functions correctly.






2. local server specs (a xampp install) (further down the session
settings):

Windows NT NOTEBOOK 5.1 build 2600SystemWindows NT NOTEBOOK 5.1 build
2600
Build Date  Jul 26 2005 01:13:07
Server API  Apache 2.0 Handler
Virtual Directory Support   enabled
Configuration File (php.ini) Path   C:\xampp\apache\bin\php.ini
PHP API 20020918
PHP Extension   20020429
Zend Extension  20050606
Debug Build no
Zend Memory Manager enabled
Thread Safety   enabled
Registered PHP Streams  php, http, ftp, https, ftps, compress.zlib

session
---
Session Support enabled
Registered save handlersfiles user

Directive   Local Value Master Value
session.auto_start  Off Off
session.bug_compat_42   On  On
session.bug_compat_warn On  On
session.cache_expire180 180
session.cache_limiter   nocache nocache
session.cookie_domain   no valueno value
session.cookie_lifetime 0   0
session.cookie_path /   /
session.cookie_secure   Off Off
session.entropy_fileno valueno value
session.entropy_length  0   0
session.gc_divisor  100 100
session.gc_maxlifetime  14401440
session.gc_probability  1   1
session.namePHPSESSID   PHPSESSID
session.referer_check   no valueno value
session.save_handlerfiles   files
session.save_path   C:\xampp\tmpC:\xampp\tmp
session.serialize_handler   php php
session.use_cookies On  On
session.use_only_cookiesOff Off
session.use_trans_sid   Off Off


==
3. remote server specs (further down the session settings)

System  FreeBSD vps1.iu.nl 4.11-RELEASE-p15 FreeBSD 4.11-RELEASE-p15
#9: Fr i386
Build Date  Jan 4 2006 23:16:00
Configure Command   './configure' '--enable-versioning'
'--enable-memory-limit' '--with-layout=GNU'
'--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all'
'--with-regex=php' '--with-openssl=/usr' '--with-openssl-dir=/usr'
'--with-apxs=/usr/local/sbin/apxs' '--prefix=/usr/local'
'i386-portbld-freebsd4.11'
Server API  Apache
Virtual Directory Support   disabled
Configuration File (php.ini) Path   /usr/local/Zend/etc/php.ini
Scan this dir for additional .ini files /usr/local/etc/php
additional .ini files parsed/usr/local/etc/php/extensions.ini
PHP API 20020918
PHP Extension   20020429
Zend Extension  20050606
Debug Build no
Zend Memory Manager enabled
Thread Safety   disabled
Registered PHP Streams  php, http, ftp, https, ftps, compress.zlib,
compress.bzip2


session
---
Session Support enabled
Registered save handlersfiles user

Directive   Local Value Master Value
session.auto_start  

Re: Session variables won't save on windowsXP, apache 2.0 and PHP 4.4.0

2006-04-30 Thread AD7six

This reply should probably be in the ticket.

I'm not the expert here, but I guessed the cause as there wasn't enough
info to know the answer.

Flash doesn't redirect if you have DEBUG set  0.

Next and final guess:
PHP doesn't have rights to save the cookie.

If you put this somewhere (like at the end of your index.php file):

echo session id is .session_id();

and the id keeps changing, it's quite likely that there is a problem
setting cookies rather than a cake specific problem.

Hope you find the problem,

AD7six
PS. I develop on XP, Apache 2.0.55, PHP 4.4.2, cake security set to
high Debug between 0 and 2 and don't get session problems using Firefox
(but do with IE hence the guess in the first reply)


--~--~-~--~~~---~--~~
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: custom queries

2006-04-30 Thread Timm

I guess where are talking at cross purposes.
As long as you use the build-in method (with associations etc.) for
retrieving data from the database everything works well.
But I want to use a custom query, where the automatic construction of
table names does not happen, as far as I know.


 I'm all out of fish for today ;)

 The code I pasted above is using a Model instance, not a table. It's
 taken from code that I use on more than one DB setup, and using
 prefixes.

 By default the table name is the same as the model name but it doesn't
 have to be. You'll find you can modify your DB setup however you want
 (including on the fly if you need) - the answers to all your questions
 are in the wiki (amongst other places).
 
 Happy coding,
 
 AD7six


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---