Re: File uploads, image uploads

2006-06-26 Thread poorna


clemos wrote:
> hi jon and all
>
> what is on line 219 of your
> /myserver/app/controllers/businesses_controller.php ?
>
> for file upload, I actually use this component which does perfectly the job :
> http://cakeforge.org/snippet/detail.php?type=snippet&id=36
> I've written my own File model, FilesController and stuff around it,
> all of which are quite simple (the files table has only
> "id","name","location","mime","extension")...
>
> and I populate the db by manipulating the $this->params['data'] array
> after doing the FileHandler stuff, and before saving the model
> for you it would be probably somethin like :
> $this->params['data']['Business']['imageFile'] =
> $_FILES[filename][name]; // or in my case :
> $this->fileHandler->filename
> $this->Business->save($this->params['data']);
> (I don't know if it's the "good" way, but it works quite well to me)
> (my File::add() function is in the bottom of this msg)
>
> anyway it seems to me more a CakePHP MVC issue than a problem of file
> upload itself (you could get this error trying to populate your db
> with any "off the conventions" stuff)
> could you please tell us more about your businesses table, your
> Business model and you businessesController ?
>
> 
> clemos
>
>  = = = = =
>
> function add(){
>   if(empty($this->params['data'])){
>
>
>
>   }else{
>   
> if($this->FileHandler->upload("upload","app/webroot/files/",null,true)){
>
>
>
>   $this->params['data']['Fichier']['location'] = 
> $this->webroot .
> substr($this->FileHandler->location,12); //don't remember why it's
> substr 12...
>   $this->params['data']['Fichier']['filename'] = 
> $this->FileHandler->filename;
>   $this->params['data']['Fichier']['mime'] =
> $this->FileHandler->type; // added this property to FileHandler
> component myself
>   $this->params['data']['Fichier']['extension'] =
> strtolower($this->FileHandler->ext); // and this one too
>
>
>   
> $this->Fichier->set($this->params['data']);
>   $this->Fichier->save();
>   $this->flash('fichier 
> enregistré','/fichiers/');
>
>
>   }else{
>   $this->flash('erreur 
> #'.$this->FileHandler->error.' de
> téléchargement du fichier ','/fichiers/');
>   }
>
>   }
>
>
>   }
>
>  = = = =
>
> On 6/25/06, linkingarts <[EMAIL PROTECTED]> wrote:
> >
> > jb-
> >
> > thanks for the input but that isn't exactly the issue. What I don't
> > quite get is a) why I'm getting an "index" error, and b) how to
> > populate the db (with the imageFile [name] value in addition to the
> > other values passed by the form) at the same time I'm uploading the
> > file into a specific directory.
> >
> > BTW enctype is not the issue, it is in the form tag correctly (I
> > mentioned that in the original post).
> >
> > Just still trying to get the hang of Cake overall; I'm getting most
> > things to work here and there but it seems like every new thing I want
> > to do takes 6 hrs to figure out. Then it's like, "ooh, sh---..."
> >
> >
> > >
> >


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



Re: File uploads, image uploads

2006-06-26 Thread poorna

hi friends,
if v upload a file ,then the file(which was uploading by me) goes to
where??
whether it wil  go to database/webserver???

plz reply immediately.. i am new to php...


clemos wrote:
> hi jon and all
>
> what is on line 219 of your
> /myserver/app/controllers/businesses_controller.php ?
>
> for file upload, I actually use this component which does perfectly the job :
> http://cakeforge.org/snippet/detail.php?type=snippet&id=36
> I've written my own File model, FilesController and stuff around it,
> all of which are quite simple (the files table has only
> "id","name","location","mime","extension")...
>
> and I populate the db by manipulating the $this->params['data'] array
> after doing the FileHandler stuff, and before saving the model
> for you it would be probably somethin like :
> $this->params['data']['Business']['imageFile'] =
> $_FILES[filename][name]; // or in my case :
> $this->fileHandler->filename
> $this->Business->save($this->params['data']);
> (I don't know if it's the "good" way, but it works quite well to me)
> (my File::add() function is in the bottom of this msg)
>
> anyway it seems to me more a CakePHP MVC issue than a problem of file
> upload itself (you could get this error trying to populate your db
> with any "off the conventions" stuff)
> could you please tell us more about your businesses table, your
> Business model and you businessesController ?
>
> 
> clemos
>
>  = = = = =
>
> function add(){
>   if(empty($this->params['data'])){
>
>
>
>   }else{
>   
> if($this->FileHandler->upload("upload","app/webroot/files/",null,true)){
>
>
>
>   $this->params['data']['Fichier']['location'] = 
> $this->webroot .
> substr($this->FileHandler->location,12); //don't remember why it's
> substr 12...
>   $this->params['data']['Fichier']['filename'] = 
> $this->FileHandler->filename;
>   $this->params['data']['Fichier']['mime'] =
> $this->FileHandler->type; // added this property to FileHandler
> component myself
>   $this->params['data']['Fichier']['extension'] =
> strtolower($this->FileHandler->ext); // and this one too
>
>
>   
> $this->Fichier->set($this->params['data']);
>   $this->Fichier->save();
>   $this->flash('fichier 
> enregistré','/fichiers/');
>
>
>   }else{
>   $this->flash('erreur 
> #'.$this->FileHandler->error.' de
> téléchargement du fichier ','/fichiers/');
>   }
>
>   }
>
>
>   }
>
>  = = = =
>
> On 6/25/06, linkingarts <[EMAIL PROTECTED]> wrote:
> >
> > jb-
> >
> > thanks for the input but that isn't exactly the issue. What I don't
> > quite get is a) why I'm getting an "index" error, and b) how to
> > populate the db (with the imageFile [name] value in addition to the
> > other values passed by the form) at the same time I'm uploading the
> > file into a specific directory.
> >
> > BTW enctype is not the issue, it is in the form tag correctly (I
> > mentioned that in the original post).
> >
> > Just still trying to get the hang of Cake overall; I'm getting most
> > things to work here and there but it seems like every new thing I want
> > to do takes 6 hrs to figure out. Then it's like, "ooh, sh---..."
> >
> >
> > >
> >


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



Re: Add

2006-06-26 Thread RosSoft

Thanks, I've updated the snippet
http://cakeforge.org/snippet/download.php?type=snippet&id=148

Now the register_js() handles directly the external url if it begins
with http:// or https://


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



Re: Add

2006-06-26 Thread RosSoft

Thanks, I've updated the snippet
http://cakeforge.org/snippet/download.php?type=snippet&id=147

Now the register_js() handles directly the external url if it begins
with http:// or https://


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



Re: use ajax link with more div's

2006-06-26 Thread sicapitan

did you find a solution, makiemark?


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



Re: How to update multiple divs with one ajax call

2006-06-26 Thread sicapitan

can RequestHandler help me with this?


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



Re: Roles, groups and users with Cake ACL

2006-06-26 Thread John David Anderson (_psychic_)


On Jun 26, 2006, at 7:53 PM, [EMAIL PROTECTED] wrote:

>
> The app I'm working on has a fairly distinct set of roles. Very rarely
> will privileges be different than those afforded by the basic role.
> This has led me to question ACL, and it's need for a record for every
> user... Is ACL the answer in these less-complex situations?

Well, you be the judge. Its pretty flexible, though, so you might  
consider just making an ARO that represents a role at large (and  
somehow tie that ARO to your user, like a role_id in the user table)  
and do ACL checks that way. Later if you want to make it more  
granular, you can always create users under the ARO group object.

> Although it occurs to me as I write this, perhaps in my case, I  
> needn't
> have users as AROs, but entire roles. So instead of alice, bob and  
> carl
> in aros, I have registered_user, sys_admin, etc. Then I could possibly
> code it so as to allow more specific privileges by adding individual
> users on an as-needed basis... ??

That's the ticket.

Cake on.

-- J

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



Re: Roles, groups and users with Cake ACL

2006-06-26 Thread [EMAIL PROTECTED]

The app I'm working on has a fairly distinct set of roles. Very rarely
will privileges be different than those afforded by the basic role.
This has led me to question ACL, and it's need for a record for every
user... Is ACL the answer in these less-complex situations?


Although it occurs to me as I write this, perhaps in my case, I needn't
have users as AROs, but entire roles. So instead of alice, bob and carl
in aros, I have registered_user, sys_admin, etc. Then I could possibly
code it so as to allow more specific privileges by adding individual
users on an as-needed basis... ??


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



Re: Creating a CakePHP Content Management System

2006-06-26 Thread BlenderStyle

Thanks for your help, John, I got it working. Here's what I did:

controllers/docs_controller.php:
function getList()
{
  $this->set('doclist', $this->Doc->generateList(...);
}

views/docs/get_list.php:
[echo $doclist using foreach]

views/layouts/default.thtml:
echo $this->requestAction('/docs/getList', array('return'));

This means that my html and stuff is stored in views/docs/get_list.php
which works but I'd much rather have the html stored in
views/layouts/default.thtml. How can I use $this->requestAction to
return a variable instead?

I looked in the API for renderElement and it makes sense. I think I
would use renderElement for things like banner ads and things like
that. Since I'm doing this for my primary navigation I think
requestAction would be more suitable. Let me know if I'm wrong about
that.


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



Re: Creating a CakePHP Content Management System

2006-06-26 Thread John David Anderson (_psychic_)


On Jun 26, 2006, at 6:26 PM, BlenderStyle wrote:

>
>
> John David Anderson (_psychic_) wrote:
>> You might look at using an element or using requestAction to do that.
>
> I'm confused about how exactly requestAction works. Here's a  
> snippet of
> my DocsController:
>
> function getList()
> {
>   $this->set('doclist', $this->Doc->generateList(null, 'weight desc',
> null, '{n}.Doc.id', '{n}.Doc.name'));
> }

Mmm... you might want to be returning a value if you want only the  
data from this action.

I was actually thinking that you create the HTML that shows the list,  
and just use requestAction to grab the rendered list and pull it into  
the app controller.

So you have a view called get_list.thtml in your /app/views/docs/  
folder that shows the list, and you use

$this->requestAction('/docs/getList', array('return'));

in your layout file where you want the rendered doc list to be shown.


> Another thing that I'm totally confused about are elements. What does
> $this->element() and $this->renderElement() do?

Look it up in the API for a better idea of how it works.

> If I use
> $this->renderElement('doclist') in layouts/default.thml what needs to
> be in views/elements/doclist.thtml?

The HTML you want rendered where you call renderElement().

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



Re: model & controller plur problem...

2006-06-26 Thread cakeshop

Hello AD7six... I have been a baker for some times but I just joined
the group. It's nice to meet you and other bakers here. Thinking about
openning my own "cakeshop" someday... ;) I mean a cakephp developer.

AD7six wrote:
> Hi Vladiq,
>
> I don´t know why it would be different between bake and running your
> app, but in your /app/config/inflections.php file you can define
>
> $irregularPlural = array('stove' => 'stoves');
>
> and in this way this plural will be handled correctly.
> 
> Cheers,
> 
> AD7six
> PS. Who is cakeshop?


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



Re: Creating a CakePHP Content Management System

2006-06-26 Thread BlenderStyle


John David Anderson (_psychic_) wrote:
> You might look at using an element or using requestAction to do that.

I'm confused about how exactly requestAction works. Here's a snippet of
my DocsController:

function getList()
{
  $this->set('doclist', $this->Doc->generateList(null, 'weight desc',
null, '{n}.Doc.id', '{n}.Doc.name'));
}

So, from inside default.thtml do I simply use
$this->requestAction('/docs/getList') and then I have $doclist to use
or do I have to do something like $doclist =
$this->requestAction('/docs/getList')? Also, how does
views/docs/doclist.thtml work in all of this?

Another thing that I'm totally confused about are elements. What does
$this->element() and $this->renderElement() do? If I use
$this->renderElement('doclist') in layouts/default.thml what needs to
be in views/elements/doclist.thtml?


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



Re: Add

2006-06-26 Thread Zach Cox
Hi RosSoft,I needed to link to an externally hosted js file for a Google Map so I added to your awesome HeadHelper (see attached).  I added a new register_jsexternal function and a corresponding case in print_registered().
Thanks,ZachOn 6/24/06, RosSoft <[EMAIL PROTECTED]> wrote:
HeadHelper is your choice :)just set $helpers=array(  , 'Head' );in your AppController, andprint_registered()?> in your layout.then in your views, you can do $head->register_js('myjsfile') or
$head->register_jsblock('some_javascript_instructions'); (also you canuse HeadHelper in your own helpers)
--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---


head.php
Description: Binary data


Implemented OthAuth

2006-06-26 Thread Langdon Stevenson

Hi

Just wanted to mention that I implemented OthAuth last night in an 
application that I am working on.  Took a little time to get my head 
around it, but the end result is great.

It looks like a neat little system that suits the needs of this project 
well.  So thanks to Othy for developing and making OthAuth available.

I would love to see integration with Cake's ACL in future versions.

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



Re: CakePHP and Lighttpd

2006-06-26 Thread Gustavo Carreno

On 6/26/06, John David Anderson <[EMAIL PROTECTED]> wrote:
> http://www.johndavidanderson.net/blog/?p=60

After our little priv chat on IRC I got LightHTTPD and cakePHP to play
well on a Windows box.
Since you do request some more info on getting it to work with
windows, I'll pass along what I've done to get it to run.
I haven't done it with CupCake, but can have a diff on your
cupcake.php script in no time...
Just one advert: FastCGI does not work AT ALL on a Windows machine,
this from the blog of the guy that does the Windows Install for
LightHTTPD.

-- 
Gustavo Carreno
---
< If you know Red Hat you know Red Hat,
If you know Slackware you know Linux >

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



CakePHP and Lighttpd

2006-06-26 Thread John David Anderson

I've been trying to create a setup for CakePHP that would allow me to  
package up my application and have it work almost anywhere. I also  
tire of mod_rewrite and .htaccess oddness from place to place, so  
I've found a way to pair up CakePHP and lighttpd to have my own  
little setup. I've recorded my steps on my blog, along with a script  
you can download to ease the administration of the setup.

http://www.johndavidanderson.net/blog/?p=60

I welcome any feedback!

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



Re: Creating a CakePHP Content Management System

2006-06-26 Thread John David Anderson (_psychic_)


On Jun 26, 2006, at 4:00 PM, BlenderStyle wrote:

>
> Okay, I have a question. My docs table/model/controller/views thing is
> working fine now but I'm not sure how to go about listing my docs in
> the default layout.

You might look at using an element or using requestAction to do that.

-- J

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



Re: Creating a CakePHP Content Management System

2006-06-26 Thread BlenderStyle

Okay, I have a question. My docs table/model/controller/views thing is
working fine now but I'm not sure how to go about listing my docs in
the default layout.

I know that in my DocsController I can use $this->set('doclist',
$this->Doc->generateList(...)) to create the variable $doclist to be
used in my views/docs but how can I use that in
views/layouts/default.thtml? Do I need to put something in
AppController? Can I use $this->Doc in Appcontroller?


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



Re: updating an existent field

2006-06-26 Thread Fabrizio Mancini
oh what a fool i amthanks a lot for your tips, while reading your suggestion, i've realized that i'm trying to access an object that doesn't exist!!!$this->data in my case doesn't exist because i'm starting from a link with a parameter!! i was getting so used to $this->data that i wanted to use it in any case!!! ;-) ;-)
thanks againfabrizio

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


Re: updating an existent field

2006-06-26 Thread dima

Fabrizio,

You might have to do something like this:

$this->data['User']['id'] = $subscribed['User']['id'];
$this->data['User']['subscribed'] = 1;
...
$this->User->save($this->data);
// Notice that Cake in v1.0+ will fetch the User index from
$this->data.

- or -

$subscribed['User']['subscribed'] = 1;
...
$this->User->save($subscribed);


Sincerely,
Dimitry


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



Re: Roles, groups and users with Cake ACL

2006-06-26 Thread John David Anderson (_psychic_)


On Jun 26, 2006, at 2:56 PM, johnwik wrote:

>
> Sounds great! Will this new authentication class have some kind of
> layer where you could plugin different authentication services, ie
> http://www.ja-sig.org/products/cas/ ? The road map mentions LDAP,  
> which
> in my opinion would be a very good feature for Cake. It should be
> possible to authentication users as well as fetch user attributes from
> a LDAP.

I'm already doing this with a custom model. Its not hard - just set  
$useTable to false and start writing your LDAP functions right in the  
model.

> Buthow do I implement Roles with ACL?

Group ARO's and ACO's by giving them children.

-- J

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



Re: schema support for postgresql 8.1 [Solved]

2006-06-26 Thread Ariel Santana
Solved.After looking i found a patch made by "Gonçalo Marrafa"[1], which modifies the file dbo_postgres.php.The model I am thus:class IinInstitucion extends AppModel {    var $name = 'iininstitucion';
    var $useTable = 'iininstitucion';    var $tablePrefix = 'instituciones.';    var $primaryKey = 'id_iininstitucion';    var $displayField = "descripcion";}and it works perfectly.
This planned to add support it to future versions? [1] 
http://groups.google.com/group/cake-php/browse_thread/thread/4be0d5ba35d60dd9/b7430fb9723d643e?q=ticket+postgres+schema&rnum=1#b7430fb9723d643e-- Ariel Santana

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


Re: Roles, groups and users with Cake ACL

2006-06-26 Thread johnwik

Sounds great! Will this new authentication class have some kind of
layer where you could plugin different authentication services, ie
http://www.ja-sig.org/products/cas/ ? The road map mentions LDAP, which
in my opinion would be a very good feature for Cake. It should be
possible to authentication users as well as fetch user attributes from
a LDAP.

Buthow do I implement Roles with ACL?


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



schema support for postgresql 8.1

2006-06-26 Thread arielsantana

Hello to all.
I have an application that uses postgresql-8.1, but the tables are in
different schemes.
The tables that in the scheme public, work perfectly, but the other
does not work.

>From a console of postgresql I can accede with the following annotation
select * from [schema_name].[table_name]
select * from [table_name] (when the table belongs to the scheme
'public')

I have proven different solutions but nonprofit that works, for
example:

In the postgresql:
CREATE TABLE instituciones.iininstitucion
(
  id_iininstitucion int4 NOT NULL DEFAULT
nextval('iininstitucion_id_iininstitucion_seq'::regclass),
  id_iindireccion int4,
  id_itisubsubtipoinstitucion int4,
...

In the model:
class IinInstitucion extends AppModel {
var $name = 'iininstitucion';
var $useTable = 'instituciones.iininstitucion';
var $primaryKey = 'id_iininstitucion';
var $displayField = "descripcion";
}

it throws the following error:

Missing Database Table
No Database table for model iininstitucion (expected
"instituciones.iininstitucion"), create it first.


Also it adds the following configuration in the server of database with
the same error:

ALTER DATABASE desarrollo SET search_path=pg_catalog, instituciones;


This is still bug or the functionality for schemas in postgresql not
this supported?

thanks

--
Ariel Santana


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



updating an existent field

2006-06-26 Thread Fabrizio Mancini
Hi all,i'm very new to cake but i like it a lot!! great work!at the moment im in trouble with a field update. I cannot understand how to do it.Let me explain:the user comes to my site and register himself. he receive an email
with an activation code, then he clicks on the link in the email, and i read the code
he passed in the url string. now i want to update the field "subscribed"
from 0 to 1 for that user only.
the codeUsers model ... yada yadaUsers Controller ... yada yada
$subscribed=$this->User->find("oid = '$userOid'"); if (!empty($subscribed) && $subscribed['User']['subscribed'] == 0){// this line of code is creating a lot of trouble!
    $this->data['User']['subscribed'] = 1;    if (!$this->User->save($this->data['User'])) {        $this->redirect('/errorpage');    };    $this->render('activationCompletePage');

};i receive the user record by the method find, but when i put $this->data['User']['subscribed'] = 1 and save the record, it saves a new record with all the fields empty but with the field subscribed  = 1.

What i'm doing wrong? how can i update that field?thanks in advancefabrizio


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


Re: Cake setup on OS X - no CSS/img t

2006-06-26 Thread Adrien Motte
I had restarted apache.I replaced the IfModule part of my httpd.conf with yours, and tried to restart Apache (sudo apachectl graceful)I get this error:Syntax error on line 1091 of /etc/httpd/httpd.conf:
/usr/sbin/apachectl graceful: httpd could not be startedAdrienOn 6/26/06, 
gwoo <[EMAIL PROTECTED]> wrote:
I have to ask if you restarted apache?You have this section but add the rewrite logs to see if anything ishappening RewriteEngine On RewriteLog "/var/log/httpd/rewrite.log"
 RewriteLogLevel  3 RewriteCond %{REQUEST_METHOD} ^TRACE RewriteRule .* - [F]
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Cake setup on OS X - no CSS/img t

2006-06-26 Thread gwoo

I have to ask if you restarted apache?

You have this section but add the rewrite logs to see if anything is  
happening

 RewriteEngine On
 RewriteLog "/var/log/httpd/rewrite.log"
 RewriteLogLevel  3
 RewriteCond %{REQUEST_METHOD} ^TRACE
 RewriteRule .* - [F]


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



Re: Cake setup on OS X - no CSS/img t

2006-06-26 Thread believ3r


gwoo wrote:
> there is an include file in the httpd.conf that grabs the "User"
> configuration for the Sites directory.
> You should comment that out cause AllowOverride None is in there.

I've deleted the contents of that file anyways I didn't need it.

> This setup is great to have, but not a requirement. You might want to
> make sure your AllowOverride directive is in the correct place though
> if your webroot is somewhere other than /Library/Webserver/Documents.
> There are a few directories you can have the AllowOverride statment -
> are you sure its in the directory that reflects your DocumentRoot?

You tell me: http://www.hindsight-engineering.com/httpd.conf.txt

(note, the server is NOT on the hindsight-engineering.com domain - its
on my dev box)

> Also - make sure that mod_rewrite is actually being loaded.

It is - phpinfo() reports it as running.


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



Re: Creating a CakePHP Content Management System

2006-06-26 Thread BlenderStyle


John David Anderson (_psychic_) wrote:
> On Jun 26, 2006, at 1:31 PM, BlenderStyle wrote:
>
> > I originally tried copying pages_controller.php to app/controllers but
> > I had very little luck with this. Check out my post:
>
> Do you want to use the functionality of Cake's PagesController? I'd
> just leave the setup as it is. The PagesController that comes with
> Cake is only meant to serve up static pages.
>
> If you want to replace this with your own model and controller setup,
> I'd remove the route to the pages controller, and start a new one
> from scratch.
>
> -- John

Excellent suggestion, that's exactly what I'm doing. I'll post my
process here in case others in the future need to do something like
this. Thanks for your help, everyone.


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



Re: View cache

2006-06-26 Thread AD7six


AD7six wrote:
> Hi all,
>
> if you have
> define ('CACHE_CHECK', true); // in app/config/core.php
> cache in your list of helpers // in your controller
> var $cacheAction = true; //in your controller
>
> Cake will generate cache files for your views.
>
> However (as I understand it ) cacheAction is the length of time to
> cache the view, and as such true evaluates to 1 second - set
> cacheAction to "1 hour" or some more useful time, the cached views will
> be rendered (easily verified by editing the cache file).
>
> I think* that cache does work with layouts or elements at this time.

That was meant to say: I think that cache does {not} work with layouts
or elements at this time.

However, having just run through a quick test, full page caching seems
to be working fine, without re-executing elements or re-generating the
layout from scratch (on a per url basis). Which, personally,  is
exactly what I wanted to happen.

Cheers,

AD7six


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



Re: Creating a CakePHP Content Management System

2006-06-26 Thread John David Anderson (_psychic_)


On Jun 26, 2006, at 1:31 PM, BlenderStyle wrote:

> I originally tried copying pages_controller.php to app/controllers but
> I had very little luck with this. Check out my post:

Do you want to use the functionality of Cake's PagesController? I'd  
just leave the setup as it is. The PagesController that comes with  
Cake is only meant to serve up static pages.

If you want to replace this with your own model and controller setup,  
I'd remove the route to the pages controller, and start a new one  
from scratch.

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



Re: Creating a CakePHP Content Management System

2006-06-26 Thread BlenderStyle

I originally tried copying pages_controller.php to app/controllers but
I had very little luck with this. Check out my post:

http://groups.google.com/group/cake-php/browse_thread/thread/ae5753812a770b90/#


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



Re: Creating a CakePHP Content Management System

2006-06-26 Thread John Zimmerman [gmail]
I would go with creating the seperate docs controller.  That way if you did want to use a static page for something you can still make use of the pages controller.On 6/26/06, 
BlenderStyle <[EMAIL PROTECTED]> wrote:
Okay, so I want to create a basic CakePHP CMS. All I need is a tablewith pages and CRUB operations. I tried customizing the PagesController(pages_controller.php) but I had very little luck. It seemsPagesController works a lot differently than others.
So, my question is, would it just be easier to create a table calleddocs as opposed to pages so I can create a DocsController to do what Iwant? Then, I could just edit app/config/routes.php to point to my
DocsController instead of PagesController. Does this sound like a goodidea? Can anyone think of a word that means pages? All I could come upwith is docs. I guess it doesn't matter, I'm just particular aboutthings.

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


Re: Creating a CakePHP Content Management System

2006-06-26 Thread John David Anderson (_psychic_)


On Jun 26, 2006, at 1:20 PM, BlenderStyle wrote:

>
> Okay, so I want to create a basic CakePHP CMS. All I need is a table
> with pages and CRUB operations. I tried customizing the  
> PagesController
> (pages_controller.php) but I had very little luck. It seems
> PagesController works a lot differently than others.

Well, there's a PagesController in the Cake core. I hope you haven't  
edited that one. You can still use your own PagesController, just  
stick it in /app/controllers and it should override the  
PagesController in the core.

You shouldn't need to play with naming or routes or anything - this  
new controller should just override the one in the core.

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



Re: Roles, groups and users with Cake ACL

2006-06-26 Thread John Zimmerman [gmail]
On the road map for CakePHP version 1.2 an authentication class is listed.I am not sure what the details are for this class, but it might be helpful in kind of creating a cake standard for this type of thing.
On 6/26/06, sicapitan <[EMAIL PROTECTED]> wrote:
I used othAuth as it is readable both in code and in db tables.  I hada little bit of trouble setting up, but thats because I'm a noob.  Othy(CrazyLegs) has a nother version coming but it has not been tested yet,
still, you can grab it here:http://cakeforge.org/snippet/detail.php?type=package&id=14
--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---


Creating a CakePHP Content Management System

2006-06-26 Thread BlenderStyle

Okay, so I want to create a basic CakePHP CMS. All I need is a table
with pages and CRUB operations. I tried customizing the PagesController
(pages_controller.php) but I had very little luck. It seems
PagesController works a lot differently than others.

So, my question is, would it just be easier to create a table called
docs as opposed to pages so I can create a DocsController to do what I
want? Then, I could just edit app/config/routes.php to point to my
DocsController instead of PagesController. Does this sound like a good
idea? Can anyone think of a word that means pages? All I could come up
with is docs. I guess it doesn't matter, I'm just particular about
things.


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



Re: Can i get $webroot for a vendor library?

2006-06-26 Thread dima

Okay,

This may be a little late, but if you are creating a vendor lib, you
should not be fetching Cake data. Instead do something like:

$Image->setImageRoot("/mysite/html/images/productos/thumbs/");
...
$Image->fileURL("nameOfFile.jpg");
# /mysite/html/images/productos/thumbs/nameOfFile.jpg

This way you separate your lib from Cake for maximum reuse (despite the
fact that you're extending File).

Just a thought...


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



Re: beforeFilter bug?

2006-06-26 Thread AD7six

If there's a reason someone thought this was a terrible post, please
let me know.

Cheers,

AD7six


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



Re: File uploads, image uploads

2006-06-26 Thread clemos

hi jon and all

what is on line 219 of your
/myserver/app/controllers/businesses_controller.php ?

for file upload, I actually use this component which does perfectly the job :
http://cakeforge.org/snippet/detail.php?type=snippet&id=36
I've written my own File model, FilesController and stuff around it,
all of which are quite simple (the files table has only
"id","name","location","mime","extension")...

and I populate the db by manipulating the $this->params['data'] array
after doing the FileHandler stuff, and before saving the model
for you it would be probably somethin like :
$this->params['data']['Business']['imageFile'] =
$_FILES[filename][name]; // or in my case :
$this->fileHandler->filename
$this->Business->save($this->params['data']);
(I don't know if it's the "good" way, but it works quite well to me)
(my File::add() function is in the bottom of this msg)

anyway it seems to me more a CakePHP MVC issue than a problem of file
upload itself (you could get this error trying to populate your db
with any "off the conventions" stuff)
could you please tell us more about your businesses table, your
Business model and you businessesController ?


clemos

 = = = = =

function add(){
if(empty($this->params['data'])){



}else{

if($this->FileHandler->upload("upload","app/webroot/files/",null,true)){



$this->params['data']['Fichier']['location'] = 
$this->webroot .
substr($this->FileHandler->location,12); //don't remember why it's
substr 12...
$this->params['data']['Fichier']['filename'] = 
$this->FileHandler->filename;
$this->params['data']['Fichier']['mime'] =
$this->FileHandler->type; // added this property to FileHandler
component myself
$this->params['data']['Fichier']['extension'] =
strtolower($this->FileHandler->ext); // and this one too



$this->Fichier->set($this->params['data']);
$this->Fichier->save();
$this->flash('fichier 
enregistré','/fichiers/');


}else{
$this->flash('erreur 
#'.$this->FileHandler->error.' de
téléchargement du fichier ','/fichiers/');
}

}


}

 = = = =

On 6/25/06, linkingarts <[EMAIL PROTECTED]> wrote:
>
> jb-
>
> thanks for the input but that isn't exactly the issue. What I don't
> quite get is a) why I'm getting an "index" error, and b) how to
> populate the db (with the imageFile [name] value in addition to the
> other values passed by the form) at the same time I'm uploading the
> file into a specific directory.
>
> BTW enctype is not the issue, it is in the form tag correctly (I
> mentioned that in the original post).
>
> Just still trying to get the hang of Cake overall; I'm getting most
> things to work here and there but it seems like every new thing I want
> to do takes 6 hrs to figure out. Then it's like, "ooh, sh---..."
>
>
> >
>

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



Re: Ajax Back button

2006-06-26 Thread sicapitan

oh ok i might since im in the area

ive seen a few solutions, it'll have to be in a helper i guess


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



bug in CakePHP 1.1.5.3148 ??

2006-06-26 Thread reyman


Hello,

I'm working with : Apache/2.2.2 (Win32) PHP/5.2.0-dev

[ Loaded Modules apache 2.2.2 are ]

core mod_win32 mpm_winnt http_core mod_so mod_actions mod_alias
mod_asis mod_auth_basic mod_authn_default mod_authn_file
mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user
mod_autoindex mod_cgi mod_dir mod_env mod_imagemap mod_include
mod_isapi mod_log_config mod_mime mod_negotiation mod_rewrite
mod_setenvif mod_userdir mod_php5

[ Session are activated in php.ini ]

>> Session Support  enabled
>> Registered save handlers files user
>> Registered serializer handlers   php php_binary wddx

[ My session are saved here  : ]

session.save_path   C:/TRAVAUX/SERVEUR/APACHE/sessions
session.use_cookies On

[ Problem ? ]

My document root is "C:\TRAVAUX\SITE"
Cake is here : C:\TRAVAUX\SITE\cake

I start cake without modify nothing (clean install of 1.1.5.3148, i try
with older version too )... >> http://localhost/cake

I have this error ...

Fatal error: Call to a member function check() on a non-object in
C:\TRAVAUX\SITE\cake\cake\libs\view\templates\layouts\default.thtml on
line 57

My session at this time t contains :
Config|a:3:{s:4:"rand";i:21423;s:4:"time";i:1151340628;s:9:"userAgent";s:32:"ad87900639db497b6e49a8914ee4130b";}

DO you have an idea of this bug ? 

Ps : i'm on win98 :/


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



Re: Cake setup on OS X - no CSS/img t

2006-06-26 Thread gwoo

there is an include file in the httpd.conf that grabs the "User"  
configuration for the Sites directory.
You should comment that out cause AllowOverride None is in there.

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



Re: How to update multiple divs with one ajax call

2006-06-26 Thread sicapitan

i know i can update multiple divs with one call, but can I specify
their content in the call as well?

like

link('User Control',
array('/users/admin','/company/company_menu/'), array('update' =>
array('main_content','main_menu'))); ?>

would be great but isn't the case

is there another way perhaps in the admin controller to know what link
is being called, and then $this->render('main_menu','ajax'); or
something?


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



Re: hasMany + save()

2006-06-26 Thread bkuhns || (crash)

I'm no authority on this, but I do recall seeing this question in the
IRC chatroom and I believe qwoo said you have to do the multiple save()
approach.


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



Re: Cake setup on OS X - no CSS/img t

2006-06-26 Thread John David Anderson (_psychic_)


On Jun 26, 2006, at 1:54 AM, Jon Bennett wrote:

>
>> As a result, I store all my sites in my Sites folder, and coeus is  
>> one
>> folder directly within Sites - so accessible 'automatically' via
>> http://127.0.0.1/coeus/
>>
>> So I don't *think* its an alias!?
>
> I'd recommend setting up virtual hosts on mac os x for development,
> this way you can mimic a live server environment pretty darn well, not
> as hard as it sounds (or used to be) thanks to:
> http://www.patrickgibson.com/utilities/virtualhost/
>
> then, for each new cake site you work on, you can drop a entirely new
> cake default install in the root of your virtual host - something like
> /Users/adrien/Sites/mydomain.dev - and everything will work without
> any modifications.

This setup is great to have, but not a requirement. You might want to  
make sure your AllowOverride directive is in the correct place though  
if your webroot is somewhere other than /Library/Webserver/Documents.  
There are a few directories you can have the AllowOverride statment -  
are you sure its in the directory that reflects your DocumentRoot?

Also - make sure that mod_rewrite is actually being loaded.

-- J

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



Re: beforeFilter and rdSimpleAuth

2006-06-26 Thread Pacifists

Did you put your appController in /app/ or in /app/controllers ? cause
it should go into /app/ dir for cake to pick it up correctly.


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



Re: Roles, groups and users with Cake ACL

2006-06-26 Thread sicapitan

I used othAuth as it is readable both in code and in db tables.  I had
a little bit of trouble setting up, but thats because I'm a noob.  Othy
(CrazyLegs) has a nother version coming but it has not been tested yet,
still, you can grab it here:

http://cakeforge.org/snippet/detail.php?type=package&id=14


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



Re: Rails-like testing methods in the TestSuite

2006-06-26 Thread nate

Thus far we've tended to favor pure-PHP configuration, or INI-based
formats where better suited.  See paths.php and tags.ini.php in
cake/config/ to get an idea.


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



Re: Rails-like testing methods in the TestSuite

2006-06-26 Thread Mark Somerville

nate wrote:
> I like everything except the YAML.

Thanks for the feedback, Nate.

Do you have an alternative to YAML in mind?

Mark


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



Re: beforeFilter bug?

2006-06-26 Thread AD7six

Hi Carlosrg,

Your post indicates that the checkSession method is run for a delete
call.

What does checkSession do?
*If it does not contain a "die" statement your code will continue to
run.
*If checkSession returns a value, it is not passed to beforeFilter
*If beforeFilter does not return False, the controller method is still
run


You can fix this by either
1) coding checkSession to "die" after redirecting.
2) coding checkSession to return false if it fails AND coding
beforeFilter to return the result of checkSession

Si hay algo mas, y preferias escribir Español - ir a CakeES :)

Cheers,

AD7six


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



Re: Rails-like testing methods in the TestSuite

2006-06-26 Thread nate

I like everything except the YAML.


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



Rails-like testing methods in the TestSuite

2006-06-26 Thread Mark Somerville

Hi everyone.

I've added a new branch to the testsuite SVN
(https://cakeforge.org/plugins/scmsvn/viewcvs.php/branches/?root=testsuite)
to create a more Rails-like approach to testing in CakePHP. There will
be little documentation until it is more solid and stable, but the
README.txt file in the repos does give some simple sample usage. The
tests can be run from the command line or a browser. Feel free to give
me a shout if needbe, as things will probably not work first time
(email or Spakman on #cakephp IRC).

It is simple and currently not up to production standards (to make it
work I had to modify some core classes and they haven't had enough work
to be solid - plus there are some issues and hacks in there!), but I
would *love* some feedback on the things I've got in there just now
(good, bad or indifferent). Also, if anyone has been doing anything
like this (that I've not found), please let me know. I'd hate to be
duplicating work.

Controller tests now inherit from the CakeControllerTest class, which
provides these methods in addition to the standard UnitTestCase ones:

cakeRequest($url, $variables = array()) - simulates an http request

assertResponse($status) - checks that a certain status code was
returned

assertTemplate($template) - checks that a certain template was rendered

assertRedirectedTo($url) - checks that redirect($url) was called

assigns($variable) - accesses the view $variable that is set in the
controller

session($variable) - accesses the session $variable that is set in the
controller

flash() - accesses the flash that is set in the controller

Next up, I would like to implement YAML fixtures and a proper testing
mode/environment. Check out some of the Rails documentation if you're
not familiar with this idea.

Any ideas/thoughts/abuse welcome!

Mark


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



Re: beforeFilter bug?

2006-06-26 Thread carlosrg

Hi AD7six,

Well, I have tried to do what you have said me but I don't get any
result. With that code in 'index' and 'view' actions cake shows me the
name of the action, but with 'edit', 'add' and 'delete' cake tryes to
validate the user, well at least with 'edit' and 'add' actions, with
'delete' action i have the same problem.

Are you in the spanish group CakePHP-es?


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



Re: View cache

2006-06-26 Thread AD7six

Hi all,

if you have
define ('CACHE_CHECK', true); // in app/config/core.php
cache in your list of helpers // in your controller
var $cacheAction = true; //in your controller

Cake will generate cache files for your views.

However (as I understand it ) cacheAction is the length of time to
cache the view, and as such true evaluates to 1 second - set
cacheAction to "1 hour" or some more useful time, the cached views will
be rendered (easily verified by editing the cache file).

I think* that cache does work with layouts or elements at this time.

Cheers,

AD7six
* Due to limited time I´ve yet to discover if the reason my elements
and layouts generate errors is AD7six specific or not ;).


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



Re: model & controller plur problem...

2006-06-26 Thread AD7six

Hi Vladiq,

I don´t know why it would be different between bake and running your
app, but in your /app/config/inflections.php file you can define

$irregularPlural = array('stove' => 'stoves');

and in this way this plural will be handled correctly.

Cheers,

AD7six
PS. Who is cakeshop?


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



Re: beforeFilter bug?

2006-06-26 Thread AD7six

Hi Carlosrg,

I would suggest putting

else
{
pr ($this->action); die;
}

In your before filter and calling the delete method, seeing what it
says and go from there.

Cheers,

AD7six


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



Re: model & controller plur problem...

2006-06-26 Thread [EMAIL PROTECTED]

I am shure. stoves, stove... No one word "stofe"...


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



hasMany + save()

2006-06-26 Thread Repsah
I'm sure I've seen it asked before but I can't find the correct thread... anywayAssuming I have a model Userwhich hasMany AttributeIs there a way to call a single $this->User->save($this->data) to save values both in the users table and in the attributes table.
I give it as a fact I'm building a correct $this->data array to make this possible;$this->data['User']['id']  [other_fields]  .  .
$this->data['Attribute']['id']$this->data['Attribute']['name']$this->data['Attribute']['value']etc. etc.Or the only solution to this is a multiple use of save() for the User model and each of the User attributes?
Thanksrepsah

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


beforeFilter bug?

2006-06-26 Thread carlosrg

Hi,

I'm trying to add a little user authentification to my product
controller.

My code is:

class ProductsController extends AppController
{
var $protectedActions = array('add', 'edit', 'delete');

function beforeFilter(){
if (in_array($this->action, $this->protectedActions))
{
$this->checkSession();
}
}
...
function delete($id)
{
$this->Product->del($id);
$this->redirect('/products/index');
}
...

In 'add' and 'edit' actions, if I'm not logged I am redirected to
loginController, but with 'delete' action I am not redirected to, and
the product is deleted. I don't know where is the problem.

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



Re: model & controller plur problem...

2006-06-26 Thread cakeshop

Make sure that your controller's file name is

stoves_controller.php

and it starts with

class StovesController extends AppController {
var $name = 'Stoves';
...

and your model's file name is

stove.php

and it starts with

class Stove extends AppModel {
 var $name = 'Stove';

Hope this helps.


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



Re: Ajax Back button

2006-06-26 Thread RosSoft

I haven't worked on it yet :s


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



Re: Cake setup on OS X - no CSS/img t

2006-06-26 Thread Jon Bennett

> As a result, I store all my sites in my Sites folder, and coeus is one
> folder directly within Sites - so accessible 'automatically' via
> http://127.0.0.1/coeus/
>
> So I don't *think* its an alias!?

I'd recommend setting up virtual hosts on mac os x for development,
this way you can mimic a live server environment pretty darn well, not
as hard as it sounds (or used to be) thanks to:
http://www.patrickgibson.com/utilities/virtualhost/

then, for each new cake site you work on, you can drop a entirely new
cake default install in the root of your virtual host - something like
/Users/adrien/Sites/mydomain.dev - and everything will work without
any modifications.

hth

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



Re: How to update multiple divs with one ajax call

2006-06-26 Thread stefano

Ok, obviously is something related to my Firefox and it's extensions...

I'll keep you informed on my investigation...

Stefano


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



Re: Add

2006-06-26 Thread [EMAIL PROTECTED]

Yes, four out of five housewives agree, HeadHelper makes for flufflier,
tastier cakes! Ask your grocer for HeadHelper, the choice of all
discriminating bakers!

[EMAIL PROTECTED] wrote:
> Wow - HeadHelper just made my site run much faster (no unnecessary js
> loads!) and saved me a ton of work.  It should really be a core part of
> CakePHP, not a separate snippet!


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



Re: View cache

2006-06-26 Thread Mika

I'm getting the same results. Anyone wish to comment?


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



Re: Cake setup on OS X - no CSS/img t

2006-06-26 Thread believ3r

I've modified my httpd conf to read:

DocumentRoot "/Users/adrien/Sites"

Files there are accessible to me via http://127.0.0.1/filename

As a result, I store all my sites in my Sites folder, and coeus is one
folder directly within Sites - so accessible 'automatically' via
http://127.0.0.1/coeus/

So I don't *think* its an alias!?

Cheers


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



model & controller plur problem...

2006-06-26 Thread [EMAIL PROTECTED]

I have controller
StovesController.php
I have model
Stove.php

Both generated by Baker (before this day - I have not problem with him,
except JS "\'" in wrong place "delete"

So, no change in core, no change in routes...

But, when I ask in browser:

http://site.com/stoves

I got:

issing Model

No class found for the model Stofe

Notice: this error is being rendered by the
app/views/errors/missing_model.thtml view file, a user-customizable
error page.

Fatal: Unable to load model Stofe

Fatal: Create Class:



in file : app\models\stofe.php

But no one "stofe"! I don't use this no where!

Where I am 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
-~--~~~~--~~--~--~---