Re: help with sessions and frames

2007-11-14 Thread chowdary


thank you.

I have put the session timeout period on each page so if some user
remains inactive for 10 minutes (all webforms in main frame), he will
be redirected to login.php page through header. Problem is that, the
login.php page will certainly be opening in main frame, thus the links
in main parent window will remain there. What I need is that this
login.php must be opened in parent window , if any page in main frame
finds the session timedout. Thank you in advance for any help ...

please let me know how the navigation frame is refreshed from the
server?

thankyou.
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Extending the Form Helper to change output HTML?

2007-11-14 Thread Grant Cox

You could create your own helper that extends FormHelper, and just
overload the appropriate functions that you want modified (like the
error() function).

Or, if you want all the s created to be s, you might be able
to do something like

$form->Html->tags['block'] = '%s';
$form->Html->tags['blockstart'] = '';
$form->Html->tags['blockend'] = '';
echo $form->input('Your.field');

But honestly it's probably easiest just to modify your CSS - what's so
special about a  that you can't do with a  ?


On Nov 15, 3:46 pm, Action <[EMAIL PROTECTED]> wrote:
> I don't like the fact that the Form Helper outputs its error message
> using divs. How could I go about change it so it uses  tags
> instead, for example?
>
> The same goes for the divs used by setFlash()
>
> 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?hl=en
-~--~~~~--~~--~--~---



Re: Null values in Controller URL

2007-11-14 Thread francky06l

Actually I needed to add it in beforeFilter in order to have the
"fields" passed as argument for paginate.
I remember trying to find out and dig in code, until I had
Router::connectNamed(array('field1', 'field2')), I kept having the
argument in passedArgs but in the form:

$this->passedArgs[0] = 'field1:value';

But again it was a while ago. I still have this option in my
application, using the SVN branch from a week ago or so, it still
work. I will try removing to check if this still works
cheers

On Nov 15, 6:56 am, Grant Cox <[EMAIL PROTECTED]> wrote:
> No, you don't need to use connectNamed, they will be in $this-
>
> >passedArgs anyway
>
> In fact, I don't even know what connectNamed is for - something to
> look into I guess.  Even custom named routes seem to work fine without
> it - e.g
>
> Router::connect('/:language/search/:controller',
> array('action'=>'search));
> echo Router::url( array('language'=>'german') );
> => /cake1.2/german/search/posts
>
> Can anyone reading this provide a good explanation of what
> connectNamed actually does?
>
> On Nov 15, 9:19 am, francky06l <[EMAIL PROTECTED]> wrote:
>
> > In order to passedArgs to work as you described, do they still need to
> > be declared in
> > Router:::connectNamed ? I have had troubles with args, but few months
> > ago ...
> > Cheers
>
> > On Nov 15, 12:01 am, Grant Cox <[EMAIL PROTECTED]> wrote:
>
> > > Any parameters that are optional should be done with named parameters,
> > > ie
>
> > > /your/action/id:123/parent:32
>
> > > in your action just look at $this->passedArgs['id'] and 
> > > $this->passedArgs['parent'].  These do not interfere with required
>
> > > parameters, and can be in any order.  For example, given the action
>
> > > function edit( $id=null ){
> > >   $this->log( $this->passedArgs['parent'] );
> > >   $this->log( $this->passedArgs['sibling'] );
>
> > > }
>
> > > you could access via
> > > /controller/edit/1
> > > /controller/edit/1/parent:123/sibling:432
> > > /controller/edit/sibling:432/parent:123/1
>
> > > and all would have the $id = 1
>
> > > On Nov 15, 2:51 am, kgrimm <[EMAIL PROTECTED]> wrote:
>
> > > > thanks for your help, then I will change the order of the parameters.
> > > > I had this idea too, but it means I'll have to change quite a few
> > > > pieces of existing code, and I'm always afraid of missing some.
>
> > > > On Nov 14, 5:40 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > > > > Pass this as the second parameter of your url, then you can default
> > > > > your second parameter to null in the controller. Of course this if you
> > > > > are not doing the same for the $part2 already ..
> > > > > Otherwise create another method in controller that calls an internal
> > > > > method (to handle both cases).
>
> > > > > On Nov 14, 5:37 pm, kgrimm <[EMAIL PROTECTED]> wrote:
>
> > > > > > actually that won't help, because I need to make a difference 
> > > > > > between
> > > > > > null and 0 (0 in this case means to create a new table row). My
> > > > > > current solution is to pass a fixed value that has no other meaning,
> > > > > > e.g. -1, and set the parameter to null in the controller function if
> > > > > > it equals it. But I don't like it that way, so I just wondered if
> > > > > > there's a possibility to pass 'null'.
>
> > > > > > On Nov 14, 5:31 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > > > > > > you can pass 0, in your controller you can check if($part1) for
> > > > > > > example
>
> > > > > > > On Nov 14, 5:28 pm, kgrimm <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > Hi,
>
> > > > > > > > how can I pass null values to a controller function using its 
> > > > > > > > URL?
>
> > > > > > > > for example: "controller/function/par1/par2", how can I make 
> > > > > > > > par1
> > > > > > > > null?
>
> > > > > > > > Thanks in advance!
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



model transaction on multiple models

2007-11-14 Thread Greg

If I want to perform a transaction on multiple models.  In the newest
version of Cake 1.2, is there a 'right' way to do it?  It worked when
I chose any random model involved in the transaction and used:

$this->Model1->begin();
$this->Model1->save();
$this->Model2->save();
...
$this->Model1->rollback();

In doing this, the changes for every model rolled back fine.  Does it
seem incorrect (maybe just conventionally) to use a model to control
the transaction over all the other models?  Or is there a global type
of transaction I should be using?

Thanks in advance.
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: help with sessions and frames

2007-11-14 Thread Grant Cox

Frames are separate webpages.  If you don't refresh a page, it will
not update by itself.  So when your session has expired, until the
navigation frame is refreshed from the server (to get the new page
showing "you are not logged in"), then it will continue to display the
same content.



On Nov 15, 4:38 pm, chowdary <[EMAIL PROTECTED]> wrote:
> hi,
>
> iam using  frames in my website, there are 2 frames in site.  when
> sessions are expired the login page is displaying in the main frame,
> but the other frame as it is in above. why the above frame is not
> disappearing? is it means sessions are not expired in the above
> frame?
> please help me that the login page has to be displayed in a new
> page
>
> please help me,
>
> thanking u in advance
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Anyone running into this too?

2007-11-14 Thread [EMAIL PROTECTED]

see this great article in bakery
http://bakery.cakephp.org/articles/view/create-multiple-checkboxes-instead-of-a-multiple-select-in-your-views


On Nov 14, 6:28 pm, Langdon Stevenson <[EMAIL PROTECTED]>
wrote:
> Hi Daniel
>
> My solution to this problem (when using check boxes with HABTM
> relationships) is to test the data coming back to the controller.  If
> there is no array for (in your case) Services, then I would add an empty
> array called Services.
>
> This will force Cake to delete all of the relationships in the join table.
>
> Regards,
> Langdon
>
> DGPhoebus wrote:
> > Using Cake 1.2.0.5875 pre-beta, have two tables Islands, Services
> > (Concierge Services), and a join table islands_services.  Services are
> > presented as a list of checkboxes.  When an island is updated the post
> > data contains this:
>
> > Array
> > (
> > [Island] => Array
> > (
>
> > )
> > [Service] => Array
> > (
> >[Service] =>
> >   (
> >   )
> > )
> > )
>
> > And obviously inside the arrays is the post data.   What I am finding
> > is that upon calling $this->Island->save($this->data), if all services
> > are "unchecked" (essentially "remove" all services from an island
> > definition) the post data now looks like this:
>
> > Array
> > (
> > [Island] => Array
> > (
>
> > )
> > )
>
> > But upon calling $this->Island->save($this->data) the join table is
> > not updated (all related rows are not deleted).  [Service] must be
> > present in the post data for the Model to update the join table.  So I
> > have hacked it and I test to see if that array exists in the post data
> > and if not I add it which then causes the join table to be updated
> > correctly.  Just wondering if this is a bug... cause the alpha release
> > didn't work like this
>
> > Thanks all.
>
> > Daniel

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



help with sessions and frames

2007-11-14 Thread chowdary

hi,

iam using  frames in my website, there are 2 frames in site.  when
sessions are expired the login page is displaying in the main frame,
but the other frame as it is in above. why the above frame is not
disappearing? is it means sessions are not expired in the above
frame?
please help me that the login page has to be displayed in a new
page

please help me,

thanking u in advance
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Null values in Controller URL

2007-11-14 Thread Grant Cox

No, you don't need to use connectNamed, they will be in $this-
>passedArgs anyway

In fact, I don't even know what connectNamed is for - something to
look into I guess.  Even custom named routes seem to work fine without
it - e.g

Router::connect('/:language/search/:controller',
array('action'=>'search));
echo Router::url( array('language'=>'german') );
=> /cake1.2/german/search/posts

Can anyone reading this provide a good explanation of what
connectNamed actually does?


On Nov 15, 9:19 am, francky06l <[EMAIL PROTECTED]> wrote:
> In order to passedArgs to work as you described, do they still need to
> be declared in
> Router:::connectNamed ? I have had troubles with args, but few months
> ago ...
> Cheers
>
> On Nov 15, 12:01 am, Grant Cox <[EMAIL PROTECTED]> wrote:
>
> > Any parameters that are optional should be done with named parameters,
> > ie
>
> > /your/action/id:123/parent:32
>
> > in your action just look at $this->passedArgs['id'] and 
> > $this->passedArgs['parent'].  These do not interfere with required
>
> > parameters, and can be in any order.  For example, given the action
>
> > function edit( $id=null ){
> >   $this->log( $this->passedArgs['parent'] );
> >   $this->log( $this->passedArgs['sibling'] );
>
> > }
>
> > you could access via
> > /controller/edit/1
> > /controller/edit/1/parent:123/sibling:432
> > /controller/edit/sibling:432/parent:123/1
>
> > and all would have the $id = 1
>
> > On Nov 15, 2:51 am, kgrimm <[EMAIL PROTECTED]> wrote:
>
> > > thanks for your help, then I will change the order of the parameters.
> > > I had this idea too, but it means I'll have to change quite a few
> > > pieces of existing code, and I'm always afraid of missing some.
>
> > > On Nov 14, 5:40 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > > > Pass this as the second parameter of your url, then you can default
> > > > your second parameter to null in the controller. Of course this if you
> > > > are not doing the same for the $part2 already ..
> > > > Otherwise create another method in controller that calls an internal
> > > > method (to handle both cases).
>
> > > > On Nov 14, 5:37 pm, kgrimm <[EMAIL PROTECTED]> wrote:
>
> > > > > actually that won't help, because I need to make a difference between
> > > > > null and 0 (0 in this case means to create a new table row). My
> > > > > current solution is to pass a fixed value that has no other meaning,
> > > > > e.g. -1, and set the parameter to null in the controller function if
> > > > > it equals it. But I don't like it that way, so I just wondered if
> > > > > there's a possibility to pass 'null'.
>
> > > > > On Nov 14, 5:31 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > > > > > you can pass 0, in your controller you can check if($part1) for
> > > > > > example
>
> > > > > > On Nov 14, 5:28 pm, kgrimm <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Hi,
>
> > > > > > > how can I pass null values to a controller function using its URL?
>
> > > > > > > for example: "controller/function/par1/par2", how can I make par1
> > > > > > > null?
>
> > > > > > > Thanks in advance!
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Extending the Form Helper to change output HTML?

2007-11-14 Thread Action

I don't like the fact that the Form Helper outputs its error message
using divs. How could I go about change it so it uses  tags
instead, for example?

The same goes for the divs used by setFlash()

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?hl=en
-~--~~~~--~~--~--~---



Re: jQuery $.ajax() and on success result processing?

2007-11-14 Thread Action

I would also like to know.

On Oct 9, 6:14 am, Fanck <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm new tojQuery, but I wonder if it is possible to return a result
> via controller thatjQuerycan handle on success?
>
> I'm trying to POST data to an "add" method, and on success loading the
> view with the right $id. Anyone know how to do that?
>
> 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?hl=en
-~--~~~~--~~--~--~---



Re: Anyone running into this too?

2007-11-14 Thread Langdon Stevenson

Hi Daniel

My solution to this problem (when using check boxes with HABTM 
relationships) is to test the data coming back to the controller.  If 
there is no array for (in your case) Services, then I would add an empty 
array called Services.

This will force Cake to delete all of the relationships in the join table.

Regards,
Langdon



DGPhoebus wrote:
> Using Cake 1.2.0.5875 pre-beta, have two tables Islands, Services
> (Concierge Services), and a join table islands_services.  Services are
> presented as a list of checkboxes.  When an island is updated the post
> data contains this:
> 
> Array
> (
> [Island] => Array
> (
> 
> )
> [Service] => Array
> (
>[Service] =>
>   (
>   )
> )
> )
> 
> And obviously inside the arrays is the post data.   What I am finding
> is that upon calling $this->Island->save($this->data), if all services
> are "unchecked" (essentially "remove" all services from an island
> definition) the post data now looks like this:
> 
> Array
> (
> [Island] => Array
> (
> 
> )
> )
> 
> But upon calling $this->Island->save($this->data) the join table is
> not updated (all related rows are not deleted).  [Service] must be
> present in the post data for the Model to update the join table.  So I
> have hacked it and I test to see if that array exists in the post data
> and if not I add it which then causes the join table to be updated
> correctly.  Just wondering if this is a bug... cause the alpha release
> didn't work like this
> 
> Thanks all.
> 
> Daniel
> 
> 
> > 

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



RE: generated list not available in one view, results in "Undefined variable" referencing the list variable.

2007-11-14 Thread ldb

G'day

I feel that I am somewhat standing in front of a forest shooting at
it, hoping to hit a tree looking for what would cause the following. I
am hoping I've just  missed something in my usage of CakePHP here and
someone can refer me to the right doc.

I have a controller  called "model_alternates_controller.php" which
contains the following lines (amoung others):

$this->ModelAlternate->recursive = 0;
$this->set('modelAlternates', $this->ModelAlternate-
>findAll());
$this->set('tirelist', $this->ModelAlternate-
>generateList( ));

I have two views defined in the following structure:
 app/views/model_alternates/index.thtml
 app/views/models/index.thtml

In app/views/model_alternates/index.thtml, I have the following:

 selectTag('ModelAlternate/
alt_model_id', $tirelist, null, array('Model_Number' =>
'model_alternates'));
   ?>



This works fine in the models_alternates view but putting the same
lines in the "models/index.thtml" just gives me "Notice: Undefined
variable: tirelist in http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $form->checkbox having troubles.

2007-11-14 Thread Mr-Yellow

So what is the hidden field? I imagine it keeps defaults or
something.

Seems strange that there is no native way to do multiple grouped
checkboxes, have to hack it instead of Cake properly appending the
data onto the name instead of the value.

-Ben


On Nov 9, 6:00 am, maschoen <[EMAIL PROTECTED]> wrote:
> I've figured out what the strange hidden inputs are about.   The only
> big issue I have is why type="checkbox" is repeated.
> This might not seem like a big problem, but I sometimes have to run
> the generated HTML through an XML parser.   This is a first step to
> converting it to a JSON string to return an XMLHTTP request.   The
> problem is that the XML parser barfs on the duplicate attribute.
> It's very picky.
>
> Anyone know why the duplicate type= or how to stop it?
>
> 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?hl=en
-~--~~~~--~~--~--~---



Re: Saving data in '/posts/view' instead of '/posts/add' = bad practice? How can I fix this?

2007-11-14 Thread Action

I found this solution in the Bakery:
http://bakery.cakephp.org/articles/view/validation-in-another-controller

Basically, it stores the validation information into a session so both
controllers have access to it. Would this be worth implementing?

I'm just worried about getting into bad habits (i.e. a function called
'view' doing tasks other than just retrieving data).

On Nov 14, 7:02 pm, yolabingo <[EMAIL PROTECTED]> wrote:
> On Nov 12, 11:10 am, Action <[EMAIL PROTECTED]> wrote:> Is my aforementioned 
> working method (using /posts/view to handle
> > comment saving) bad practice?
>
> Not at all.  I think you're just being distracted by the function name
> "view" - which probably triggers a response in your brain, based on
> what you've read of MVC design, that views should never, ever modify
> the database.  In your case, you've got a controller function named
> 'view' doing controller-y things.  Seems completely reasonable.
>
> > If so, is there any way I can save the
> > data in /posts/addcomment or /comments/add and have it return to the /
> > posts/view/blog_post_name view with the validation error messages
> > working?
>
> Sure, but why bother?  Having Cake automagically handle validation
> error messages is a nice benefit.
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Production Server, file_get_contents, Permission denied

2007-11-14 Thread Zaza

The whole tmp and cache directory is 777. Cake can write the cached
model files but then throws warnings when it tries to read them 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?hl=en
-~--~~~~--~~--~--~---



Re: generated list not available in one view, results in "Undefined variable" referencing the list variable.

2007-11-14 Thread ldb

G'day

Ah, finally found the right reference. Don't know how I missed it on
the first time through the CakePHP manual but I plan on re-reading it
anyway . The "var $uses =  " is the solution.  Thanks anyway, and
sorry for the extra  noise...;-)

http://manual.cakephp.org/chapter/controllers


On Nov 14, 5:18 pm, ldb <[EMAIL PROTECTED]> wrote:
> G'day
>
> I feel that I am somewhat standing in front of a forest shooting at
> it, hoping to hit a tree looking for what would cause the following. I
> am hoping I've just  missed something in my usage of CakePHP here and
> someone can refer me to the right doc.
>
> I have a controller  called "model_alternates_controller.php" which
> contains the following lines (amoung others):
>
> $this->ModelAlternate->recursive = 0;
> $this->set('modelAlternates', 
> $this->ModelAlternate->findAll());
>
> $this->set('tirelist', $this->ModelAlternate-
>
> >generateList( ));
>
> I have two views defined in the following structure:
>  app/views/model_alternates/index.thtml
>  app/views/models/index.thtml
>
> In app/views/model_alternates/index.thtml, I have the following:
> 
>echo $html->selectTag('ModelAlternate/
> alt_model_id', $tirelist, null, array('Model_Number' =>
> 'model_alternates'));
>?>
>
> 
>
> This works fine in the models_alternates view but putting the same
> lines in the "models/index.thtml" just gives me "Notice: Undefined
> variable: tirelist in  16". It uses the same controller, maybe I am fighting the naming
> conventions between models/controllers and views?
>
> I was originally trying to set up display that when a model code was
> selected, the other box of "alternate choices" would change according
> to the contents of that table. But the model_alternates  table has an
> autoincrement key as the primary. I was trying what I had read about
> for setting that scenario up and it was not working so I set this up
> as a "smaller" test to make sure I hadn't misunderstood the basics of
> the selects in CakePHP. I figure I missed reading something but have
> been reading alot today, mostly wrong turns but very educational ones.
> Can anyone please tell me which grove of trees to aim for?
>
> Thanks...
> --
> ldb


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Saving data in '/posts/view' instead of '/posts/add' = bad practice? How can I fix this?

2007-11-14 Thread yolabingo

On Nov 12, 11:10 am, Action <[EMAIL PROTECTED]> wrote:
> Is my aforementioned working method (using /posts/view to handle
> comment saving) bad practice?
Not at all.  I think you're just being distracted by the function name
"view" - which probably triggers a response in your brain, based on
what you've read of MVC design, that views should never, ever modify
the database.  In your case, you've got a controller function named
'view' doing controller-y things.  Seems completely reasonable.

> If so, is there any way I can save the
> data in /posts/addcomment or /comments/add and have it return to the /
> posts/view/blog_post_name view with the validation error messages
> working?
Sure, but why bother?  Having Cake automagically handle validation
error messages is a nice benefit.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Production Server, file_get_contents, Permission denied

2007-11-14 Thread francky06l

Are you sure about the permissions on sub-directory ? run chmod -R 777
on cache maybe

On Nov 15, 12:09 am, Zaza <[EMAIL PROTECTED]> wrote:
> I am developing in cakePHP 1.1.18 on MAMP (Mac OSX), with Apache 2.2
> and PHP 5.2.3. MAMP runs under my own username and the web directory
> is owned by me too. Everything works fine.
>
> When I transfer the code to the production server (Red Hat, Apache
> 2.2, PHP 5.1.6) and have the web directory owned by apache I get
> permission denied problems. Cake can write to the cache directory (it
> caches the models) but then not read the files it created. It is
> running in the development mode (1).
>
> This is not a big issue since the warnings don't show up when running
> in production mode. However, for writing and reading images or other
> files I run into the same problems. The cache directory is set to 777,
> but still gives me the same problem.
>
> Any suggestions, anyone?
>
> Thank 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?hl=en
-~--~~~~--~~--~--~---



Production Server, file_get_contents, Permission denied

2007-11-14 Thread Zaza

I am developing in cakePHP 1.1.18 on MAMP (Mac OSX), with Apache 2.2
and PHP 5.2.3. MAMP runs under my own username and the web directory
is owned by me too. Everything works fine.

When I transfer the code to the production server (Red Hat, Apache
2.2, PHP 5.1.6) and have the web directory owned by apache I get
permission denied problems. Cake can write to the cache directory (it
caches the models) but then not read the files it created. It is
running in the development mode (1).

This is not a big issue since the warnings don't show up when running
in production mode. However, for writing and reading images or other
files I run into the same problems. The cache directory is set to 777,
but still gives me the same problem.

Any suggestions, anyone?

Thank 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?hl=en
-~--~~~~--~~--~--~---



Re: Nightly builds?

2007-11-14 Thread DragonI

Yeah, this is becoming a regular but unwanted feature. Basically, a
hit and miss. I wonder what absolute newbies think when they opening
up the zip/tar to find nothing but dead air! Not leaving a great
impression.

On Nov 13, 9:22 am, "Jon Bennett" <[EMAIL PROTECTED]> wrote:
> > As in?
>
> how they are often 20 and 14 bytes respectively, eg, the archive is baulked!
>
> http://cakephp.org/downloads/index/nightly/1.2.x.x
>
> usually sorts itself out, and you can do an SVN update of the branch instead.
>
> jb
>
> --
>
> jon bennett
> 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?hl=en
-~--~~~~--~~--~--~---



Re: Null values in Controller URL

2007-11-14 Thread francky06l

In order to passedArgs to work as you described, do they still need to
be declared in
Router:::connectNamed ? I have had troubles with args, but few months
ago ...
Cheers

On Nov 15, 12:01 am, Grant Cox <[EMAIL PROTECTED]> wrote:
> Any parameters that are optional should be done with named parameters,
> ie
>
> /your/action/id:123/parent:32
>
> in your action just look at $this->passedArgs['id'] and 
> $this->passedArgs['parent'].  These do not interfere with required
>
> parameters, and can be in any order.  For example, given the action
>
> function edit( $id=null ){
>   $this->log( $this->passedArgs['parent'] );
>   $this->log( $this->passedArgs['sibling'] );
>
> }
>
> you could access via
> /controller/edit/1
> /controller/edit/1/parent:123/sibling:432
> /controller/edit/sibling:432/parent:123/1
>
> and all would have the $id = 1
>
> On Nov 15, 2:51 am, kgrimm <[EMAIL PROTECTED]> wrote:
>
> > thanks for your help, then I will change the order of the parameters.
> > I had this idea too, but it means I'll have to change quite a few
> > pieces of existing code, and I'm always afraid of missing some.
>
> > On Nov 14, 5:40 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > > Pass this as the second parameter of your url, then you can default
> > > your second parameter to null in the controller. Of course this if you
> > > are not doing the same for the $part2 already ..
> > > Otherwise create another method in controller that calls an internal
> > > method (to handle both cases).
>
> > > On Nov 14, 5:37 pm, kgrimm <[EMAIL PROTECTED]> wrote:
>
> > > > actually that won't help, because I need to make a difference between
> > > > null and 0 (0 in this case means to create a new table row). My
> > > > current solution is to pass a fixed value that has no other meaning,
> > > > e.g. -1, and set the parameter to null in the controller function if
> > > > it equals it. But I don't like it that way, so I just wondered if
> > > > there's a possibility to pass 'null'.
>
> > > > On Nov 14, 5:31 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > > > > you can pass 0, in your controller you can check if($part1) for
> > > > > example
>
> > > > > On Nov 14, 5:28 pm, kgrimm <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hi,
>
> > > > > > how can I pass null values to a controller function using its URL?
>
> > > > > > for example: "controller/function/par1/par2", how can I make par1
> > > > > > null?
>
> > > > > > Thanks in advance!


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Null values in Controller URL

2007-11-14 Thread Grant Cox

Any parameters that are optional should be done with named parameters,
ie

/your/action/id:123/parent:32

in your action just look at $this->passedArgs['id'] and $this-
>passedArgs['parent'].  These do not interfere with required
parameters, and can be in any order.  For example, given the action

function edit( $id=null ){
  $this->log( $this->passedArgs['parent'] );
  $this->log( $this->passedArgs['sibling'] );
}

you could access via
/controller/edit/1
/controller/edit/1/parent:123/sibling:432
/controller/edit/sibling:432/parent:123/1

and all would have the $id = 1


On Nov 15, 2:51 am, kgrimm <[EMAIL PROTECTED]> wrote:
> thanks for your help, then I will change the order of the parameters.
> I had this idea too, but it means I'll have to change quite a few
> pieces of existing code, and I'm always afraid of missing some.
>
> On Nov 14, 5:40 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > Pass this as the second parameter of your url, then you can default
> > your second parameter to null in the controller. Of course this if you
> > are not doing the same for the $part2 already ..
> > Otherwise create another method in controller that calls an internal
> > method (to handle both cases).
>
> > On Nov 14, 5:37 pm, kgrimm <[EMAIL PROTECTED]> wrote:
>
> > > actually that won't help, because I need to make a difference between
> > > null and 0 (0 in this case means to create a new table row). My
> > > current solution is to pass a fixed value that has no other meaning,
> > > e.g. -1, and set the parameter to null in the controller function if
> > > it equals it. But I don't like it that way, so I just wondered if
> > > there's a possibility to pass 'null'.
>
> > > On Nov 14, 5:31 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > > > you can pass 0, in your controller you can check if($part1) for
> > > > example
>
> > > > On Nov 14, 5:28 pm, kgrimm <[EMAIL PROTECTED]> wrote:
>
> > > > > Hi,
>
> > > > > how can I pass null values to a controller function using its URL?
>
> > > > > for example: "controller/function/par1/par2", how can I make par1
> > > > > null?
>
> > > > > Thanks in advance!


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: associated models fieldnames - findAll()

2007-11-14 Thread Grant Cox

The findAll conditions are not as smart as you think they are.  What
you pass in the conditions array is directly what is used in the SQL
WHERE clause - which is only going to be on the Realization table
(then additional queries to find associated Photos will be done).  The
query you had in the middle of your post that "strangely works" is not
so strange - you are querying the Photo table, so of course you can
use Photo conditions.

Put your 'debug' value to 2 in your /app/core/config.php, and look at
the SQL generated for your queries - it might make it clearer.


On Nov 15, 12:35 am, "marek. bytnar" <[EMAIL PROTECTED]> wrote:
> Hi,
>  I'm having problem with fieldnames from associated models in
> findAll(). I saw it quite common for others.
>  The result from $this->Realization->findAll() - as below - shows that
> associations works ok, BUT when try to condition on Photo it is wrong
> e.g. $this->Realization->findAll('Photo.id = 59') cause "SQL Error:
> 1054: Unknown column 'Photo.id' in 'where clause'"
> [0] => Array
> (
> [Realization] => Array
> (
> [id] => 1
> [title] => liceum_sztuk_plastycznych
> )
>
> [Photo] => Array
> (
> [0] => Array
> (
> [id] => 59
> [realization_id] => 1
> )
>
> [1] => Array
> (
> [id] => 58
> [realization_id] => 1
> )
>
>  What is strange $this->Realization->Photo->findAll('Photo.id = 59')
> will work ok.
>
>  It is strictly connected with :
>  http://groups.google.pl/group/cake-php/browse_thread/thread/dcbb86706...
>
>  My models code :
>  Ralization.php
>
>  class Realization extends AppModel {
> var $name="Realization";
> var $hasMany = array('Photo');}
>
> ?>
>
> and
>
>  Photo.php
>  class Photo extends AppModel {
> var $name="Photo";
> var $belongsTo = 'Realization';}
>
> ?>


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Passing values to views/layouts/default.thtml page

2007-11-14 Thread Grant Cox

You should use $this->set('variable', 'value') to pass any data from
controller to view.


On Nov 15, 7:12 am, Brian <[EMAIL PROTECTED]> wrote:
> I figured out how to pass values to the defualt view using the
> app_controller but how do I do pass values from my other controllers.
> Brian
>
> On Nov 14, 2:31 pm, Brian <[EMAIL PROTECTED]> wrote:
>
> > How do I pass values to my menu bar which is stored within views/
> > layouts/default.thtml page. Do I need to set up a model and controller
> > for this view?  Please 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?hl=en
-~--~~~~--~~--~--~---



Re: Anyone running into this too?

2007-11-14 Thread Grant Cox

How are you getting checkboxes for the HABTM instead of the default
multi-select list?  Is this some extension / modification you have
added?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Question about $aro->del($id=null, $cascade=true)

2007-11-14 Thread Steveston

Confused about acl. Please help, thanks a lot.

When calling this method, I need to pass the id for the aro record I
want to delete, right? This id is not user's id in user table, right?
Shall I call this method as $aro->del(field('id','user_id=111', true)?

If cascade is set to be true, other than deleting this aro, it will
also delete the user. If I also have referential setting in db, will
it delete all records referencing this user?

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?hl=en
-~--~~~~--~~--~--~---



How to delete an aro

2007-11-14 Thread Steveston

Can I set referential rules in database that once a user is deleted,
corresponding aro's in aro table are also deleted?

Or I must call $aro->del(user_id)?

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?hl=en
-~--~~~~--~~--~--~---



Re: Passing values to views/layouts/default.thtml page

2007-11-14 Thread Brian

I figured out how to pass values to the defualt view using the
app_controller but how do I do pass values from my other controllers.
Brian

On Nov 14, 2:31 pm, Brian <[EMAIL PROTECTED]> wrote:
> How do I pass values to my menu bar which is stored within views/
> layouts/default.thtml page. Do I need to set up a model and controller
> for this view?  Please 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?hl=en
-~--~~~~--~~--~--~---



Re: habtm problem

2007-11-14 Thread yolabingo

On Nov 12, 5:35 pm, Dianne  van Dulken <[EMAIL PROTECTED]> wrote:
>function beforeSave() {
>$articles =  explode(",", $_POST["data"]['Teaser']["articles"]);
>$this->Teaser->habtmAdd('Article',  $this->data['Teaser']['id'], 
> $articles);
>return parent::beforeSave();
>//return false;
>}

At first glance things appear to be kosher, except that you probably
don't want to call habtmAdd() from beforeSave().  beforeSave() should
be used to format and validate data only, not attempt to save anything
(hence the 'before' in the name).  The code in your beforeSave()
function is executed anytime you make a call to save(), which is what
habtmAdd() does.  I believe you'd have an infinite recursion if it
weren't breaking at some point.

Short answer, call habtmAdd() from within another function.

HTH


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Passing values to views/layouts/default.thtml page

2007-11-14 Thread Brian

How do I pass values to my menu bar which is stored within views/
layouts/default.thtml page. Do I need to set up a model and controller
for this view?  Please 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?hl=en
-~--~~~~--~~--~--~---



simple file uploading (1.2 alpha)

2007-11-14 Thread Dia

hi,

I need to upload files into the "files" dir in webroot
I saw a few scripts but they are often too complicated for my needs :
using a Model or saving files into DB
in my case, files are not related with any model

is there a very simple way to code it ?
should I use the basic file upload php script without using Cake's
functions ?

thanks for helping


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Anyone running into this too?

2007-11-14 Thread DGPhoebus

Using Cake 1.2.0.5875 pre-beta, have two tables Islands, Services
(Concierge Services), and a join table islands_services.  Services are
presented as a list of checkboxes.  When an island is updated the post
data contains this:

Array
(
[Island] => Array
(

)
[Service] => Array
(
   [Service] =>
  (
  )
)
)

And obviously inside the arrays is the post data.   What I am finding
is that upon calling $this->Island->save($this->data), if all services
are "unchecked" (essentially "remove" all services from an island
definition) the post data now looks like this:

Array
(
[Island] => Array
(

)
)

But upon calling $this->Island->save($this->data) the join table is
not updated (all related rows are not deleted).  [Service] must be
present in the post data for the Model to update the join table.  So I
have hacked it and I test to see if that array exists in the post data
and if not I add it which then causes the join table to be updated
correctly.  Just wondering if this is a bug... cause the alpha release
didn't work like this

Thanks all.

Daniel


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Session problems

2007-11-14 Thread Brian

So if first_name is not in the session what is

 [first_name]=>Brian

in the array that I dump to the screen? Am I looking at that wrong?
It's in the array why can't I get to it?

FULL ARRAY:
Array ( [Config] => Array ( [userAgent] =>
cbc2e74d1e45abcccfdc85ca016f6426 [time] => 1194988565 [rand] =>
1309992527 ) [User] => Array ( [id] => 1 [username] => brehg
[password] => DEB8ABLE [email] => [EMAIL PROTECTED]
first_name]=>Brian [last_name] => Rehg ) )



On Nov 13, 5:13 pm, francky06l <[EMAIL PROTECTED]> wrote:
> Seems first_name is not in yoursessionbut $this->Session-
>
> >read('User.username') must be in.
>
> On Nov 13, 11:28 pm, Brian <[EMAIL PROTECTED]> wrote:
>
>
>
> >   From within my controller if I print the entiresession:
> > $this->Session->read()
> > It returns:
> > Array ( [Config] => Array ( [userAgent] =>
> > cbc2e74d1e45abcccfdc85ca016f6426 [time] => 1194988565 [rand] =>
> > 1309992527 ) [User] => Array ( [id] => 1 [username] => brehg
> > [password] => DEB8ABLE [email] => [EMAIL PROTECTED] [first_name]
> > =>
> > Brian [last_name] => Rehg ) )
>
> >If I try try to print the last_name:
>
> >   $first_name = $this->Session->read('User.first_name');
> >   echo "FIRST NAME: " . $first_name;
>
> >   echo "FIRST NAME: " . $this->Session->read("User.first_name");
>
> >   print_r($this->Session->read('User.first_name'));
>
> >   they all return nothing.
>
> > On Nov 13, 4:06 pm, "Christopher E. Franklin, Sr."
>
> > <[EMAIL PROTECTED]> wrote:
> > > Whoops! I was wrong, you can access it via 
> > > $this->Session->read('User.first_name'); because the read function uses 
> > > Set::extract
>
> > > to get the value out.
>
> > > On Nov 13, 1:05 pm, Brian <[EMAIL PROTECTED]> wrote:
>
> > > > >From within my controller if I print the entiresession:
>
> > > > $this->Session->read()
> > > > It returns:
> > > > Array ( [Config] => Array ( [userAgent] =>
> > > > cbc2e74d1e45abcccfdc85ca016f6426 [time] => 1194988565 [rand] =>
> > > > 1309992527 ) [User] => Array ( [id] => 1 [username] => brehg
> > > > [password] => DEB8ABLE [email] => [EMAIL PROTECTED] [first_name] =>
> > > > Brian [last_name] => Rehg ) )
>
> > > > If I try to print an element within the array:
> > > > $this->Session->read('first_name');
> > > > returns:
> > > > nothing
>
> > > > What am i doing wrong- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Schema generation

2007-11-14 Thread LunarDraco

I am working on an Incremental structure change vendor plugin.

The goal is to be an addon to any schema.
Deals with executing all the patterns for schema migration on live
data.
Will handle most of, if not all of the listed structure refactorings
listed here:
http://www.agiledata.org/essays/databaseRefactoringCatalog.html

I'm going to target mysql first, but hopefully I can migrate it to be
db independant.

The main concern that I need to deal with for my app is I don't have
complete control over all the code which is accessing the models.
So I cant just change the schema or it will break the other code which
depends on it and is not on the same release cycle.
So I need to do staggered incremental refactorings which will allow
the developers of the other third party code at least one version
where they can migrate from one version of the schema to another. Some
of this can be done in the Controller for these external calls where
they pass a version parameter and the controller/model deal with
formatting the results. But when the third party has direct access to
the DB (for Reporting etc) then the db will need to deal with
synchronizing the fields via triggers etc.

As an example of how this works. If I needed to rename a field from
'fielda' to 'fieldb' I can't just rename the field because the code
that depends on fielda would then break. I would create a new field
'fieldb' and add a synchronize method either via storedproc or
preferably in the model to keep fielda and fieldb in synch for one
version with a deprecation note and date on fielda. The next release
would then drop fielda and the synchronizing method. This allows all
new code to deal with fieldb and retains backwards compatibility with
code that is not in my control to still refer to fielda.

To deal with data migration I will have two methods for each structure
change that can be provided. PreChange code that runs before the
schema is modified and PostChange code which runs after the schema is
modified. This will enable you to provide custom sql/php to migrate
and modify the data that already exist in the DB.
The migration engine by default will be able to deal with quite a bit
of these data changes. But there are always cases that don't fit a
standard pattern. All changes will have a checkcode that can determine
if the change needs to occur.

This will be my second re-write of this type of system. Its
unfortunate that the written code is in a completely different
language, but its probably better to do some further thinking as I put
this system together for the cakephp environment and do a clean coding
based on the cakephp design concepts.

The maintenance form for this plugin will allow you to view the list
of schema changes and eventually have some nice wizards to deal with
adding the various types of changes with appropriate deprecation info
etc.

The first release of this will only deal with updating the schema and
migrating the data. Then I will follow that up with a release that
will deal with the staggered synchronization.

If anyone else is interested in helping with this effort, I believe
this to be a valuable tool for any app which has many tables to
maintain where the app is ever evolving.
[EMAIL PROTECTED]

On Nov 14, 3:56 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Gwoo, migration step is not only change DB structure.
> Migration step also represent rule how db changed from step to step,
> with data modification.
> If you need update some columns we use migration step for it.
> I like schema snapshot idea but it is simplification of general case.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Null values in Controller URL

2007-11-14 Thread kgrimm

thanks for your help, then I will change the order of the parameters.
I had this idea too, but it means I'll have to change quite a few
pieces of existing code, and I'm always afraid of missing some.

On Nov 14, 5:40 pm, francky06l <[EMAIL PROTECTED]> wrote:
> Pass this as the second parameter of your url, then you can default
> your second parameter to null in the controller. Of course this if you
> are not doing the same for the $part2 already ..
> Otherwise create another method in controller that calls an internal
> method (to handle both cases).
>
> On Nov 14, 5:37 pm, kgrimm <[EMAIL PROTECTED]> wrote:
>
> > actually that won't help, because I need to make a difference between
> > null and 0 (0 in this case means to create a new table row). My
> > current solution is to pass a fixed value that has no other meaning,
> > e.g. -1, and set the parameter to null in the controller function if
> > it equals it. But I don't like it that way, so I just wondered if
> > there's a possibility to pass 'null'.
>
> > On Nov 14, 5:31 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > > you can pass 0, in your controller you can check if($part1) for
> > > example
>
> > > On Nov 14, 5:28 pm, kgrimm <[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
>
> > > > how can I pass null values to a controller function using its URL?
>
> > > > for example: "controller/function/par1/par2", how can I make par1
> > > > null?
>
> > > > Thanks in advance!


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Null values in Controller URL

2007-11-14 Thread francky06l

Pass this as the second parameter of your url, then you can default
your second parameter to null in the controller. Of course this if you
are not doing the same for the $part2 already ..
Otherwise create another method in controller that calls an internal
method (to handle both cases).

On Nov 14, 5:37 pm, kgrimm <[EMAIL PROTECTED]> wrote:
> actually that won't help, because I need to make a difference between
> null and 0 (0 in this case means to create a new table row). My
> current solution is to pass a fixed value that has no other meaning,
> e.g. -1, and set the parameter to null in the controller function if
> it equals it. But I don't like it that way, so I just wondered if
> there's a possibility to pass 'null'.
>
> On Nov 14, 5:31 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > you can pass 0, in your controller you can check if($part1) for
> > example
>
> > On Nov 14, 5:28 pm, kgrimm <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > how can I pass null values to a controller function using its URL?
>
> > > for example: "controller/function/par1/par2", how can I make par1
> > > null?
>
> > > Thanks in advance!


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Different layouts for different groups of users

2007-11-14 Thread francky06l

Maybe the best will to to hold the role (admin / user) in the Session
at login time.
The in your beforeRender() (app_controller.php or your controller),
you can check the role and set $this->layout to the desired layout.

Now to find the parent_id of an Aro, you need to read the Aro I
suppose.

$aro = $this->Acl->Aro->node(array('model' => 'User', foreign_key =>
'user_id'));

the parent_id is in $aro[0]['Aro']['parent_id'] but I think ( to
confirm) that you should get the parent Aro in $aro[1] ...

I think holding the role in Session is an easier solution.

hope this helps.

On Nov 14, 4:01 pm, plinto <[EMAIL PROTECTED]> wrote:
> Hi, I am not very good at this Acl, aro and aco stuff and am having a
> hard time getting it to work right.
> One of my problems is to set a different layout for the differnt types
> of users.
> My aro table has 2 parents, "Administrators" and "Users", and all the
> users, my question is: how can set one layout for the users and one
> for the administrators?
> I have no idea how to find the parent of user,( if the user logging in
> is a user or administrator).
>
> Thanks in advance, hope someone can help me


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Null values in Controller URL

2007-11-14 Thread kgrimm

actually that won't help, because I need to make a difference between
null and 0 (0 in this case means to create a new table row). My
current solution is to pass a fixed value that has no other meaning,
e.g. -1, and set the parameter to null in the controller function if
it equals it. But I don't like it that way, so I just wondered if
there's a possibility to pass 'null'.

On Nov 14, 5:31 pm, francky06l <[EMAIL PROTECTED]> wrote:
> you can pass 0, in your controller you can check if($part1) for
> example
>
> On Nov 14, 5:28 pm, kgrimm <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > how can I pass null values to a controller function using its URL?
>
> > for example: "controller/function/par1/par2", how can I make par1
> > null?
>
> > Thanks in advance!


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Null values in Controller URL

2007-11-14 Thread francky06l

you can pass 0, in your controller you can check if($part1) for
example

On Nov 14, 5:28 pm, kgrimm <[EMAIL PROTECTED]> wrote:
> Hi,
>
> how can I pass null values to a controller function using its URL?
>
> for example: "controller/function/par1/par2", how can I make par1
> null?
>
> Thanks in advance!


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Null values in Controller URL

2007-11-14 Thread kgrimm

Hi,

how can I pass null values to a controller function using its URL?

for example: "controller/function/par1/par2", how can I make par1
null?

Thanks in advance!


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Different layouts for different groups of users

2007-11-14 Thread plinto

Hi, I am not very good at this Acl, aro and aco stuff and am having a
hard time getting it to work right.
One of my problems is to set a different layout for the differnt types
of users.
My aro table has 2 parents, "Administrators" and "Users", and all the
users, my question is: how can set one layout for the users and one
for the administrators?
I have no idea how to find the parent of user,( if the user logging in
is a user or administrator).

Thanks in advance, hope someone can help me


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Eclipse code completion in Views

2007-11-14 Thread schneimi

> Must I write the name of all my models with PHPDoc in AppController?

Yes you must! Each model,component,... must be put in like that code
example, each var must have the phpDoc in its comment above, but only
one time in the AppController.

Good to see the SVN problem is solved, I wasn't sure about that.

Michael

> Otherwise, I've tested your solution for SVN, but it doesn't work.
> Even I use "Import SVN" in an existing PHP project, no code completion
> is available, even PHP built'in functions like "mysql_close" or
> "str_replace" are unavailable!
>
> Moreover, the Eclipse Outline View doesn't work too with a SVN
> checkout project! It's impossible to take some Eclipse/PDT utilities
> with that kind of project
> Currently I think create 2 projects in Eclipse: one for SVN checkout
> and one for my real web project. And then I will merge all files
> before making my SVN commits...
>
> See you another solution?
>
> BR,
>
> Aurélien (avairet)


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: amperstand in the URL arguments

2007-11-14 Thread AD7six



On Nov 9, 1:23 pm, Mazgalici <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> I the the following URL : test.com/eat%20&%20drinks/1/2 (tried also
> test.com/eat&drinks/1/2)
>
> The CakePHP sees onlys the eat parameters istead of "eat & drinks"
>
> Thanks in advance

You'll find that if you use mod_rewrite url encoding won't work
(unless you do it twice).
http://groups.google.com/group/cake-php/browse_thread/thread/d4a5d9bbd5e235b9/26c721f959a445dc?lnk=gst&q=mod_rewrite+encode#26c721f959a445dc

hth,

AD


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



associated models fieldnames - findAll()

2007-11-14 Thread marek. bytnar

Hi,
 I'm having problem with fieldnames from associated models in
findAll(). I saw it quite common for others.
 The result from $this->Realization->findAll() - as below - shows that
associations works ok, BUT when try to condition on Photo it is wrong
e.g. $this->Realization->findAll('Photo.id = 59') cause "SQL Error:
1054: Unknown column 'Photo.id' in 'where clause'"
[0] => Array
(
[Realization] => Array
(
[id] => 1
[title] => liceum_sztuk_plastycznych
)

[Photo] => Array
(
[0] => Array
(
[id] => 59
[realization_id] => 1
)

[1] => Array
(
[id] => 58
[realization_id] => 1
)

 What is strange $this->Realization->Photo->findAll('Photo.id = 59')
will work ok.

 It is strictly connected with :
 
http://groups.google.pl/group/cake-php/browse_thread/thread/dcbb867063e4696c/4fbbbd0bf6223330?tvc=2&q=findAll#4fbbbd0bf6223330

 My models code :
 Ralization.php



and

 Photo.php



--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Eclipse code completion in Views

2007-11-14 Thread avairet

I've resolved the problem with code completion in SVN project!
In my SVN repository, there was a file called ".project" (an error of
my collegues), so when I checked out, Subclipse did never ask me what
kind of project I want to create! I've deleted it and now all work
fine!

Thank's to Hannes and Nagy for their answers which have enlighten me
about the ways to explore!

The steps:
1. create and connect to a SVN Repository via the SVN Repository
Exploring perspective
2. right-click on the repository, choose "Checkout"
3. check the first radio button "check out as a project configured
using the New Project Wizard" and click "Finish" button.
4. in the wizard select window, choose "PHP>PHP project" and then
click "Next" button
5. select where you want to store the project and name it (for me, the
location is not the default workspace, so I uncheck the radio button
and select the directory in my file system)
6. click next to include Cakephp core
7. return to your PHP perspective where a new project is now available
on the left panel
8. edit or create a file : all Eclipse PDT plugin utilities are
available!
9. use "Voidstate" method (describe above) to get helpers
autocompletion in views and Michael "Schneimi" trick to get models/
components methods autocompletion in your controllers.
GREAT !!!

Aurélien (avairet)


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Aliases in paginate()

2007-11-14 Thread Chris Hartjes

On Nov 9, 2007 6:12 PM, Axl <[EMAIL PROTECTED]> wrote:
>
> eventually decided to be brave and use 1.2. The lack of documentation
> has given me some headache but for the most part that has been

Don't forget that there is an 'alpha with extreme prejudice' version
of the Cake 1.2 manual over at http://tempdocs.cakephp.org

-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

@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?hl=en
-~--~~~~--~~--~--~---



Re: Aliases in paginate()

2007-11-14 Thread Axl

I still haven't found a solution. Has nobody else got one?

Axl


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: String concatenation not working

2007-11-14 Thread Baz
Unless Remote-Cron has changed their service within the last month, they
have jobs less than 1 month.

I used them to run jobs as low as 15 minutes before.
--
Baz L
Web Development 2.0: Web Design, CakePHP, Javascript
http://www.WebDevelopment2.com/

On Nov 14, 2007 4:18 AM, technicaltitch <[EMAIL PROTECTED]> wrote:

>
> Hi Baz,
>
> Thanks for elaborating - I did understand your links and have a look
> at the cron service and backup scripts. I dont want to use the cron
> service as it is a dependency and given I'll not be online much soon,
> I want to minimise dependencies, however running that script without
> redirecting and losing $this->data illuded me.
>
> However out of interest I've now added your solution as well as mine -
> a monthly zipped backup (remote-chron doesn't do less), as well as
> every 6 months, my solution, which I think is also perfectly reliable,
> more nicely formatted, but 4 times the size (not zipped), and delays a
> user action once every 6 months. If either fail I have the other.
>
> Thanks for making this so simple for me
> Chris
>
>
> >
>

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Error on the Method input() and data insert

2007-11-14 Thread francky06l

Use form helper instead of html, your view could be :

Add Member
create('member', array('action' => 'add')); ?>

Email:
input('email', array('size' => '40'))?>


submit('Save') ?>



hope this helps

On Nov 14, 8:01 am, "Seenu V" <[EMAIL PROTECTED]> wrote:
> I am a newbie to cakephp.Today i downloaded the 1.2 pre_beta version
> and the i had add a add page.
>
> Add Member
> 
> 
> Email:
> input('Member/email', array('size' => '40'))?>
> 
> 
> submit('Save') ?>
> 
> 
>
> On the controller i had create a file named members_controller.php and
> add the below coding.
>
> 
> class MembersController extends AppController
> {
> var $name = 'members';
>
>  function index() {
>}
>
>  function add()
> {
> if (!empty($this->data))
> {
> if ($this->Member->save($this->data))
> {
> $this->flash('Member added.','/members');
> }
> }
> }}
>
> I had followed the same method of blogs turorials.
>
> When i reach to this page i am getting the error as below and at the
> same time when i try to add the email address its not adding into the
> table.Help me to come out from this issue and also how to add the data
> into the table.Please do me this favour with a example.
>
> Notice: Method input() is deprecated in HtmlHelper: see
> FormHelper::input or FormHelper::text in
> C:\inetpub\wwwroot\poochout\cake\libs\view\helpers\html.php on line
> 652


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Clean Cake 1.1 sigfaults apache2

2007-11-14 Thread MaxDao

It segfaults in object.php on line 67, on
call_user_func_array();https://trac.cakephp.org/browser/trunk/cake/
1.1.x.x/cake/libs/object.php#L61
When I put die() before this line apache does not segfaults, and if I
put after this line it does segfaults. However according to traces
next call is test->__construct(); (in my case) and
parent::__construct(); in __construct in model class. So when I put
die() code before parent::__construct(); in class model in
__construct(); apache segfaults. That's why I can find where is it
segfaults, last place where I can catch it is call_user_func_array();


Thanks for your help.

On Nov 9, 12:17 am, AD7six <[EMAIL PROTECTED]> wrote:
> On Nov 7, 4:14 pm, MaxDao <[EMAIL PROTECTED]> wrote:
>
> > No I don't have Zend accelerator, neither Zend optimizer installed.
>
> > >From extensions that are not bundled with php I have only xdebug 1.3
>
> > Look's like I can't run cake on my primary stage server..sad.
>
> ... so which php call is causing your seg fault then? If you don´t
> know it´s a bit early for conclusions.
>
> AD


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Mediawiki

2007-11-14 Thread [EMAIL PROTECTED]

HI
I have a old website where there is installed mediawiki and this
website is online and it's used from many users.
Now I have to do a cake application that use the mediawiki.
My question is this : Which is the best practise to do this? I think
to make a component that used the API of mediawiki. Can it be a good
solutions?
Many Thanks
Marco


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Few cakephp projects on one website

2007-11-14 Thread [EMAIL PROTECTED]

In this way which is the url to access to the first application and
which is  the url to access to the second application?

On 13 Nov, 19:46, jeffy <[EMAIL PROTECTED]> wrote:
> Thanks a lot. I will try this
>
> On Nov 13, 4:47 pm, "DJ Spark" <[EMAIL PROTECTED]> wrote:
>
> >  You have both in the manual
> >  http://manual.cakephp.org/chapter/installing
>
> >  put your webroot folder for each aplication in their apache folder, for 
> > example
> > /home/youruser/website1.com
> > /home/youruser/website2.com
>
> >  suppose you create anapplicationfolder:
> > /home/youruser/bin
> > /home/youruser/bin/apps
> > /home/youruser/bin/apps/app1
> > /home/youruser/bin/apps/app2
> > /home/youruser/bin/cake
> > /home/youruser/bin/cake/cake1.1
> > /home/youruser/bin/cake/cake1.2
>
> > go to each index.php in those folders, and edit them: ( I striped the
> > original file comments)
>
> > where:
> > define('ROOT', dirname(dirname(dirname(__FILE__;
> > change this to:
> > define('ROOT', '/home/youruser/bin/apps');
>
> > where:
> > define('APP_DIR', basename(dirname(dirname(__FILE__;
> > change to:
> > define('APP_DIR', 'app1'); /* it's JUST THE APP FOLDER */
>
> > Now you say which version ofcakeit willuse:
> > define('CAKE_CORE_INCLUDE_PATH', ROOT);
> > change to:
> > define('CAKE_CORE_INCLUDE_PATH', '/home/youruser/bin/cake/cake1.1');
>
> > [it will search for a 'cake' folder inside it, ok ?]
>
> > now, edit the same file to the otherapplication
> > define('ROOT', '/home/youruser/bin/apps');
> > define('APP_DIR', 'app1');
> > define('CAKE_CORE_INCLUDE_PATH', '/home/youruser/bin/cake/cake1.2');
>
> > And that's it: a MUCH more secure (there isnoway a web user
> > accessing critical configuration files outside apache webroot
> > ...unless with server access, which is another different problem :)  ,
> > easier to update , and properly configured for productionuse.
>
> >  spark
>
> > On Nov 13, 2007 10:40 AM, [EMAIL PROTECTED]
>
> > <[EMAIL PROTECTED]> wrote:
>
> > > Can ou make me an example about how is possible to keep main
> > >applicationin 'app' and other
> > >applicationin 'second_app'?
> > > Another thing if I have my system auth in mainapplicationand I would
> > > that only some users canusethe secondapplication? How can I do
> > > that?
> > > Many Thanks
> > > Marco
>
> > > On 13 Nov, 14:10, jeffy <[EMAIL PROTECTED]> wrote:
> > > > I know it's possible to keep mainapplicationin 'app' and other
> > > >applicationin 'second_app', but what if they are written on different
> > > > versions ofcake?
>
> > --
> > [livesets]http://djspark.com.br/
> > [web]http://sydi.net
> > [filmes]http://melhoresfilmes.com.br


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: String concatenation not working

2007-11-14 Thread technicaltitch

Hi Baz,

Thanks for elaborating - I did understand your links and have a look
at the cron service and backup scripts. I dont want to use the cron
service as it is a dependency and given I'll not be online much soon,
I want to minimise dependencies, however running that script without
redirecting and losing $this->data illuded me.

However out of interest I've now added your solution as well as mine -
a monthly zipped backup (remote-chron doesn't do less), as well as
every 6 months, my solution, which I think is also perfectly reliable,
more nicely formatted, but 4 times the size (not zipped), and delays a
user action once every 6 months. If either fail I have the other.

Thanks for making this so simple for me
Chris


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Eclipse code completion in Views

2007-11-14 Thread avairet

Michael,

Sorry, I've made an error in code. This is the code I write in my
AppController (var $model):

[code]
class AppController extends Controller {
  /**
   * @var Model
   */
var $model
}
[/code]

Otherwise, I've tested your solution for SVN, but it doesn't work.
Even I use "Import SVN" in an existing PHP project, no code completion
is available, even PHP built'in functions like "mysql_close" or
"str_replace" are unavailable!

Moreover, the Eclipse Outline View doesn't work too with a SVN
checkout project! It's impossible to take some Eclipse/PDT utilities
with that kind of project!
Currently I think create 2 projects in Eclipse: one for SVN checkout
and one for my real web project. And then I will merge all files
before making my SVN commits...

See you another solution?

BR,

Aurélien (avairet)




--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Error on the Method input() and data insert

2007-11-14 Thread Seenu V

I am a newbie to cakephp.Today i downloaded the 1.2 pre_beta version
and the i had add a add page.

Add Member


Email:
input('Member/email', array('size' => '40'))?>


submit('Save') ?>



On the controller i had create a file named members_controller.php and
add the below coding.

data))
{
if ($this->Member->save($this->data))
{
$this->flash('Member added.','/members');
}
}
}
}
I had followed the same method of blogs turorials.

When i reach to this page i am getting the error as below and at the
same time when i try to add the email address its not adding into the
table.Help me to come out from this issue and also how to add the data
into the table.Please do me this favour with a example.

Notice: Method input() is deprecated in HtmlHelper: see
FormHelper::input or FormHelper::text in
C:\inetpub\wwwroot\poochout\cake\libs\view\helpers\html.php on line
652

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: prefixes on cake identifiers to avoid naming collisions

2007-11-14 Thread djiize

PHP functions are not prefixed too, then you need to know their names
to not use the same.
I think Cake is the same, it has its keywords list, it's your job to
know them.

Waiting for namespaces support in PHP (6?)

keymaster wrote:
> Anyone know if there is a particular reason cake does not use
> identifier prefixes to distinguish cake identifiers from application
> defined identifiers ?
>
> I noticed zend does this, at least for their class names. Haven't used
> zend in any detail so I don't know how deep their naming conventions
> go.
>
> Perhaps we are expected to know all the cake model and controller
> class variable names (to know not to use them) ?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Clean Cake 1.1 sigfaults apache2

2007-11-14 Thread MaxDao

no, session.save_handler = files in my case.

Anyway thanks for replay.

On Nov 9, 12:33 am, "Howard Glynn" <[EMAIL PROTECTED]> wrote:
> You're not running
>   session.save_handler = mm
> in your php.ini are you? I changed this on a production server the other day
> to try and eek out extra performance after reading a blog on performance and
> for the first time ever I got seg fault (11) errors every few hours - httpd
> crashed. I changed back to "files" and it's been OK ever since (fingers
> crossed!)
>
> i had apache2 error messages of the form:
> [Wed Nov 07 15:35:18 2007] [notice] child pid 23787 exit signal Segmentation
> fault (11)
> pstack trace output highest entry
>  fce0a6bc *zm_shutdown_ps_mm* (, 1ee828, fd2a45a0, 1cd24, 499f14,
> 1cc00) + 34
>
> Entirely circumstantial evidence, but it seemed to happen under heavy load
> and a large number of users,
> this was on solaris blastwave php pkg 5.2.4 / apache 2.2.6
> there is some limited evidence in google hinting at this...
>
> On Nov 8, 2007 10:17 PM, AD7six <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Nov 7, 4:14 pm, MaxDao <[EMAIL PROTECTED]> wrote:
> > > No I don't have Zend accelerator, neither Zend optimizer installed.
>
> > > >From extensions that are not bundled with php I have only xdebug 1.3
>
> > > Look's like I can't run cake on my primary stage server..sad.
>
> > ... so which php call is causing your seg fault then? If you don´t
> > know it´s a bit early for conclusions.
>
> > AD


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Schema generation

2007-11-14 Thread [EMAIL PROTECTED]

Gwoo, migration step is not only change DB structure.
Migration step also represent rule how db changed from step to step,
with data modification.
If you need update some columns we use migration step for it.
I like schema snapshot idea but it is simplification of general case.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Transform column names

2007-11-14 Thread [EMAIL PROTECTED]

Such behavior possible to create but you will have problem with
asssociated models.
Behavior should process:
  in beforeFind:
  replace fields to real
  replace conditions to real
  in afterFind
  replace fields to pretty
  in beforeSave:
  replace fields to real
  in afterSave
  replace fields to pretty


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Eclipse code completion in Views

2007-11-14 Thread avairet

Hello Michael,

Thank's a lot for your answer. I've just need some precisions:

>>> Model completion works in all controllers for me with the phpdoc in
the AppController. Maybe your controllers extend Controller and not
AppController.

No, my controllers extends AppController. e.g. :

[code]
class ArticlesController extends AppController {
public $name = 'Articles';
}
[/code]

If I write this in my AppController class, the code completion doesn't
work in the controller "ArticlesController":
[code]
class AppController extends Controller {
  /**
   * @var Model
   */
var Model
}
[/code]

Must I write the name of all my models with PHPDoc in AppController?


I use to create a PHP
project first and then use the import for that project to get the data
from SVN.

OK, I will test that.


t should be possible to extend the completion to the other stuff,
e.g. this works for the Session-Component.

Must I write the PHPDoc comment in all my controllers which are using
SessionComponent? Or I must write it in AppController too?

I hope my message is understandable...

Have a nice day !

Aurélien (avairet)



On 13 nov, 18:47, schneimi <[EMAIL PROTECTED]> wrote:
> Hi Avairet,
>
> > - the "schneimi"'s method for modelscompletionin controllers works
> > fine, but it's necessary to copy it in each controllers you create and
> > replace "model" by your model name... I've tried to put this in
> > AppController, but it doesn't work. Any ideas to addcompletionfor
> > all controllers in one place?
>
> Modelcompletionworks in all controllers for me with the phpdoc in
> the AppController. Maybe your controllers extend Controller and not
> AppController.
>
> > - this 2 methods doesn't work if I use Subclipse and check out a cake
> > app directory as an Eclipse project. In this case, there are no code
> >completion, even Php builtin functions! Any ideas why codecompletion
> > doesn't work with a SVN shared project?
>
> I also remember problems with SVN checkout as a project, it seems like
> it isn't handled as a PHP project that way. I use to create a PHP
> project first and then use the import for that project to get the data
> from SVN.
>
> > - and last, is it possible to take codecompletionfor "components'",
> > "behaviors", "elements" and so on?
>
> It should be possible to extend thecompletionto the other stuff,
> e.g. this works for the Session-Component:
>   /**
>* @var SessionComponent
>*/
>   var $Session;
>
> -
> Michael
>
> On 13 Nov., 17:56, avairet <[EMAIL PROTECTED]> wrote:
>
> > Hi everybody!
>
> > Firstly, excuse me for my simple English...
>
> > Then I tell you my own experience with PDT/Cake CodeCompletion.
> > My config : Eclipse Europa 3.3 + PDT 1.0 + Cake 1.2 with advanced
> > install/config("Cake core", "app dir" and "webroot dir" in three
> > different paths) )
>
> > - the "voidstate" example is very cool for helpers methodscompletion
> > in view (file with $helper = new Helper())
>
> > - the "schneimi"'s method for modelscompletionin controllers works
> > fine, but it's necessary to copy it in each controllers you create and
> > replace "model" by your model name... I've tried to put this in
> > AppController, but it doesn't work. Any ideas to addcompletionfor
> > all controllers in one place?
>
> > - this 2 methods doesn't work if I use Subclipse and check out a cake
> > app directory as an Eclipse project. In this case, there are no code
> >completion, even Php builtin functions! Any ideas why codecompletion
> > doesn't work with a SVN shared project?
>
> > - and last, is it possible to take codecompletionfor "components'",
> > "behaviors", "elements" and so on?
>
> > Thank's for your kind attention and best regards!
>
> > Avairet
>
> > On 15 oct, 05:35, Mandy <[EMAIL PROTECTED]> wrote:
>
> > > I use Easy Eclipse for PHP. I created eclipse_helper.php, copied all
> > > of the above and pasted it in the file. Then placed the file in
> > > webroot folder, did a Project->Clean->Build (made sure .thtml files
> > > are opened by PHP editor).
>
> > > However, I still couldn't see codecompletionwhen I typed $html->
> > > (and then ctrl + space).
>
> > > ?
>
> >  > -Mandy.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---