Re: lost view variables?

2007-02-07 Thread Károly Kiripolszky

found the bug, sorry for spamming!


--~--~-~--~~~---~--~~
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: A problem with findAll and fields

2007-02-07 Thread peper

I think the problem is that Gallery hasMany Images  and Image
belongsTo Gallery

while:
return $this-Image-findAll(
Gallery.id = '$id',
array('Gallery.name','Image.filename')
);

works fine. I refer to Gallery model which Image belongs to.

But the other way:
return $this-Gallery-findAll(
Gallery.id = '$id',
array('Gallery.name','Image.filename')
);

doesn't work. There are many Image model objects for one Gallery.
Maybe I should address the fields different ?

I found some addressing examples with '{n}' thing. I don't know what
it means, but I use it in generateList following the example
{n}.Post.id and it works.

Maybe I should try it here. I tried:
return $this-Gallery-findAll(
Gallery.id = '$id',
array('Gallery.name','Image.{n}.filename')
);

and

return $this-Gallery-findAll(
Gallery.id = '$id',
array('Gallery.name','{n}.Image.filename')
);
but it doesn't work

I've got wxacly the same roblem in another project.

What am I doing wrong?


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



irc.cakephp.org down?

2007-02-07 Thread lukemack

hi,

can anyone else access the web interface to the #cakephp irc channel
at http://irc.cakephp.org/irc.html? I'm forced to use this as I am
behind a firewall at the moment. i was able to access it last week.

thanks,

lukemack.


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



More 1.2 validation

2007-02-07 Thread MrTufty

Hi guys... it seems like every time I come on here, I'm posting about
validation. Probably because, at least to me, it's one of the most
confusing parts of the framework.

I'm trying to use the new methods of validation from the 1.2 code
(current SVN version as of today), and I'm hitting brick walls
probably because I'm trying to do something that makes no sense.

The initial part of my application is basic user authentication. I
have no issues with login and logout, I understand how to work with
the Session component, and I've been playing with the Cookie component
also to handle persistent logins.

The confusing part is signups, and the problem comes down to the
specific rules I want to apply.

I need my usernames to be alphanumeric only (at least for the moment),
but I also want them to be within a certain size range, and also to be
unique (for obvious reasons). Previously I've used beforeValidate for
this (although my attempt earlier on didn't get very far and gave me
nearly 100 lines of code for the various conditions).

There are similar conditions applied to the other 3 fields in my
signup form - which are password, password_confirmation, and email. I
can accept happily the difficulties of producing a validation system
that does everything that everyone needs it to do - but some things
would make life a lot easier.

1) Multiple validation rules for a single field
2) An equivalent to validates_uniqueness_of from Rails - effectively
connecting to the database and seeing if the submitted value already
exists in the table
3) A replacement for the old VALID_NOT_EMPTY - we now have a
validation rule for seeing if a field is blank, but I can't figure out
how you'd use that to make sure it's NOT blank.
4) Clarification on the comparison rule - should we be using this for
strings (such as in my password/password_confirmation) or will it only
work with numbers?

The last feature I'd like to see is definable error messages for these
validation rules, but I'm pretty sure that's something you guys are
already working on.

To clarify, I don't expect you guys to just jump and develop this
functionality simply because I've asked for it - in fact some of these
things I'm going to have a crack at developing myself before
submitting as a patch - but I would like an idea of if/when these
things are going to appear, if ever?

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: problem using vendor

2007-02-07 Thread lukemack

i resolved this by doing the vendor() call in the same function which
was using the vendor class. is that the right way to use it?

On 7 Feb, 12:49, lukemack [EMAIL PROTECTED] wrote:
 hi,

 i am trying to use an image verification class as a vendor. i have
 uploaded the files here:

 http://groups.google.co.uk/group/cake-php/web/vendor_problem.zip

 When i try and view the register or imageTest action, I get:

 Fatal error: Class 'verification_image' not found in /home/httpd/
 vhosts/lukem.co.uk/subdomains/cake/httpdocs/app/controllers/
 users_controller.php on line 84

 I thought it might be a filenaming problem so i tried renaming
 verification_image.class.php to verification_image.php but this didn't
 help.

 i have wrapped the vendor in imageVer.php using:

 ?php ini_set('include_path',ini_get('include_path').PATH_SEPARATOR .
 dirname(__FILE__));
  require_once('verification_image.class.php'); ?

 can anyone shed any light ono what i'm doing wrong?

 thanks,

 lukemack.


--~--~-~--~~~---~--~~
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: More 1.2 validation

2007-02-07 Thread MrTufty

Thanks Tarique, will take a look later on.

I was hoping to avoid having to use anything not in the core code,
purely for stability later on. But if it's required... then that's
what I'll do :)

On Feb 7, 3:55 pm, Dr. Tarique Sani [EMAIL PROTECTED] wrote:
 On 2/7/07, MrTufty [EMAIL PROTECTED] wrote:

  I'm trying to use the new methods of validation from the 1.2 code

 Oh forgot to add - my code is V1.1

 T

 --
 =
 PHP for E-Biz:http://sanisoft.com
 Cheesecake-Photoblog:http://cheesecake-photoblog.org
 =


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



RE: softDelete, would anyone find useful enough....

2007-02-07 Thread Mariano Iglesias

I'm not into including this on the CakePHP core, it is so simple to add it
by yourself that it is pointless adding it to the core.

Soft deletes are for certain occasions while hard deletes are the most
common thing.

Other than that thanks for taking the effort to propose a new functionality
to the community.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Jon Bennett
Enviado el: Miércoles, 07 de Febrero de 2007 08:08 a.m.
Para: cake-php@googlegroups.com
Asunto: softDelete, would anyone find useful enough

... to add to core?

At present if a table has created and modifed fields, these are
updated automatically, we could expand on this to include a deleted
field, then add an extra param to Model-del($id,$cascade,$soft)  and
if $soft is true, it would first check the field exists with hasField,
and then set the datetime.


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



Sessions with a multi-server hosting environment

2007-02-07 Thread codecowboy

My company Lifeagora has launched...  Finally!!!  (applause)  We are
in the process of setting up a scalable architecture which would of
course allow us to use a load balancer to divi up requests between
several apache servers.  This not my cup of tea, so this may come off
as a newbie question.  Will I need to change Cake's Session Component
so that is works when multiple servers are creating sessions at the
same time?  Or, is this something that I will fix inside of apache?

Thank you,

Guy Jacks
www.lifeagora.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?hl=en
-~--~~~~--~~--~--~---



Re: softDelete, would anyone find useful enough....

2007-02-07 Thread nate

Why not write it up as a behavior?

Mariano Iglesias wrote:
 I'm not into including this on the CakePHP core, it is so simple to add it
 by yourself that it is pointless adding it to the core.

 Soft deletes are for certain occasions while hard deletes are the most
 common thing.

 Other than that thanks for taking the effort to propose a new functionality
 to the community.

 -MI

 ---

 Remember, smart coders answer ten questions for every question they ask.
 So be smart, be cool, and share your knowledge.

 BAKE ON!

 blog: http://www.MarianoIglesias.com.ar


 -Mensaje original-
 De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
 de Jon Bennett
 Enviado el: Miércoles, 07 de Febrero de 2007 08:08 a.m.
 Para: cake-php@googlegroups.com
 Asunto: softDelete, would anyone find useful enough

 ... to add to core?

 At present if a table has created and modifed fields, these are
 updated automatically, we could expand on this to include a deleted
 field, then add an extra param to Model-del($id,$cascade,$soft)  and
 if $soft is true, it would first check the field exists with hasField,
 and then set the datetime.


--~--~-~--~~~---~--~~
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: launched a small cake site...weird problem

2007-02-07 Thread Walker Hamilton

Lance,

Thank you thank you thank you.
I was only able to use one system (that had IE6 available) to test it
and it was not working properly on that system. It was a Mac running
windows using BootCamp, though, so I was somewhat suspicious.

Thanks for testing this out for me

Walker

On Feb 6, 4:17 pm, Lance Willett [EMAIL PROTECTED] wrote:
 On 2/3/07, Walker Hamilton [EMAIL PROTECTED] wrote:



  I launched a small cake site but there's a really weird problem only
  in IE 6, when you click a link the page goes blank. you have to
  refresh the page to get anything.

  IE 6 only.

  see for yourself:http://bucketridergallery.com

  Does anyone have any ideas or suggestions?

 Walker,
 I checked that site in both Firefox and IE6 and all the pages seemed
 to load fine the first time except 
 forhttp://bucketridergallery.com/shows/upcoming(but that didn't work in
 Firefox either).

 (In case it helps I used IE6 on Windows XP SP1 and Firefox 1.5.0 on Mac OS X).

 Have you been able to reproduce the problem on any other systems or
 browsers? Try IE7 also to see if it happens there.

 HTH,

 --
 Lance Willett
 simpledream web studiohttp://www.simpledream.net


--~--~-~--~~~---~--~~
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: Sessions with a multi-server hosting environment

2007-02-07 Thread John David Anderson (_psychic_)


On Feb 7, 2007, at 10:26 AM, codecowboy wrote:


 My company Lifeagora has launched...  Finally!!!  (applause)  We are
 in the process of setting up a scalable architecture which would of
 course allow us to use a load balancer to divi up requests between
 several apache servers.  This not my cup of tea, so this may come off
 as a newbie question.  Will I need to change Cake's Session Component
 so that is works when multiple servers are creating sessions at the
 same time?  Or, is this something that I will fix inside of apache?

Depends what type of sessions you're using.

If you using php sessions, you'll need to make sure those session  
files are stored in a share that is accessible to all cluster nodes.

You might consider using database sessions - this allows all nodes on  
the cluster to use the same database they are already connected to in  
order to get session data as well.

Congrats on the launch. :)

-- John

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



Re: softDelete, would anyone find useful enough....

2007-02-07 Thread CreepieDeCrapper

I definitely have the use for this functionality in 2 of my current
projects. Although, I only need to perform the soft delete on certain
tables, and not everywhere. What would be the best way to make this
functionality modular so I can quickly and easily utilize either a
soft or hard delete within my controller?


--~--~-~--~~~---~--~~
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: problem on belongsTo many models

2007-02-07 Thread RichardAtHome

If I'm understanding correctly:

You will need to set up two associations:

in model equipment:

$belongsTo = array('school', 'area');

(make sure the school and area arguments above appear in the same
order as their school_id and area_id in the table)

On a related note, I'm not sure that's the best schema to represent
your data and the logic requirements.


On Feb 7, 3:19 am, exiang [EMAIL PROTECTED] wrote:
 Here is the scenario:

 1)
 An Area have many schools
 A school belongs to an area

 2)
 A school have many equipments
 An area have many equipments too
 Thus, an equipment can belongs to either a school or an area (as in
 belongs to the office of the area that govern all school)

 3)
 i have db table and models for area, school and equipment

 4)
 when an equipment belongs to a school, its area_id field will marked 0
 when an equipment belongs to an area, its school_id field will marked
 0

 How can i define the belongsTo in Equipment class to work in my
 requirement?


--~--~-~--~~~---~--~~
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: Sessions with a multi-server hosting environment

2007-02-07 Thread nate

Use database sessions, that's what all the cool kids are doing.

// app/config/core.php:
define('CAKE_SESSION_SAVE', 'database');

On Feb 7, 12:35 pm, John David Anderson (_psychic_)
[EMAIL PROTECTED] wrote:
 On Feb 7, 2007, at 10:30 AM, Chris Hartjes wrote:





  On 2/7/07, codecowboy [EMAIL PROTECTED] wrote:

  My company Lifeagora has launched...  Finally!!!  (applause)  We are
  in the process of setting up a scalable architecture which would of
  course allow us to use a load balancer to divi up requests between
  several apache servers.  This not my cup of tea, so this may come off
  as a newbie question.  Will I need to change Cake's Session Component
  so that is works when multiple servers are creating sessions at the
  same time?  Or, is this something that I will fix inside of apache?

  Having been through this on a non-CakePHP app, I offer the  
  following advice:

  1) you will need a custom session handler so that requests on multiple
  servers will have unique ID's if your load balancer moves someone from
  one server to another

 Cake's database sessions is a custom handler.

 By pointing all your applications to look at a single database table  
 for session info, you remove the problems created by clustering.

  2) you will likely have to change Cake's session component in some way
  to get it to use a custom session handler instead of the stock one.

 Not if you use database sessions, or configure your PHP session files  
 to reside on a share that can be accessed by all the nodes in the  
 cluster.

 -- John


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



how to print out the API doc?

2007-02-07 Thread vwRiver

Hi, I tried to print the API  info like HTML HELP but I get all blank
pages.
Any good way to print it? or are there any formats for printing?

Thanks a lot.


--~--~-~--~~~---~--~~
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: how to print out the API doc?

2007-02-07 Thread Samuel DeVore

I think you can get it in chm format at http://cakeforge.org/projects/cakedocs/
there are apps out there to read and print this type of archive

Sam D

On 2/7/07, vwRiver [EMAIL PROTECTED] wrote:

 Hi, I tried to print the API  info like HTML HELP but I get all blank
 pages.
 Any good way to print it? or are there any formats for printing?

 Thanks a lot.


 



-- 
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread mariano.iglesias

See this ticket:

https://trac.cakephp.org/ticket/664

And also follow message thread in there.

-MI


--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread Mariano Iglesias

As nate pointed out you can use Model behaviours to achieve this:

http://api.cakephp.org/1.2/classModelBehavior.html

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Jon Bennett
Enviado el: Miércoles, 07 de Febrero de 2007 03:05 p.m.
Para: cake-php@googlegroups.com
Asunto: Re: softDelete, would anyone find useful enough

as you'll most likely want to do this on a model basis (eg, one Model
would not want both delete and soft delete), just change the deletes
in those controllers to softDelete()


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



R: How to validate a custom form?

2007-02-07 Thread GMail

For example (If I have understood right)

Define a dummy model

custom.php
-
?php
// generic dummy class with no db connection
class Custom extends AppModel {
  var $name = Custom;
  var $useTable = false;
}   
?

In your view use something like:

?php echo $html-input('Custom/email'); ?
?php echo $html-tagErrorMsg('Custom/email', $emailError); ?

And in your controller

if($this-data['Custom']['email'] == '') {
  $this-set('emailError', 'Email required');
  $this-Custom-invalidate('email'); 
}

Hope is what you need.


--~--~-~--~~~---~--~~
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: usage of the new validation class in 1.2.x.x.

2007-02-07 Thread snowdog

Ok, I found the solution for my question - using minLength rule...

On 7 Lut, 18:33, snowdog [EMAIL PROTECTED] wrote:
 That is great help! Thanks.
 I have one more problem - how to check if the field is NOT BLANK? I
 tried for same time an got nothing.


--~--~-~--~~~---~--~~
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: How to validate a custom form?

2007-02-07 Thread Mariano Iglesias

Follow my previous example. There's no need for you to add the validation on
your controller when it can be done on the model side. A modeled piece of
data can say when it is correctly modeled, or not. Decouple, baby.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de GMail
Enviado el: Miércoles, 07 de Febrero de 2007 03:18 p.m.
Para: cake-php@googlegroups.com
Asunto: R: How to validate a custom form?

For example (If I have understood right)

Define a dummy model

And in your controller

if($this-data['Custom']['email'] == '') {
  $this-set('emailError', 'Email required');
  $this-Custom-invalidate('email'); 
}


--~--~-~--~~~---~--~~
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: Sessions with a multi-server hosting environment

2007-02-07 Thread PaulV



On Feb 7, 6:09 pm, Chris Hartjes [EMAIL PROTECTED] wrote:

 Database sessions are what we used on our project as well.

So what are the pros and cons for each of the choices for sessions

Database Sessions - More easily scalable since database server is
accessible from all machines in cluster. Slower?
PHP Sessions - ?
Cake Sessions - ?


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



R: How to validate a custom form?

2007-02-07 Thread GMail

Yes you are right Your answer is arrived me after I have posted mine.
The only advantage of my method is that you don't need to create the dummy
class
using  var $uses = null in your controller.

 
 Follow my previous example. There's no need for you to add 
 the validation on
 your controller when it can be done on the model side. A 
 modeled piece of
 data can say when it is correctly modeled, or not. Decouple, baby.
 
 -MI
 


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



Problems with hasMany and belongsTo

2007-02-07 Thread citBolon

I have two models:

class Venta extends AppModel {
var $name = 'Venta';
var $hasMany = array (
'Articulo' = array (
'className' = 'Articulo',
'conditions' = '',
'order' = '',
'dependent' = true,
'foreignKey' = 'articulo_id'
)
);
}

class Articulo extends AppModel {
var $name = 'Articulo';
var $belongsTo = array(
'Venta' = array(
'className' = 'Venta',
'conditions' = '',
'order' = ''
)
);
}

when i do this in the controller:
$this-set('lineadeArticulos', $this-Venta-findAllById_unico($sid));

in the view i do this:
?php foreach($lineadeArticulos as $lineadeArticulo): ?
returns: Notice: Undefined index: descripcion in \app\views\ventas
\agregar_articulo.thtml on line 18
$
Notice: Undefined index: precio in \app\views\ventas
\agregar_articulo.thtml on line 20

this returns in the view:
print_r($lineadeArticulos); - Array ( [0] = Array ( [Venta] = Array
( [id] = 419 [cantidad] = [articulo_id] = 123 [id_unico] =
45ca186d05d48 [modified] = 2007-02-07 11:20:33 [created] =
2007-02-07 11:20:33 ) [Articulo] = Array ( ) ) )

the problem is foreach ? or wath


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



R: How to validate a custom form?

2007-02-07 Thread GMail

Yes you are right Your answer is arrived me after I have posted mine.
The only advantage of my method is 

 -Messaggio originale-
 Da: cake-php@googlegroups.com 
 [mailto:[EMAIL PROTECTED] Per conto di Mariano Iglesias
 Inviato: mercoledì 7 febbraio 2007 19.28
 A: cake-php@googlegroups.com
 Oggetto: RE: How to validate a custom form?
 
 
 Follow my previous example. There's no need for you to add 
 the validation on
 your controller when it can be done on the model side. A 
 modeled piece of
 data can say when it is correctly modeled, or not. Decouple, baby.
 
 -MI


--~--~-~--~~~---~--~~
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: Sessions with a multi-server hosting environment

2007-02-07 Thread Chris Hartjes

On 2/7/07, PaulV [EMAIL PROTECTED] wrote:
 So what are the pros and cons for each of the choices for sessions

Speaking from my own experience, if you have multiple application
servers running, you really have no choice but to go with some sort of
centralized database-based session system (although I did experiment
with using memcached as the server and there are some excellent
examples of using memcached for sessions in Ruby on Rails).

DB-based solutions are probably slower than PHP-based ones.

-- 
Chris Hartjes

My motto for 2007:  Just build it, damnit!

rallyhat.com - digitial photo scavenger hunt
@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?hl=en
-~--~~~~--~~--~--~---



Specify the View of an flash()-Message

2007-02-07 Thread Daniel Haller

Hi everybody,

I'm quite new to Cake and playing actually around, trying to understand
everything - so please excuse, if there may come some newbee questions
next time :-)

So this is my question: 
When using $this-flash(), I can print out a message an redirect my user
to a given page, like it's done in the blog tutorial:
$this-flash('The post with id: '.$id.' has been deleted.', '/posts');
How can I specify/change the view of this message/of the redirect site?

Or would it be possible to show a specified view (f.e.
/.../delete.thtml) only for a few seconds and then redirect the user?

Thanks for your help,
Daniel

P.S.: English is not my mothertongue, so please have patience if there
are some grammatical mistakes in my mail... :-)


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



Global Error Logging

2007-02-07 Thread [EMAIL PROTECTED]

I've been looking for this in the bakery and on the groups search, but
to no avail...

Is there a global error logging feature? My app is in production, but
I want to know if anyone is encountering errors. I'd love to have them
all logged to a file, if possible. Is there a method in one of the
parent classes that catches all errors?

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: Global Error Logging

2007-02-07 Thread Walker Hamilton

Yes, just do LogError('Something about the error as a string');

On Feb 7, 1:18 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 I've been looking for this in the bakery and on the groups search, but
 to no avail...

 Is there a global error logging feature? My app is in production, but
 I want to know if anyone is encountering errors. I'd love to have them
 all logged to a file, if possible. Is there a method in one of the
 parent classes that catches all errors?

 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: Global Error Logging

2007-02-07 Thread nate

You can also call $this-log(whatever); from pretty much any Cake
object.  This is technically the preferred approach.

On Feb 7, 2:18 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 I've been looking for this in the bakery and on the groups search, but
 to no avail...

 Is there a global error logging feature? My app is in production, but
 I want to know if anyone is encountering errors. I'd love to have them
 all logged to a file, if possible. Is there a method in one of the
 parent classes that catches all errors?

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



Can someone help?

2007-02-07 Thread [EMAIL PROTECTED]

Maybe I am just missing something or being dumb, but could someone
take a look at this.
Here is a snippet of my code:

class NewsitemsController extends AppController {

var $name = 'Newsitems';
var $uses = array('Newsitem','User');
var $messages = array();

function index(){
addMessage(test);
//print_r($this-messages); //This prints 0-'test' as
expected
$this-set('msgs', $this-requestAction('/Newsitems/
msgrender',array('return')));
}

function addMessage($msg) {
$this-messages = array_merge($this-messages, array($msg));
}

function msgrender() {
$this-set('messages',$this-messages);
//print_r($this-messages); //This is empty!!!?
unset($this-messages);
$this-render();
}
}
?
-
index.thml
?
echo $msgs
?

msgrender.thtml
?
foreach($messages as $message) {
echo -.$message.-;
}
?

---
when I run this index is blank.

What am I doing wrong, it looks like it should work to 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: Can someone help?

2007-02-07 Thread nate

First of all, you need to kick up your error level so you can see
something.  Usually this can be accomplished by setting DEBUG to 1 or
2 in /app/config/core.php.

Second, addMessage(test); should be $this-addMessage(test);

Third, $this-requestAction('/Newsitems/msgrender',array('return'))
should be $this-requestAction('/newsitems/msgrender',array('return'))
(note the case).

Fourth: in the future, if you're trying to get help on this list, it
helps to post with a title slightly less generic than Can someone
help?.

[EMAIL PROTECTED] wrote:
 Maybe I am just missing something or being dumb, but could someone
 take a look at this.
 Here is a snippet of my code:

 class NewsitemsController extends AppController {

 var $name = 'Newsitems';
 var $uses = array('Newsitem','User');
 var $messages = array();

 function index(){
 addMessage(test);
 //print_r($this-messages); //This prints 0-'test' as
 expected
 $this-set('msgs', $this-requestAction('/Newsitems/
 msgrender',array('return')));
 }

 function addMessage($msg) {
 $this-messages = array_merge($this-messages, array($msg));
 }

 function msgrender() {
 $this-set('messages',$this-messages);
 //print_r($this-messages); //This is empty!!!?
 unset($this-messages);
 $this-render();
 }
 }
 ?
 -
 index.thml
 ?
 echo $msgs
 ?
 
 msgrender.thtml
 ?
 foreach($messages as $message) {
 echo -.$message.-;
 }
 ?

 ---
 when I run this index is blank.

 What am I doing wrong, it looks like it should work to 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
-~--~~~~--~~--~--~---



Passing non-model variables from controller to view to setting and retreiving HTML form tags

2007-02-07 Thread Daghe9193

Hello I am new to Cake and MVC, so please excuse my terminology.

What is the easiest way to pass non-model variables back and forth
from the view and the controller for setting and retrieving HTML
control values, such as the checkbox?   I need to add a currency
checkbox to the index view which will determine whether a price column
is displayed in Euro's or U.S. Dollars.   The checkbox method of the
html helper class appears to be model specific.


--~--~-~--~~~---~--~~
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 non-model variables from controller to view to setting and retreiving HTML form tags

2007-02-07 Thread lloydhome

See http://manual.cakephp.org/chapter/controllers under 'Interacting
with your Views' describes the controller's method 'set'

HTH,

David Lloyd
--
lloydhome consulting, inc.
http://www.lloydhome.com

On Feb 7, 3:07 pm, Daghe9193 [EMAIL PROTECTED] wrote:
 Hello I am new to Cake and MVC, so please excuse my terminology.

 What is the easiest way to pass non-model variables back and forth
 from the view and the controller for setting and retrieving HTML
 control values, such as the checkbox?   I need to add a currency
 checkbox to the index view which will determine whether a price column
 is displayed in Euro's or U.S. Dollars.   The checkbox method of the
 html helper class appears to be model specific.


--~--~-~--~~~---~--~~
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 have multiple sessions open?

2007-02-07 Thread rtgwork

I'm having a problem trying to have multiple sessions open at the same
time.  For my application, I have an admin interface where you can
click on a link to open a new window that logs you into a user's
account while keeping the admin session still active.  The problem is
that as soon as I login into to the user's account, this user session
overwrites the admin session, so I'm left with 2 windows open that
refer to the user session.  How do I programatically open a new
browser session that is separate from the session currently open for
admin?

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: Can someone help?

2007-02-07 Thread [EMAIL PROTECTED]

I do have debug on, I didn't paste all my code I rewrote the most
important parts for this post.

So assuming that this code doesn't give me any errors because of my
typos, it still doesn't accomplish what I want it to.

Sorry for the vague title, I couldn't think of anything more
informative.

On Feb 7, 3:37 pm, nate [EMAIL PROTECTED] wrote:
 First of all, you need to kick up your error level so you can see
 something.  Usually this can be accomplished by setting DEBUG to 1 or
 2 in /app/config/core.php.

 Second, addMessage(test); should be $this-addMessage(test);

 Third, $this-requestAction('/Newsitems/msgrender',array('return'))
 should be $this-requestAction('/newsitems/msgrender',array('return'))
 (note the case).

 Fourth: in the future, if you're trying to get help on this list, it
 helps to post with a title slightly less generic than Can someone
 help?.



 [EMAIL PROTECTED] wrote:
  Maybe I am just missing something or being dumb, but could someone
  take a look at this.
  Here is a snippet of my code:

  class NewsitemsController extends AppController {

  var $name = 'Newsitems';
  var $uses = array('Newsitem','User');
  var $messages = array();

  function index(){
  addMessage(test);
  //print_r($this-messages); //This prints 0-'test' as
  expected
  $this-set('msgs', $this-requestAction('/Newsitems/
  msgrender',array('return')));
  }

  function addMessage($msg) {
  $this-messages = array_merge($this-messages, array($msg));
  }

  function msgrender() {
  $this-set('messages',$this-messages);
  //print_r($this-messages); //This is empty!!!?
  unset($this-messages);
  $this-render();
  }
  }
  ?
  -
  index.thml
  ?
  echo $msgs
  ?
  
  msgrender.thtml
  ?
  foreach($messages as $message) {
  echo -.$message.-;
  }
  ?

  ---
  when I run this index is blank.

  What am I doing wrong, it looks like it should work to me...- 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: More 1.2 validation

2007-02-07 Thread marcelgordon

 I'm trying to use the new methods of validation from the 1.2 code

Have a look at the code on this page which works fine with 1.2

http://blog.evansagge.com/2006/12/28/evans-cakephp-validation-technique-20/

it takes care of 1), 2) and 3) from above (and probably 4 but i didn't
check)

I've been using it for a while with good results


be aware of a couple of things if you use this code.

1) the class name conflicts with the core Validation class.  You'll
have to rename it if you want to use this code with 1.2

2) there are some bugs in the code, but they're easily fixed.  I
pointed one out in my comment and then went on to discover that the
same error occurs througout the code.

3) there is an unresolved issue described in comment #5 that the
author hasn't posted a fix for and I haven't had time to track down on
my own.

Despite these few problems, it's a very useful piece of code as it
resolves the biggest shortcoming of the core Validation class so far,
which is multiple checks with distinct error messages on the same
field. Maybe one of the developers could look at incorporating this
into the core...


--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread Langdon Stevenson

Hi Jon

I am just about to implement this exact functionality in an application. 
  Like you, I also think that it would be a logical piece of 
functionality to include in the Cake core.  After all, soft delete has 
exactly the same set of issues attached to it (cascading for instance) 
as does regular delete.

Mariano says that it is so simple to implement that you wouldn't put it 
in the CakePHP core.  Why then put delete in the core?  Surely it would 
be just as simple to implement?

What attracts me to Cake is that stuff like deleting is simple to do. 
As a consumer of Cake (as opposed to a developer), I would find soft 
deletes a useful feature to have built in.

Obviously this is just my personal opinion / 2 cents worth etc :-)  I 
would be interested to hear the reasons for not including this sort of 
functionality.  Is is a matter of bloat?

Regards,
Langdon


Jon Bennett wrote:
 ... to add to core?
 
 I've just reworked some core cake code (very slightly!), so I could
 have a cascadable, softDelete function, and have realised that if cake
 followed 1 more convention, it could be very easy to add this into the
 core.

--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread Langdon Stevenson

I have just looked through Jon's code for softDeleting and am now even 
more in favor of this functionality going into the core.

My PHP knowledge and my Cake knowledge are not good enough to be able to 
implement what Jon has done.  Certainly not without a couple of weeks 
work.  This is definitely the sort of functionality that I would not 
like to have to re-implement in every project.

Regards,
Langdon


Langdon Stevenson wrote:
 Hi Jon
 
 I am just about to implement this exact functionality in an application. 

--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread Langdon Stevenson

Hi Jon

 I can't really take credit for it - it's basically a variant of the
 existing delete methods, 

I think that is the point :-)  Ok, its a small modification, but it 
would have taken me a long time to figure out.


 This is definitely the sort of functionality that I would not  like to have 
 to re-implement in every project.
 
 well, you don't, do once, and add to your app_model - I always have
 unbindAll (and now softDelete) in my app_model when i start.

Understood, but this is why I agree with you that it should be in the 
core.

If you are including something in appModel (I always have the expects 
function for unbinding) for every project, doesn't this suggest that it 
really does belong in core?

I can see that my appModel is quickly growing to be quite large, 
therefore making it a less convenient file to work with.

Regards,
Langdon


--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread Jon Bennett

 Understood, but this is why I agree with you that it should be in the
 core.

we're both ignoring mariano's post earlier which linked to a ticket in
track stating it would be here for 1.2 - couldn't find it in the API,
so guess it's on its way some time soon.

jon

-- 


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



Re: softDelete, would anyone find useful enough....

2007-02-07 Thread Langdon Stevenson

 Understood, but this is why I agree with you that it should be in the
 core.
 
 we're both ignoring mariano's post earlier which linked to a ticket in
 track stating it would be here for 1.2 - couldn't find it in the API,
 so guess it's on its way some time soon.

Good point :-)  Lets wait for 1.2 then.

Regards,
Langdon

--~--~-~--~~~---~--~~
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: ObserveField - Firefox Issue

2007-02-07 Thread francky06l

I use the CJS package rom RossSoft and never had problem with
observe_field .. I have made another method to be able to serioalie
the complete form to the URL. I have used directly the observe_field
from $ajax helper .. From RossSoft the main difference is that if the
frequency is set to 0, the trigger for sending is an event and not the
time and the event is value change ...Usefull and easy ..

Check in snippet for the package (I use both Ajax and CJS without any
problem )..

Franck

On Feb 7, 1:36 am, Andrew McCafferty [EMAIL PROTECTED]
wrote:
 Hello All,

 I'm getting some strange behaviour in Firefox only when using 
 $ajax-observeField to watch a SELECT dropdown.  If the observed dropdown

 list is opened and you hover over a selection, the event is fired
 after the amount of time specified by 'frequency'.  In other words,
 you get an ajax update without clicking on anything!

 The problem has been raised in the group before, but effectively went
 unanswered:

 http://groups.google.com/group/cake-php/browse_thread/thread/9ed8b1e5...

 Anyone out there got a solution / workaround?

 If not can someone shed any light on whether this is likely to be a
 bug in Cake, Prototype or Firefox so that I can raise a ticket with
 the relevant developers?

 Thanks,
 Andrew


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



Strange behaviour

2007-02-07 Thread apalankat

Hi,
I configured a cake app in my university server, and I have a problem:
all the links created by the application (links to actions,
stylesheets, javascripts) have a /cgi-bin/cgiwrap/ prepended.
Here's an example from the page /mycakeapp/posts on the server.
Instead of linking the posts with a href=/mycakeapp/posts/view/2
post2/a it links them with a href=/cgi-bin/cgiwrap/mycakeapp/
posts/view/2 post2/a

I don't think anyone ever saw that, so I lost all hope of finding a
solution... but here it is,
Thanks for reading!


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



Adding edit in place functionality

2007-02-07 Thread [EMAIL PROTECTED]

Greetings,

I Need to enable scriptaculous or jquery edit in place
functionality, in order to edit text and save the new content to the
db. Anyone been able to do this using cake?


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



1.2 Pagination forgetting conditions?

2007-02-07 Thread cdomigan

Hi there,

I've read all the posts I can find on this subject, but I'm sure
there's something very simple I'm doing wrong. I'm aware no
documentation yet exists for the pagination functionality in 1.2, so
sorry if I'm jumping the gun a bit.

I have an index view that displays a paginated table of results. On
the view I have a filter form that lets me filter the result set. On
form submission, the specified filters are parsed into a conditions
array for use in $this-paginate($conditions) in the controller.

The problem is that when I click on Next, Prev, or any of the sort
links, all my conditions are lost. Is there any way to make the
paginator remember the conditions that were used to filter the
paginated results?

I'm aware I can use the var $paginate to set concrete conditions for
the paginator, but I want this functionality to be dynamic so that I
can pass different conditions into $this-paginate() and have it
remember the results on sorting and paginating.

Any help would be most appreciated.

Chris Domigan


--~--~-~--~~~---~--~~
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: Adding edit in place functionality

2007-02-07 Thread John David Anderson (_psychic_)


On Feb 7, 2007, at 3:32 PM, [EMAIL PROTECTED] wrote:


 Greetings,

 I Need to enable scriptaculous or jquery edit in place
 functionality, in order to edit text and save the new content to the
 db. Anyone been able to do this using cake?

You should be able to using the AjaxHelper.

?php echo $ajax-editor('id', '/url/to/handle/saves', array('option'  
= 'value')); ?

Make sure you have prototype and scriptaculous JS libs included in  
the view somehow, and make sure the your controller's helper array  
includes 'Ajax'.

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

-- John

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



Re: How to have multiple sessions open?

2007-02-07 Thread [EMAIL PROTECTED]

Given the nature of http, i don't think that's possible.


--~--~-~--~~~---~--~~
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: How to have multiple sessions open?

2007-02-07 Thread John David Anderson (_psychic_)


On Feb 7, 2007, at 1:44 PM, rtgwork wrote:


 I'm having a problem trying to have multiple sessions open at the same
 time.  For my application, I have an admin interface where you can
 click on a link to open a new window that logs you into a user's
 account while keeping the admin session still active.  The problem is
 that as soon as I login into to the user's account, this user session
 overwrites the admin session, so I'm left with 2 windows open that
 refer to the user session.  How do I programatically open a new
 browser session that is separate from the session currently open for
 admin?

Don't use two sessions, just combine them. Keep some sort of  
information in the session that tells you if the user is an admin or  
not.

-- John

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



Re: More 1.2 validation

2007-02-07 Thread MrTufty

Hi Marcel -

THAT is exactly the sort of helpful answer I was hoping for. Fantastic
bit of code, I think I'll be making use of it until such time as the
Cake core includes something comparable.

I've bookmarked the page in question, and courtesy of the Foxmarks
extension for Firefox, I'll check it out first thing tomorrow when I
get to work :)

Thanks again - and thanks also to the author of said code :)

On Feb 7, 9:06 pm, marcelgordon [EMAIL PROTECTED] wrote:
  I'm trying to use the new methods of validation from the 1.2 code

 Have a look at the code on this page which works fine with 1.2

 http://blog.evansagge.com/2006/12/28/evans-cakephp-validation-techniq...

 it takes care of 1), 2) and 3) from above (and probably 4 but i didn't
 check)

 I've been using it for a while with good results

 be aware of a couple of things if you use this code.

 1) the class name conflicts with the core Validation class.  You'll
 have to rename it if you want to use this code with 1.2

 2) there are some bugs in the code, but they're easily fixed.  I
 pointed one out in my comment and then went on to discover that the
 same error occurs througout the code.

 3) there is an unresolved issue described in comment #5 that the
 author hasn't posted a fix for and I haven't had time to track down on
 my own.

 Despite these few problems, it's a very useful piece of code as it
 resolves the biggest shortcoming of the core Validation class so far,
 which is multiple checks with distinct error messages on the same
 field. Maybe one of the developers could look at incorporating this
 into the core...


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



Fatal Error

2007-02-07 Thread zafoeta

Hi all,

I hope someone can help me on this.
I can not find a lot on the internet.
I am doing a simple scaffolding tutorial, but I am not able to get it
run.
Connection to database works fine.
I set up a user.php and a users_controller.php in the respective
models and controllers directory.
I first go to http://127.0.0.1/cake/users and get the error

The requested URL /cake/users was not found on this server.

I than try http://127.0.0.1/cake/app/controllers/users_controller.php
and get the error

Fatal error: Class 'AppController' not found in /var/www/cake/app/
controllers/users_controller.php on line 2

My code for user.php
?php
class User extends AppModel
{
var $name = 'User';
}
?

My code for users_controller.php
?php
class UsersController extends AppController
{
var $name = 'Users';
var $scaffolding;
}
?

I really do not see anything wrong.
But I am a newbie in php.
Is there an include path to set to the AppModel.php and
AppController.php files?
I suppose this is set as default ...

I really hope someone can help me on this.
I am kinda lost.
Walter.


--~--~-~--~~~---~--~~
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: Fatal Error

2007-02-07 Thread John David Anderson (_psychic_)


On Feb 7, 2007, at 3:50 PM, zafoeta wrote:


 Hi all,

 I hope someone can help me on this.
 I can not find a lot on the internet.
 I am doing a simple scaffolding tutorial, but I am not able to get it
 run.
 Connection to database works fine.
 I set up a user.php and a users_controller.php in the respective
 models and controllers directory.
 I first go to http://127.0.0.1/cake/users and get the error

Sounds like a mod_rewrite issue.

Can you try http://127.0.0.1/index.php/cake/users or http://127.0.0.1/ 
index.php?url=/cake/users

You might want to double check to see if mod_rewrite is up and  
running - there are some tips in the manual in the config chapter. If  
you don't want to use mod_rewrite, check out some of the notes in / 
app/config/core.php.

-- John

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



Session key

2007-02-07 Thread jonlb

Hello all,

I realize this may be an easy question but I've searched this group
and other CakePHP sites with no luck. I'm looking for a way to
retrieve the session key for the current session. Is there an easy way
to do this in Cake?

Thanks,
jonlb


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



Problems with generateList and selectTag ... generateList adding a Where clause that I don't want...

2007-02-07 Thread [EMAIL PROTECTED]

Hey everyone,

I've been trying to find an answer to this all day with no luck, so I
thought I'd poll the great minds on this list to see if anyone knows
what's going on here...

What I've got:  I'm working on a service request form, trying to build
a drop down selection box on the web form using data from a table
(Model) that is not part of my current Model/Controller/View.  The
data resides in the Model App and I'm using the Model Request.
What I'm trying to do is grab all the values (rows) from
App.app_name.  (This table is very simple, it has two columns app_id
and app_name.)

Basically I want the selectTag method to build a selection box with
the query SELECT app_name FROM apps, the problem is that cakePHP is
constructing a query like SELECT app_name FROM apps WHERE request_id =
'x'

What I've tried:  I've tried adding:

var $hasMany = array('App' = array(
 
'className'= 'App',
 
'conditions' = null,
 
'order'= null,
 
'limit' = null,
 
'foreignKey'   = 'app_id',
 
'dependent'= false,
 
'exclusive' = false,
 
'finderQuery'  = ''
 )
);

This code causes the where clause to be inserted where I do not want
it to be.

I also have this in my Results Controller file to try and assign the
data into a variable to be used in my view:

$this-set('list',$this-Request-App-getList())   which calls a
function in my App controller that looks like:

function getList() {
  $this-set('return', $this-generateList(null,null,
100,'{n}.App.app_id','{n}.App.app_name');
  return $return;
}

So my first problem is how in the world do I force this to pull back
the entire contents inside the apps table (there are only four rows in
this table, so it's not a lot of data).

Then my second problem is getting a select box built with selectTag?
Currently I have this in my code:

$html-selectTag('Request/App/app_name',
$list',null,array(),null,false,false)

but of course, that's not working right now.

This post may be a bit fragmented right now, so if anyone has any
thoughts on how to sort all of this out but needs more info, please
let me know!

Thank you!

--Patrick Holt


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

2007-02-07 Thread Mariano Iglesias

session_id(), standard PHP call.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar

-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de jonlb
Enviado el: Miércoles, 07 de Febrero de 2007 09:08 p.m.
Para: Cake PHP
Asunto: Session key

I realize this may be an easy question but I've searched this group
and other CakePHP sites with no luck. I'm looking for a way to
retrieve the session key for the current session. Is there an easy way
to do this in Cake?


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

2007-02-07 Thread jonlb

Thanks, I wasn't sure if there was a way to do it specific to Cake or
not.

Jon B.

On Feb 7, 4:17 pm, Mariano Iglesias [EMAIL PROTECTED]
wrote:
 session_id(), standard PHP call.

 -MI

 ---

 Remember, smart coders answer ten questions for every question they ask.
 So be smart, be cool, and share your knowledge.

 BAKE ON!

 blog:http://www.MarianoIglesias.com.ar

 -Mensaje original-
 De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
 de jonlb
 Enviado el: Miércoles, 07 de Febrero de 2007 09:08 p.m.
 Para: Cake PHP
 Asunto: Session key

 I realize this may be an easy question but I've searched this group
 and other CakePHP sites with no luck. I'm looking for a way to
 retrieve the session key for the current session. Is there an easy way
 to do this in Cake?


--~--~-~--~~~---~--~~
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: Problems with generateList and selectTag ... generateList adding a Where clause that I don't want...

2007-02-07 Thread lloydhome

Shouldn't getList be more like

 function getList() {
   $return = $this-generateList(null,null,
100,'{n}.App.app_id','{n}.App.app_name');
   $this-set('return',$return);  // not sure what you are trying here
but it probably isn't setting $return
   return $return;
  }

HTH,

David Lloyd
--
lloydhome consulting
http://lloydhome.com


On Feb 7, 7:06 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Hey everyone,

 I've been trying to find an answer to this all day with no luck, so I
 thought I'd poll the great minds on this list to see if anyone knows
 what's going on here...

 What I've got:  I'm working on a service request form, trying to build
 a drop down selection box on the web form using data from a table
 (Model) that is not part of my current Model/Controller/View.  The
 data resides in the Model App and I'm using the Model Request.
 What I'm trying to do is grab all the values (rows) from
 App.app_name.  (This table is very simple, it has two columns app_id
 and app_name.)

 Basically I want the selectTag method to build a selection box with
 the query SELECT app_name FROM apps, the problem is that cakePHP is
 constructing a query like SELECT app_name FROM apps WHERE request_id =
 'x'

 What I've tried:  I've tried adding:

 var $hasMany = array('App' = array(

 'className'= 'App',

 'conditions' = null,

 'order'= null,

 'limit' = null,

 'foreignKey'   = 'app_id',

 'dependent'= false,

 'exclusive' = false,

 'finderQuery'  = ''
  )
 );

 This code causes the where clause to be inserted where I do not want
 it to be.

 I also have this in my Results Controller file to try and assign the
 data into a variable to be used in my view:

 $this-set('list',$this-Request-App-getList())   which calls a
 function in my App controller that looks like:

 function getList() {
   $this-set('return', $this-generateList(null,null,
 100,'{n}.App.app_id','{n}.App.app_name');
   return $return;

 }

 So my first problem is how in the world do I force this to pull back
 the entire contents inside the apps table (there are only four rows in
 this table, so it's not a lot of data).

 Then my second problem is getting a select box built with selectTag?
 Currently I have this in my code:

 $html-selectTag('Request/App/app_name',
 $list',null,array(),null,false,false)

 but of course, that's not working right now.

 This post may be a bit fragmented right now, so if anyone has any
 thoughts on how to sort all of this out but needs more info, please
 let me know!

 Thank you!

 --Patrick Holt


--~--~-~--~~~---~--~~
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: 1.2 Pagination forgetting conditions?

2007-02-07 Thread Preloader

Hello Chris,

Yesterday I had the same problem, when programming a fulltext search.
Should also work for filtering.

I solved it this way:

// this is my search action in my controller
function search(){
// if I got a search text string from the form, then overwrite
if (!empty($this-params['form']['searchtext'])){
  $this-params['pass']['searchtext'] = $this-params['form']
['searchtext'];
}

if(!empty($this-params['pass']['searchtext'])){
  // process search text string, building conditions and query the
results
}else{
  // no search text typed in
}
}


... and in the view ...
// reset the page parameter before printinge next/prev links,
otherwise pagination doesn't work correctly
unset($this-params['pass']['page']);

// It's important, that you pass $this-params['pass'] as the url to
the next/prev links:

print $paginator-prev('', array('url' = $this-params['pass']),
null, array('class' = 'disabled'));
print $paginator-next('', array('url' = $this-params['pass']),
null, array('class' = 'disabled'));


This works fine for me, I hope, this helps!

Greets, Christoph


--~--~-~--~~~---~--~~
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: Strange behaviour

2007-02-07 Thread [EMAIL PROTECTED]

How do you have your site unpacked?  Give me a break down of the
directory structure.  Are you using mod_rewrite or are you using the
ENV script variable thingy?  What version of PHP.  Is php a module on
Apache or is it CLI(cgi)?

On Feb 7, 2:17 pm, apalankat [EMAIL PROTECTED] wrote:
 Hi,
 I configured a cake app in my university server, and I have a problem:
 all the links created by the application (links to actions,
 stylesheets, javascripts) have a /cgi-bin/cgiwrap/ prepended.
 Here's an example from the page /mycakeapp/posts on the server.
 Instead of linking the posts with a href=/mycakeapp/posts/view/2post2/a 
 it links them with a href=/cgi-bin/cgiwrap/mycakeapp/

 posts/view/2 post2/a

 I don't think anyone ever saw that, so I lost all hope of finding a
 solution... but here it is,
 Thanks for reading!


--~--~-~--~~~---~--~~
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: Strange behaviour

2007-02-07 Thread [EMAIL PROTECTED]

What is your directory structure?  How was cake installed onto the
server?  Is PHP installed as a module or as cgi?
To me, it looks like PHP is installed as CGI and the server itself is
running Virtual Hosting.  Can you confirm these?

On Feb 7, 2:17 pm, apalankat [EMAIL PROTECTED] wrote:
 Hi,
 I configured a cake app in my university server, and I have a problem:
 all the links created by the application (links to actions,
 stylesheets, javascripts) have a /cgi-bin/cgiwrap/ prepended.
 Here's an example from the page /mycakeapp/posts on the server.
 Instead of linking the posts with a href=/mycakeapp/posts/view/2post2/a 
 it links them with a href=/cgi-bin/cgiwrap/mycakeapp/

 posts/view/2 post2/a

 I don't think anyone ever saw that, so I lost all hope of finding a
 solution... but here it is,
 Thanks for reading!


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



Firefox Dropping CSS

2007-02-07 Thread [EMAIL PROTECTED]

I have had a recent problem with NiftyCube and the css being dropped
in FireFox yet, it still worked.  niftycube.js has a setting right
after the comments called niftyCSS = false;  Set this to true and make
your own css link to the niftyCube.css file by typing into your thtml
file, ?php $html-css('niftyCube').\n; ? .

Setting that straight, here are two suggestions to you that helped me
along the way with this problem:
1.) If you have access to the httpd.conf, add this in there somewhere
AddType text/css .css.
2.) If you are still having the error, 9 times out of 10, the css file
is being called a second time from somewhere.  Check all of your PHP
HTML and especially JavaScript code.  Just do a project-wide search
for the name of the file without the extension and if that yields no
results, clear your cache, make sure caching is off and if you have
elements and helpers, check those.

That's about all I can suggest.  If you are having proiblems after all
of this, post here and I will help you out as much as I can in the
trouble-shooting process.

--CEF


--~--~-~--~~~---~--~~
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: Global Error Logging

2007-02-07 Thread Grant Cox

What kind of errors are you looking for?

The Cake help messages (ie missing controller, action) are only really
useful in development (unless gremlins keep deleting your files), so
they are not logged anywhere if DEBUG is 0.

SQL statements are not logged anywhere if DEBUG is 0, unless you've
set this up in your database server.

In production you should have PHP errors logged to a file - but this
is outside the scope of Cake.  Check your php.ini for log_errors and
error_log.

And finally, all of your debug messages using $this-log or LogError,
will keep working regardless of the DEBUG setting.


--~--~-~--~~~---~--~~
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 non-model variables from controller to view to setting and retreiving HTML form tags

2007-02-07 Thread Grant Cox

I personally find the best way is still using the html / form helpers,
but to use a model or field name that doesn't exist.  Of course, if
you want the value to persist then you'll need to store the value
somewhere - perhaps in the session.

ie, in your controller:

function edit($id = null) {
if(empty($this-data)) {
...
$this-data['Display']['currency'] = $this-Session-
read('Display.currency');
} else {
$this-cleanUpFields();
// save the currency they selected back to the session
$this-Session-write('Display.currency', $this-data['Display']
['currency']);

...
}
}


and your view can just use
echo $html-checkbox( 'Display/currency' );


--~--~-~--~~~---~--~~
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: softDelete, would anyone find useful enough....

2007-02-07 Thread nate

Just because there is an enhancement ticket that has been left open
does not necessarily mean that something is going to be added to the
core.  In all likelihood, it will *not* be added to the core, as the
Behaviors API provides a more-than-sufficient interface to plug this
functionality in with an external class.

On Feb 7, 4:59 pm, Jon Bennett [EMAIL PROTECTED] wrote:
  Understood, but this is why I agree with you that it should be in the
  core.

 we're both ignoring mariano's post earlier which linked to a ticket in
 track stating it would be here for 1.2 - couldn't find it in the API,
 so guess it's on its way some time soon.

 jon

 --

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



Re: Fatal Error

2007-02-07 Thread nate

The URL you had the first time was right.  You never access Cake
controller/model files directly.  You need to follow the instructions
here: http://manual.cakephp.org/chapter/installing

Make sure you either have mod_rewrite setup, or use the BASE_URL
fallback (see Section 5).

On Feb 7, 5:50 pm, zafoeta [EMAIL PROTECTED] wrote:
 Hi all,

 I hope someone can help me on this.
 I can not find a lot on the internet.
 I am doing a simple scaffolding tutorial, but I am not able to get it
 run.
 Connection to database works fine.
 I set up a user.php and a users_controller.php in the respective
 models and controllers directory.
 I first go tohttp://127.0.0.1/cake/usersand get the error

 The requested URL /cake/users was not found on this server.

 I than tryhttp://127.0.0.1/cake/app/controllers/users_controller.php
 and get the error

 Fatal error: Class 'AppController' not found in /var/www/cake/app/
 controllers/users_controller.php on line 2

 My code for user.php
 ?php
 class User extends AppModel
 {
 var $name = 'User';}

 ?

 My code for users_controller.php
 ?php
 class UsersController extends AppController
 {
 var $name = 'Users';
 var $scaffolding;}

 ?

 I really do not see anything wrong.
 But I am a newbie in php.
 Is there an include path to set to the AppModel.php and
 AppController.php files?
 I suppose this is set as default ...

 I really hope someone can help me on this.
 I am kinda lost.
 Walter.


--~--~-~--~~~---~--~~
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: problem on belongsTo many models

2007-02-07 Thread exiang

Nop, it doesn't work.
As i understand, belongsTo will create a join table in sql.

However, in this case,

an equipment  can belongs to a school or an area, but not both



On Feb 8, 1:37 am, RichardAtHome [EMAIL PROTECTED] wrote:
 If I'm understanding correctly:

 You will need to set up two associations:

 in model equipment:

 $belongsTo = array('school', 'area');

 (make sure the school and area arguments above appear in the same
 order as their school_id and area_id in the table)

 On a related note, I'm not sure that's the best schema to represent
 your data and the logic requirements.

 On Feb 7, 3:19 am, exiang [EMAIL PROTECTED] wrote:

  Here is the scenario:

  1)
  An Area have many schools
  A school belongs to an area

  2)
  A school have many equipments
  An area have many equipments too
  Thus, an equipment can belongs to either a school or an area (as in
  belongs to the office of the area that govern all school)

  3)
  i have db table and models for area, school and equipment

  4)
  when an equipment belongs to a school, its area_id field will marked 0
  when an equipment belongs to an area, its school_id field will marked
  0

  How can i define the belongsTo in Equipment class to work in my
  requirement?


--~--~-~--~~~---~--~~
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: PHP generation with CakePHP

2007-02-07 Thread Devraj Mukherjee

I'd appreciate if you could send me some source files, Sam. Thanks.

Also, do you suggest the PDF data be generated in the controller or the view?

On 2/8/07, Samuel DeVore [EMAIL PROTECTED] wrote:

 I did two for the bakery last week actually, but I don't know that
 they have been released
 one is basically the wiki one on using pdf-php and the other uses
 fpdf.  I can send you the sources if they are not there yet
 Sam D

 On 2/7/07, Devraj Mukherjee [EMAIL PROTECTED] wrote:
 
  Hello Bakers,
 
  Are there any good tutorials you can recommend for generating PDF
  files using CakePHP?
 
  Thank you.
 
  --
  I never look back darling, it distracts from the now, Edna Mode (The
  Incredibles)
 
  
 


 --
 ==
 S. DeVore
 (the old fart) the advice is free, the lack of crankiness will cost you

 - its a fine line between a real question and an idiot

 



-- 
I never look back darling, it distracts from the now, Edna Mode (The
Incredibles)

--~--~-~--~~~---~--~~
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: Limiting the size of $this

2007-02-07 Thread redhex

Thanks, I had taken a look into it and it should be generally what I
am looking for. Will bring my discussion to that post!

On Feb 7, 8:32 pm, Ryan [EMAIL PROTECTED] wrote:
 Try Felix's getModel function:http://www.thinkingphp.org/2007/01/22/
 how-to-properly-create-a-model-instance-manually/

 It will allow you to load models dynamically so you can trim your
 $uses array.

 Regards,
 Ryan Rosehttp://www.digiwize.com

 On Feb 6, 11:15 pm, redhex [EMAIL PROTECTED] wrote:

  Hi all,
  I have a habit of doing a debug($this) to view the different variables
  that is accessible to my controller's method. What I notice is that
  whatever my controller have in the $uses array is loaded into memory
  (the different models and their variables).

  The question is how can I limit the memory consumption of my
  controllers? I do not use all the models in the $uses array in all my
  methods all the time. And I had at times experience failure in the
  scripting exhasting the avaliable 8MB of memory as defined in PHP.ini

  Is it safe to unset those varaibles (aka model) that the method is not
  using? Is there anyway to define the $uses array dynamically on the
  fly? Currently I am at 1.1.11.


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



Better way to do this?

2007-02-07 Thread Dan Bair

Hello Bakers,

Currently I have a table that holds the favorite films of users
(fn_favorites). In each row in this table, it holds the film's id
(film_id) and the user's id (user_id). I am making a list of the
User's Top Favorites which takes the films that occur this most in
this table. Right now, I have to do a SQL query to get these id's that
occur the most, and then put them in an array, and then do a findAll
with those ids to get the film's information.

I was wondering if anyone could point me to a cleaner way to
accomplish this? The real thing that made me go this direction was
that I could not find a way to count occurances of a value in a column
and then order them.

Here is the code I currently have:

// grabs the 3 ids that occur the most
$fav = $this-Favorite-query(
'SELECT film_id, COUNT(film_id) FROM fn_favorites
GROUP BY film_id
ORDER BY COUNT(film_id) DESC
LIMIT 3');
// assign id's into an array
$fav = array( $fav[0]['fn_favorites']['film_id'],

$fav[1]['fn_favorites']['film_id'],

$fav[2]['fn_favorites']['film_id']);
//grab film information on the 3 top favorites
$fav = $this-Film-findAll( array(Film.id = $fav ) );
$this-set( 'fav', $fav );


Thanks in advance!
~ Dan


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