Problem with Helpers inside element

2006-10-20 Thread Ismael S. Kafeltz

I have the same problem with this person here:
http://groups.google.com/group/cake-php/browse_thread/thread/1a8220651a9741ca/3c1473208724bdb7?lnk=gst&q=helper&rnum=21#3c1473208724bdb7

Nobody helped...

The problem with helper is within a function, outside is works
normally...
Even if i try to put the clause GLOBAL $html with the function it
doesn't work
and $html = new HtmlHelper neither.

if I do this: pr( $html ); it does not show anything...
outside the function it show a completed infomation about $html;

Has anyone here any hint how to solve this?

Remembering, either clausule global $html or $html = new HtmlHelper;
*inside* the function (which is declared inside the element)

I found a damn solution,
function blah ($param1, $param2, $, &$html) { pr ($html); }
This works... but i don't think anyone here would like to do this.


--~--~-~--~~~---~--~~
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: Refactoring Views

2006-10-20 Thread Grant Cox

I'd be interested in seeing it too.

Personally I make a _addedit($id) action in my controller, and a
_addedit.thtml element (in with the normal view files).  These have the
common parts of add and edit in them.  I'm not sure if this will stay
this way once I start serious work on the application UI, but we are
still adding features (including new models, and changing model fields)
at this stage, and this does make it faster to keep things updated.

ie: UsersController:

function add() {
$this->_addedit();
}

function edit($id) {
$this->_addedit($id);
}

function _addedit($id=null)
{
if ( !empty($this->params['form']['cancel']) ){
$this->Session->setFlash('The User was not saved');
$this->redirect('/users/index');
return false;
}

if(empty($this->data)) {
if ( empty($id) ){
// give default values
} else {
// add the associated models for the edit view
$this->_read_associations( $id );
$this->data = $this->User->read(null, $id);
}

$this->render();
} else {
$this->cleanUpFields();

if($this->User->save($this->data)) {
$this->Session->setFlash('The User has been 
saved');
$this->redirect('/users/index');
} else {
$this->Session->setFlash('Please correct errors 
below.');

if ( !empty($id) ){
$this->_read_associations( $id );
}
}
}
}


Both views/users/add.thtml and views/users/edit.thtml have

echo $this->renderElement('../users/_addedit');

in them, which renders the views/users/_addedit.thtml element - this is
what has all the actual form values.  It only has the common form
elements, as you often want some differences between the add and edit
forms.

I also have a views/users/_associated.thtml , which displays the
associated models (like what you normally see on the "view" template).
I like these associations to also be shown when editing, so again it's
a bit simpler to keep in a separate element.


--~--~-~--~~~---~--~~
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: Getting CakePHP installed

2006-10-20 Thread Jamie Fishback

I figured out what was going on with the first part, now I'm getting a
whole new set of errors.  Here's what I have now:
Warning: session_start():
open(C:/InstantRails\tmp\\sess_31689e87ae77a949e7b83d5ad6b0e419,
O_RDWR) failed: No such file or directory (2) in
c:\instantrails\www\cakephp\cake\libs\session.php on line 131

Warning: session_start(): Cannot send session cookie - headers already
sent by (output started at
c:\instantrails\www\cakephp\cake\libs\session.php:131) in
c:\instantrails\www\cakephp\cake\libs\session.php on line 131

Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at
c:\instantrails\www\cakephp\cake\libs\session.php:131) in
c:\instantrails\www\cakephp\cake\libs\session.php on line 131

Warning: session_write_close():
open(C:/InstantRails\tmp\\sess_31689e87ae77a949e7b83d5ad6b0e419,
O_RDWR) failed: No such file or directory (2) in
c:\instantrails\www\cakephp\cake\libs\session.php on line 126

Warning: session_write_close(): Failed to write session data (files).
Please verify that the current setting of session.save_path is correct
(C:/InstantRails\tmp\) in
c:\instantrails\www\cakephp\cake\libs\session.php on line 126

Warning: session_start():
open(C:/InstantRails\tmp\\sess_31689e87ae77a949e7b83d5ad6b0e419,
O_RDWR) failed: No such file or directory (2) in
c:\instantrails\www\cakephp\cake\libs\session.php on line 131

Warning: session_start(): Cannot send session cookie - headers already
sent by (output started at
c:\instantrails\www\cakephp\cake\libs\session.php:131) in
c:\instantrails\www\cakephp\cake\libs\session.php on line 131

Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at
c:\instantrails\www\cakephp\cake\libs\session.php:131) in
c:\instantrails\www\cakephp\cake\libs\session.php on line 131

Thanks for the help

Jamie


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



Flash 8 upload w/ Cake results in corrupted files

2006-10-20 Thread Brad Daily

(PHP 5.1.6, Apache 1.3, Cake 1.1.8.3544)

We are in the process of porting an existing PHP app to cake, and have
ran into an odd problem with file uploads (for images) using Flash 8.
The image appears to upload correctly, to the correct directory, but
when you try to open the file, it is corrupted. The really strange part
is that after the upload is finished, we automatically create a
thumbnail of the image with GD and that file is perfectly fine.

The upload is handled in the controller via:

move_uploaded_file($this->params['form']['Filedata']['tmp_name'],
$destination_dir);

The flash code is the same code we used in the original PHP project, so
I don't think it is causing the issue. I'm hoping someone else has ran
into this and can give some insight...


--~--~-~--~~~---~--~~
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: How to keep same session when redirect to sub-domain ?

2006-10-20 Thread Jon Bennett

> Add your domain prefixed with a "." and don't forget to restart your
> webserver afterwards. eg:

hmm, I reckon this can be done with INI_SET, perhaps either directly
in the session.php class, or within your app bootstrap.php file:

ini_set('session.cookie_domain', ' .foo.com');

hth

j

-- 


jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
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: How to keep same session when redirect to sub-domain ?

2006-10-20 Thread [EMAIL PROTECTED]

Na wrote:
> Hi all,
>
> I have a main site where users login and a lot of sub-site where I want
> to keep data session of the user when he goto their.
>
> So, how to keep same session when redirect to sub-domain ?

If you are using php to handle cake sessions you should be able to get
around subdomain issue by setting value for session.cookie_domain in
your php.ini file

Add your domain prefixed with a "." and don't forget to restart your
webserver afterwards. eg:

; The domain for which the cookie is valid.
session.cookie_domain = .foo.com


--~--~-~--~~~---~--~~
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: dateTimeOptionTag Select

2006-10-20 Thread Darian Anthony Patrick

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

-MM-DD hh:mm I believe Jeff.

Jeff wrote:
> I've tried the 18-12-2006 format.. but I'm only getting the correct
> month to be selected.
> 
> 
> > 

- --
Darian Anthony Patrick <[EMAIL PROTECTED]>
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFOUyFKpzEXPWA4IcRAs3/AKCBmy8vgeXIfbumyx8t9V3HETtNQwCaAxX3
U6XHmB2iCL8xXIYPR7AK8yw=
=mB2h
-END PGP SIGNATURE-

--~--~-~--~~~---~--~~
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: dateTimeOptionTag Select

2006-10-20 Thread Jeff

I've tried the 18-12-2006 format.. but I'm only getting the correct
month to be selected.


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



dateTimeOptionTag Select

2006-10-20 Thread Jeff

I'm trying to select a specific date to show up as the default using
the dateTimeOptionTag.   Does anyone know how to use the selection
field in the html helper?


--~--~-~--~~~---~--~~
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: setting id to null in active record before doing a save within loops

2006-10-20 Thread scott lewis

On 20-Oct-2006, at 14:48, Gil Vidals wrote:

>
> Why is it necessary, when adding multiple records in a while or for
> loop to set the active record's id to null???
>
>  $this->Model->id = 'null';
>  $this->Model->save(...)
>
> If the active record's id is *not* set to null, only the first record
> is inserted and the rest simply do an update to the first record.
> Isn't there a way to set id to null within the save. Hey may be I
> answered my own question.
>
> I'll try $this->save('id' => 'null', 'otherstuff' => 'stuff') to see
> if that works.

Call

$this->Model->create();
$this->Model->save($data);

When creating new records. Other wise Cake assumes you are modifying  
the record previously saved.

s.

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



setting id to null in active record before doing a save within loops

2006-10-20 Thread Gil Vidals

Why is it necessary, when adding multiple records in a while or for
loop to set the active record's id to null???

 $this->Model->id = 'null';
 $this->Model->save(...)

If the active record's id is *not* set to null, only the first record
is inserted and the rest simply do an update to the first record.
Isn't there a way to set id to null within the save. Hey may be I
answered my own question.

I'll try $this->save('id' => 'null', 'otherstuff' => 'stuff') to see
if that works.



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



Re: How to manage large amount of data ?

2006-10-20 Thread leo.cacheux

It works fine when I change the php.ini settings, unfortunately, the
software I'm working on will be executed on a mutualised server, and I
don't know if this file will be accessible.
I tried to use "unset" to free memory but it didn't worked.

Thanks for your 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: Refactoring Views

2006-10-20 Thread Christian Winther

> To be brief, what I've done is create a meta-framework that works 
> hand-in-hand with Cake (using Cake itself and a small number of external 
> scripts and processes) that is able to generate all of my views for me 
> using a series of reusable elements and helpers.
> This meta-framework knows when to expose information on a given screen 
> using what I call "applets" (nothing to do with Java).  Applets are a 
> collection of fields in a certain state and having certain properties 
> (or rather a collection of fields spanning multiple models associated 
> with an instance of an applet that is assigned to a particular view).

Is this a public meta-framework or a private closed source ?

/Christian


--~--~-~--~~~---~--~~
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: Refactoring Views

2006-10-20 Thread Matt Adams

Sonic Baker wrote:

> I was just using the forms generated form Bake as an example to 
> illustrate the types of duplication I mean.
> 
> That meta-framework of yours sounds wonderful. Is it hard on resources?

Not particularly.  Running in production mode it takes about 1 second to 
render each view.

I intend to write a program that will go through all of the permutations 
in my application and build up a data structure that can be loaded and 
accessed several by a Cake app (probably via shared memory or some other 
similar construct).  I haven't crunched the numbers yet but I imagine 
that doing this will give the app around a 50% boost in efficiency.

> If you weren't using it, how would you answer my questions above?

You're right, I didn't quite answer your question.  Sorry.

Yes, I use elements (and lots of helpers) that have all of the necessary 
logic built in or can provide that sort of form logic.  You can almost 
pretend that I don't have a meta-framework.  All it really does is 
provide the data or configuration information necessary to build the 
various pieces of the view (actually it does a lot more than that but as 
far as the view is concerned it only provides a data structure so Cake 
can figure out where to put stuff).


Cheers,

Matt
-- 
BASIC: A programming language.  Related to certain social diseases
in that those who have it will not admit it in polite company.

--~--~-~--~~~---~--~~
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: Refactoring Views

2006-10-20 Thread Sonic Baker
Hi Matt,Thank you for your reply.I was just using the forms generated form Bake as an example to illustrate the types of duplication I mean.That meta-framework of yours sounds wonderful. Is it hard on resources?
If you weren't using it, how would you answer my questions above?Cheers,Sonic

--~--~-~--~~~---~--~~
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: Refactoring Views

2006-10-20 Thread Matt Adams

Sonic Baker wrote:

> In my quest to follow the DRY principle I've been looking into 
> refactoring my views. If you use Bake to generate default views you'll 
> have 'add' and 'edit' views. These both share the same form inputs and 
> if you start playing around with error messages you'll have to do it on 
> both forms.
> Would this warrant the use of Elements?
> Or would an element be overkill for this?
> 
> What are others doing?

I don't use the Baked views for anything other than very small projects 
because I find they quickly become very cumbersome and quite 
unmanageable when you've got a large application to build.

To be brief, what I've done is create a meta-framework that works 
hand-in-hand with Cake (using Cake itself and a small number of external 
scripts and processes) that is able to generate all of my views for me 
using a series of reusable elements and helpers.

This meta-framework knows when to expose information on a given screen 
using what I call "applets" (nothing to do with Java).  Applets are a 
collection of fields in a certain state and having certain properties 
(or rather a collection of fields spanning multiple models associated 
with an instance of an applet that is assigned to a particular view).

I've found very few framework environments in PHP and Perl that provide 
this sort of functionality in an effective and manageable way so I've 
typically had to rebuild it myself when moving to a new framework such 
as Cake.

The neat thing about this is that I can effectively build several 
relatively complex screens with various applets that are linked together 
(such as a list & selection detail combination) inside of a half-hour, 
leaving me plenty of time to be concerned with more important things 
like business logic, tests and whatnot.


Cheers,

Matt
-- 
BASIC: A programming language.  Related to certain social diseases
in that those who have it will not admit it in polite company.

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



Refactoring Views

2006-10-20 Thread Sonic Baker
In my quest to follow the DRY principle I've been looking into refactoring my views. If you use Bake to generate default views you'll have 'add' and 'edit' views. These both share the same form inputs and if you start playing around with error messages you'll have to do it on both forms.
Would this warrant the use of Elements?Or would an element be overkill for this?What are others doing?Cheers,Sonic

--~--~-~--~~~---~--~~
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: Many Models One View

2006-10-20 Thread Chris Hartjes

On 10/20/06, Syl <[EMAIL PROTECTED]> wrote:
>
> Hey Chris
>
> Thanks for your reply.  Could you be a little more specific ?  I've
> read the association stuff in the manual, but it does not speak about
> having unrelated models using a single controller.  Or at least not
> that I can see - I'm new to cake and php.

> Are you talking about creating a view/controller without a model.  I
> remember seeing something about that in my research.
>
> Thanks again,
>
> Sylvia

You can create controllers without associated models.  That's one of
the strengths of the whole Model-View-Controller paradigm that Cake is
built on.  Cake makes it easy to use more than one model in a
controller through the $uses variable that you may have noticed in
some sample controller code.

The point I'm making is that you don't have to stick with the one
model, one controller, one view idea.  You can have multiple models
being used by one controller, and multiple views being used (Rails
calls them partials, can't remember what they are called in Cake.
Elements, I think?)

Hope that helps.

-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: A different way to create ACL database

2006-10-20 Thread x0rster

If I do just "php" I get :

X-Powered-By: PHP/4.4.4
Content-type: text/html

and I get the same with "php cake/scripts/acl.php 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: A different way to create ACL database

2006-10-20 Thread irfan baig

possibly php is not installed to be available via the
shell/commandline on your webserver, or to your user

On 10/20/06, x0rster <[EMAIL PROTECTED]> wrote:
>
> Thanks you AD7six, I didn't saw the sql file
>
> Does anybody knows why I can't get a php cli script working from a
> shell exec ?
> A command like "ls -al" runs perfectly but  "php script.php param1
> param2..." does not do anything.
>
>
> >
>


-- 
Best,
Irfan Baig

--~--~-~--~~~---~--~~
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: How to manage large amount of data ?

2006-10-20 Thread Samuel DeVore

you can also unset the arrays, as you write to the end of the files.
The garbage collection should help you.  You might need to directly
interact with the msysql calls so you can release those connections as
well, I'm not sure how long cake holds them, also you might benifit
from not using persisistant connections.  But also by using limit you
should be able to deal with smaller chunks of your data and just get
them in sets that you loop and unset, loop and unset, writing out
filesystem when ever you can and clearing old data.

I wonder if you couldn't leverage temporary tables in the database to
handle some of the data prep on a per worksheet basis...

Sam D

On 10/20/06, Chris Hartjes <[EMAIL PROTECTED]> wrote:
>
> On 10/20/06, Gil Vidals <[EMAIL PROTECTED]> wrote:
> >
> > This is a PHP error that can be resolved by changing a setting within
> > php.ini. The setting has to be changed to increase the memory or to
> > "-1", which means infinite memory. Unfortunately, I don't recall the
> > exact setting.
> >
> > memory_limit = -1
> >
>
> /me shudders at the ugly hack
>
> Sure, you can tell PHP "suck up all the memory you can get your hands
> on", but I don't think that is the proper solution to the problem.
> The real solution is trying to find a way to read in those CSV files
> and output it as XML in such a way it doesn't run up against ANY
> memory limits that PHP might have.
>
> Leo, have you thought about something like this:
>
> * open up worksheet
> * open up an XML document on the disk
> * loop through data one line at a time
> * translate the data to XML and append the line to the file on disk
> * stop looping
> * close worksheet
> * close XML document
>
> If you only deal with things one small block at a time, you might have
> some success.
>
> Hope that helps..
>
> --
> Chris Hartjes
>
> "The greatest inefficiencies come from solving problems you will never have."
> -- Rasmus Lerdorf
>
> @TheBallpark - http://www.littlehart.net/attheballpark
> @TheKeyboard - http://www.littlehart.net/atthekeyboard
>
> >
>


-- 
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost 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
-~--~~~~--~~--~--~---



Re: Many Models One View

2006-10-20 Thread Syl

Hey Chris

Thanks for your reply.  Could you be a little more specific ?  I've
read the association stuff in the manual, but it does not speak about
having unrelated models using a single controller.  Or at least not
that I can see - I'm new to cake and php.

Are you talking about creating a view/controller without a model.  I
remember seeing something about that in my research.

Thanks again,

Sylvia


--~--~-~--~~~---~--~~
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: How to manage large amount of data ?

2006-10-20 Thread Chris Hartjes

On 10/20/06, Gil Vidals <[EMAIL PROTECTED]> wrote:
>
> This is a PHP error that can be resolved by changing a setting within
> php.ini. The setting has to be changed to increase the memory or to
> "-1", which means infinite memory. Unfortunately, I don't recall the
> exact setting.
>
> memory_limit = -1
>

/me shudders at the ugly hack

Sure, you can tell PHP "suck up all the memory you can get your hands
on", but I don't think that is the proper solution to the problem.
The real solution is trying to find a way to read in those CSV files
and output it as XML in such a way it doesn't run up against ANY
memory limits that PHP might have.

Leo, have you thought about something like this:

* open up worksheet
* open up an XML document on the disk
* loop through data one line at a time
* translate the data to XML and append the line to the file on disk
* stop looping
* close worksheet
* close XML document

If you only deal with things one small block at a time, you might have
some success.

Hope that helps..

-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: A different way to create ACL database

2006-10-20 Thread x0rster

Thanks you AD7six, I didn't saw the sql file

Does anybody knows why I can't get a php cli script working from a
shell exec ?
A command like "ls -al" runs perfectly but  "php script.php param1
param2..." does not do anything.


--~--~-~--~~~---~--~~
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: How to manage large amount of data ?

2006-10-20 Thread Gil Vidals

This is a PHP error that can be resolved by changing a setting within
php.ini. The setting has to be changed to increase the memory or to
"-1", which means infinite memory. Unfortunately, I don't recall the
exact setting.

memory_limit = -1



Gil Vidals


On 10/20/06, leo.cacheux <[EMAIL PROTECTED]> wrote:
>
> I have to generate an Excel workbook (in XML format) with a lot of data
> from my database, so I can't use pagination or something like that, I
> have to get all the data. Each worksheet display data from one DB
> request, and everything works fine when I display only one worksheet.
> Until know, I stored each request result in a huge array and I got
> memory error.
> What I'd like to do is :
> - output the header of the XML document
> - get result from the first request
> - output the first worksheet
> - free memory for the result
> - get result from the second request
> - output the second worksheet
> - free memory
> - ...
> - output the XML footer
>
> This is what I meant when I said "rendering the view in many times" (my
> english may be bad, sorry). I'd like to render the view many times,
> each time with a different worksheet.
>
>
> >
>


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



Re: A different way to create ACL database

2006-10-20 Thread AD7six

Hi x0rster,

You can just run the sql directly:
https://trac.cakephp.org/browser/branches/1.1.x.x/app/config/sql/db_acl.sql

HTH,

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



A different way to create ACL database

2006-10-20 Thread x0rster

Hi,

I'm trying to create the database tables needed for ACL with the
acl.php script

I didn't have command line access to my webserver so I tried to do a
php script doing
$res=shell_exec("php ./cake/scripts/acl.php initdb");
echo $res;

But nothing happens !
I've tried many other things whithout any success.
Does anybody have a solution to run a php cli script from another php
script ?

Or does anybody know another way to create the ACL tables ? (a mysql
dump from a freshly created database containing the acl tables ?)

Thanks for your 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
-~--~~~~--~~--~--~---



Dynamic Menu

2006-10-20 Thread jogo

Hi all!

I'm thinking about to create a dynamic menu (user based). The menu has
its elements stored in a DB. Each user has his own menu elements. This
is my idea:

Using XML. User logged in -> call DB and retrieve his own menu elements
-> write XML file -> apply XLST to show the menu

I don't know if is there any other options but doing SELECTs each time
menu is showed. I think XML way is fine because could be used also as a
webservice

What do you guys think?

greetings!


--~--~-~--~~~---~--~~
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: Many Models One View

2006-10-20 Thread Chris Hartjes

On 10/20/06, Syl <[EMAIL PROTECTED]> wrote:
>
> G'day all -
>
> What would be the best way to manipulate info from many tables using
> one view.  Here's what I'm working onI've got three types of
> keywords:
>
> Category,  Subcategory and Help Categories.
>
> All three have their own models, controllers and views.  However, my
> users want to be able to treat them all as "keywords".  So, I'll need a
> page where they can add a keyword, and select the "type of keyword".
> And, a page that can list them all.
>
> I don't want to have to re-build everything.  There must be a way to do
> this.any ideas anyone ?
>
> Thank you all !
>
> Sylvia


Hi Sylvia,

I'd suggest you read up on model associations so that you can have one
controller that pulls in all the associated data from the models.
Simple stuff really.

Take a close look at belongTo and hasMany.

-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



Many Models One View

2006-10-20 Thread Syl

G'day all -

What would be the best way to manipulate info from many tables using
one view.  Here's what I'm working onI've got three types of
keywords:

Category,  Subcategory and Help Categories.

All three have their own models, controllers and views.  However, my
users want to be able to treat them all as "keywords".  So, I'll need a
page where they can add a keyword, and select the "type of keyword".
And, a page that can list them all.

I don't want to have to re-build everything.  There must be a way to do
this.any ideas anyone ?

Thank you all !

Sylvia


--~--~-~--~~~---~--~~
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: How to keep same session when redirect to sub-domain ?

2006-10-20 Thread Chris Hartjes

On 10/20/06, Na <[EMAIL PROTECTED]> wrote:
>
> In cookie of the main site I have an ID. But how to init cake session
> with this ID?
>

Sounds like you may need to use a custom session handler in order to
make sure your entire site uses the same session database.  I haven't
seen any solutions that work across subdomains that don't involve a
custom session handler.

-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: How to keep same session when redirect to sub-domain ?

2006-10-20 Thread Na

In cookie of the main site I have an ID. But how to init cake session
with this ID?


--~--~-~--~~~---~--~~
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: How to manage large amount of data ?

2006-10-20 Thread leo.cacheux

I have to generate an Excel workbook (in XML format) with a lot of data
from my database, so I can't use pagination or something like that, I
have to get all the data. Each worksheet display data from one DB
request, and everything works fine when I display only one worksheet.
Until know, I stored each request result in a huge array and I got
memory error.
What I'd like to do is :
- output the header of the XML document
- get result from the first request
- output the first worksheet
- free memory for the result
- get result from the second request
- output the second worksheet
- free memory
- ...
- output the XML footer

This is what I meant when I said "rendering the view in many times" (my
english may be bad, sorry). I'd like to render the view many times,
each time with a different worksheet.


--~--~-~--~~~---~--~~
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: How to manage large amount of data ?

2006-10-20 Thread Chris Hartjes

On 10/20/06, leo.cacheux <[EMAIL PROTECTED]> wrote:
>
> After looking at dbo_source.php, the error is from PHP which cannot
> allow a too big array. Is it possible to render the view in many times
> so I would be able to free memory between each request ?
>

I don't quite follow your thinking here.  The issue appears to be that
you cannot hold the entire result set in memory without causing PHP to
freak out and use up all the memory available to it.
How would rendering the view multiple times help you to free up memory
between each request?

Could you perhaps use pagination and LIMIT/OFFSET in your queries to
only grab the dataset you actually need to display?  Otherwise I think
you'll still run into the same problem of running out of memory for
PHP to run in.
-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: How to keep same session when redirect to sub-domain ?

2006-10-20 Thread Chris Hartjes

On 10/20/06, leo.cacheux <[EMAIL PROTECTED]> wrote:
>
> I might be wrong, but if the session id is stored in a cookie, it can't
> be used on another subdomain. I suppose that using session id in a GET
> request should work.
>

That's not the case.  I used to work for a company that has a huge
adult dating site and we used sessions across subdomains.

-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: How to manage large amount of data ?

2006-10-20 Thread leo.cacheux

After looking at dbo_source.php, the error is from PHP which cannot
allow a too big array. Is it possible to render the view in many times
so I would be able to free memory between each request ?


--~--~-~--~~~---~--~~
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: How to keep same session when redirect to sub-domain ?

2006-10-20 Thread leo.cacheux

I might be wrong, but if the session id is stored in a cookie, it can't
be used on another subdomain. I suppose that using session id in a GET
request should work.


--~--~-~--~~~---~--~~
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: How to manage large amount of data ?

2006-10-20 Thread Chris Hartjes

On 10/20/06, leo.cacheux <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I have a (quite big) request in my Cake application. When I call it one
> time, it works fine, but I have to call it many times in a loop to fill
> many arrays, and I get this error :
>
> Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
> allocate 1024 bytes) in
> /appli/projects/fluidit/apache_2.0.59/htdocs/fluidit/cake/libs/model/datasources/dbo_source.php
> on line 308
>

Hi Leo,

This is definitely a PHP error.  I run into it all the time time when
I try to load too much information from a database into memory. :)

> I don't know if this is a MySQL or a PHP error. The 8388608 bytes
> correspond to some buffer variables in the MySQL configuration so it
> seems to come from here, but I might be wrong.
> I can't change the MySQL or PHP config, so I'd like to "split" the
> requests in many parts to avoid this problem. If the error come from
> MySQL, I could execute each request in a different connexion, and if it
> come from PHP, maybe render a first part of the data, then execute the
> next request, then render again...
> How could I do this with Cake ?

This is just my opinion, but this isn't really a Cake issue. This is
more a code-and-query-optimizing issue.   I would invest some time in
seeing if you can't get MySQL to do the bulk of the work before you
start loading up arrays with large amounts of data.

Hope that helps.

-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: Moving methods to AppModel

2006-10-20 Thread Sonic Baker
Hi Marcelo,Thanks for your input. Taken on board.Cheers,Sonic

--~--~-~--~~~---~--~~
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: Getting CakePHP installed

2006-10-20 Thread felipenasc

try the simplest thing first:


ServerName localhost
DocumentRoot "C:\YOUR_PATH\www\cakephp\app"


make sure your cake folder is in the same level of your app folder:

C:\YOUR_PATH\www\cakephp\
+-- app
+-- cake

Follow the docs, it is quite simple if you try the simplest first.
http://manual.cakephp.org/chapter/installing

[]s
Felipe

Felipe


--~--~-~--~~~---~--~~
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: How to keep same session when redirect to sub-domain ?

2006-10-20 Thread Chris Hartjes

On 10/20/06, Na <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I have a main site where users login and a lot of sub-site where I want
> to keep data session of the user when he goto their.
>
> So, how to keep same session when redirect to sub-domain ?
>
>

As far as I know there are no limitations on sessions across a
sub-domain as long as your session handling code continues to point at
the same source.

Hope that helps.


-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: List of reference site?

2006-10-20 Thread Elchtest

oops, missed that ...

thank you
J.F.


--~--~-~--~~~---~--~~
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: autocomplete options ?

2006-10-20 Thread Steniskis

Thank again Leo, I'll keep you informed through this thread.
Sten


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



How to keep same session when redirect to sub-domain ?

2006-10-20 Thread Na

Hi all,

I have a main site where users login and a lot of sub-site where I want
to keep data session of the user when he goto their.

So, how to keep same session when redirect to sub-domain ?


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



How to manage large amount of data ?

2006-10-20 Thread leo.cacheux

Hi all,

I have a (quite big) request in my Cake application. When I call it one
time, it works fine, but I have to call it many times in a loop to fill
many arrays, and I get this error :

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate 1024 bytes) in
/appli/projects/fluidit/apache_2.0.59/htdocs/fluidit/cake/libs/model/datasources/dbo_source.php
on line 308

I don't know if this is a MySQL or a PHP error. The 8388608 bytes
correspond to some buffer variables in the MySQL configuration so it
seems to come from here, but I might be wrong.
I can't change the MySQL or PHP config, so I'd like to "split" the
requests in many parts to avoid this problem. If the error come from
MySQL, I could execute each request in a different connexion, and if it
come from PHP, maybe render a first part of the data, then execute the
next request, then render again...
How could I do this with Cake ?

TIA


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



Scaffolding and MS SQL Server Express Edition

2006-10-20 Thread Marko Djukic

Hi!

I've only just started using CakePHP and I tried using its scaffolding 
feature. I've created a simple database with two tables according to the 
conventions in MS SQL Server Express.
I tried scaffolding on one table (table name testcodes, columns: id, 
code, description, created, modifed). The empty table was shown with no 
error. Adding a row also worked (I checked the db), but when i wanted to 
look at the table again, the were errors like these:

Notice: Undefined index: id in 
\cake\libs\view\templates\scaffolds\index.thtml on line 106
Notice: Undefined index: code in 
\cake\libs\view\templates\scaffolds\index.thtml on line 106
...etc...
And under actions:
Notice: Undefined index: id in 
\cake\libs\view\templates\scaffolds\index.thtml on line 113

Errors were repeated for each row in the table.

I made a similar database in postgres and it worked with no errors.

Are there problems with MSSQL Server EE or am I just missing something?

My configuration:
PHP 5.1.6
Adodb 4.9.2
Apache 2.0.55
Postgresql 8.1
MS SQL Server Express Edition 9.0.1399

Thanks

-- 
Marko Djukic


--~--~-~--~~~---~--~~
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: Helpers and Components

2006-10-20 Thread davide
leo.cacheux wrote:
> 
> You forgot to call "view" in the helper :
> 
> class MyHelper...
>function dumb(param1, param2){
>   return $this->view->controller->MyComponent->dumb(param1,
> param2);
>}

Cool, it works!

Now the question is: is this the better way to implement the feature?
Otherwise, what do you advise?

Thanks and Bye
Davide

-- 
By the power of Greyskull...



signature.asc
Description: OpenPGP digital signature


Re: Helpers and Components

2006-10-20 Thread leo.cacheux

You forgot to call "view" in the helper :

class MyHelper...
   function dumb(param1, param2){
  return $this->view->controller->MyComponent->dumb(param1,
param2);
   }
...


--~--~-~--~~~---~--~~
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: Helpers and Components

2006-10-20 Thread Christian Winther

You could make your methods static and access them with ClassName::yourMethod 
aswell as $className->yourMethod

/Christian 

-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of davide
Sent: 20. oktober 2006 11:49
To: Cake PHP ML
Subject: Helpers and Components

Sometime ago, I developed my own helpers for formatting date. Everything is ok, 
but now I need those function even in the controller level. So I thought about 
components. Everything is still fine. Now I wouldn't like to duplicate the 
code, I would like something like using the components code from the helpers. 
Something like

class MyHelper...
   function dumb(param1, param2){
  return $this->controller->MyComponent->dumb(param1, param2);
   }
...

It seems not to working, so I ask. Which should be the best way for obtaining 
this feature? Maybe a static library referenced with the vendors()?

Bye
Davide

--
By the power of Greyskull...



--~--~-~--~~~---~--~~
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: Moving methods to AppModel

2006-10-20 Thread Marcelo de Moraes Serpa
Well, don't take "composite over inheritance" too serious. There are times where inheritance is the best way, no doubt.On 10/20/06, Sonic Baker
 <[EMAIL PROTECTED]> wrote:
On 10/20/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]
> wrote:
> 2. Make an intermediate model; inherit this from AppModel and Inherit the> two models from this.that was the first thing i thought about too.  and i think it's thecleanest, best, most-OO way ;-)
Hi Deiter,Thanks for your advice. I was reading some articles that favoured Composition over Inheritance but I agree the inheritance in probably the cleanest.Cheers again for your input,
Sonic





--~--~-~--~~~---~--~~
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: Moving methods to AppModel

2006-10-20 Thread Sonic Baker
On 10/20/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> 2. Make an intermediate model; inherit this from AppModel and Inherit the> two models from this.that was the first thing i thought about too.  and i think it's thecleanest, best, most-OO way ;-)
Hi Deiter,Thanks for your advice. I was reading some articles that favoured Composition over Inheritance but I agree the inheritance in probably the cleanest.Cheers again for your input,
Sonic

--~--~-~--~~~---~--~~
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: Moving methods to AppModel

2006-10-20 Thread [EMAIL PROTECTED]

> 2. Make an intermediate model; inherit this from AppModel and Inherit the
> two models from this.

that was the first thing i thought about too.  and i think it's the
cleanest, best, most-OO way ;-)


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



Password protect scaffolding pages

2006-10-20 Thread xhenxhe

I have some scaffolding that is useful to me, but I'd like some form of
password authentication. For example, I have mydomain.com/users/ which
is simple a scaffold page that I would like to protect with a password.
But I would like users to be able to see mydomain.com/users/add without
authentication.

What is the easiest/best way to go about this?


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



Moving methods to AppModel

2006-10-20 Thread Sonic Baker
Hi,I have a model method which I'd like to use in two different models. If I move it into AppModel it'll get loaded for every model which I could be inefficient (IIRC). So as far as I can see I have 3 further choices.
1. Include the Model in the $uses[] array of the controller I want to call the method from.2. Make an intermediate model; inherit this from AppModel and Inherit the two models from this.3. Make a Composite of with AppModel and the new functionality.
Has anyone any advice?Cheers,Sonic

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


Helpers and Components

2006-10-20 Thread davide
Sometime ago, I developed my own helpers for formatting date. Everything
is ok, but now I need those function even in the controller level. So I
thought about components. Everything is still fine. Now I wouldn't like
to duplicate the code, I would like something like using the components
code from the helpers. Something like

class MyHelper...
   function dumb(param1, param2){
  return $this->controller->MyComponent->dumb(param1, param2);
   }
...

It seems not to working, so I ask. Which should be the best way for
obtaining this feature? Maybe a static library referenced with the
vendors()?

Bye
Davide

-- 
By the power of Greyskull...



signature.asc
Description: OpenPGP digital signature


Re: autocomplete options ?

2006-10-20 Thread leo.cacheux

The $ajax->autoComplete method create the  element itself, so you
don't need it in your page and in the 'update' field.
An error can also come from your '/tournees/refresh_vehicules'
controller method or view.


--~--~-~--~~~---~--~~
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: Using Exceptions in Cake

2006-10-20 Thread Evan

exceptions are only available in php5.  they wouldn't work with php4.
cake was primarily made to support php4, so i don't think they're gonna
implement exceptions here.


--~--~-~--~~~---~--~~
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: autocomplete options ?

2006-10-20 Thread Steniskis

Here is the code :


  

Véhicule autoComplete('Vehicule/listedesvehicules','/tournees/refresh_vehicules',
array('size'=>'20','minChars'=>'4', 'update'=>'misajour_vehicules',
'afterUpdate'=>"pick_vehicule")); ?>




hidden ("Vehicule/IDP_vehicule",
array('class'=>"vehicule_id",'id'=>"vehicule_id", 'value'=>"")); ?>




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