Re: Bug in the blog tutorial

2006-05-12 Thread modmans2ndcoming

that did it 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
-~--~~~~--~~--~--~---



Re: internal redirect?

2006-05-12 Thread gwoo

There are a couple of options. One is in rdBloggery.
Also, search http://cakebake.wordpress.com
or maybe http://rossoft.wordpress.com/
those guys talked about this issue a while back.
the other more advanced option is to use the RequestHandler.
check in the beforeFilter if the request is coming from ajax
then do a redirect with /bare preceding the url that you want to  
direct to.
using /bare before the controller in a request will give you the ajax  
layout.

Good Luck. Bake on

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Populate select options with rows from another model?

2006-05-12 Thread gwoo

The one it is associated with.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Bug in the blog tutorial

2006-05-12 Thread Larry E. Masters aka PhpNut
chmod the app/tmp/* directories to world writable.And the fix you found for you other problem was not the answer. We do not use capitals in file names.-- /*** @author Larry E. Masters
* @var string $userName* @param string $realName* @returns string aka PhpNut* @access  public*/On 5/12/06, modmans2ndcoming <
[EMAIL PROTECTED]> wrote:OK, I fixed the problem. I think the issue was the name of my model
file. It was post.php, and I renamed it as Post.php I now get the tableof the entries.new problem though. I get warnings at the top of the page and I do notunderstand what they mean:Warning:
file_put_contents(/Library/WebServer/Documents/cake/app/tmp/cache/models/dbomysql_blog_list)[function.file-put-contents]: failed to open stream: Permission deniedin /Library/WebServer/Documents/cake/cake/basics.php on line 925
Warning:file_put_contents(/Library/WebServer/Documents/cake/app/tmp/cache/models/dbomysql_posts)[function.file-put-contents]: failed to open stream: Permission deniedin /Library/WebServer/Documents/cake/cake/basics.php on line 925


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  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: Bug in the blog tutorial

2006-05-12 Thread John Zimmerman [gmail]
It seems that you don't have permission to write to the tmp directories.Fixing this depends on how you have access to the webserver.Usually you can modify the permissions via FTP.Make sure to just modify for the affected directories though.
You just need to give the webserver permission to write to the cake/app/tmp directory.On 5/12/06, modmans2ndcoming <
[EMAIL PROTECTED]> wrote:OK, I fixed the problem. I think the issue was the name of my model
file. It was post.php, and I renamed it as Post.php I now get the tableof the entries.new problem though. I get warnings at the top of the page and I do notunderstand what they mean:Warning:
file_put_contents(/Library/WebServer/Documents/cake/app/tmp/cache/models/dbomysql_blog_list)[function.file-put-contents]: failed to open stream: Permission deniedin /Library/WebServer/Documents/cake/cake/basics.php on line 925
Warning:file_put_contents(/Library/WebServer/Documents/cake/app/tmp/cache/models/dbomysql_posts)[function.file-put-contents]: failed to open stream: Permission deniedin /Library/WebServer/Documents/cake/cake/basics.php on line 925
what is this issue all about?thanksJeremy

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  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: Bug in the blog tutorial

2006-05-12 Thread modmans2ndcoming

OK, I fixed the problem. I think the issue was the name of my model
file. It was post.php, and I renamed it as Post.php I now get the table
of the entries.

new problem though. I get warnings at the top of the page and I do not
understand what they mean:

Warning:
file_put_contents(/Library/WebServer/Documents/cake/app/tmp/cache/models/dbomysql_blog_list)
[function.file-put-contents]: failed to open stream: Permission denied
in /Library/WebServer/Documents/cake/cake/basics.php on line 925

Warning:
file_put_contents(/Library/WebServer/Documents/cake/app/tmp/cache/models/dbomysql_posts)
[function.file-put-contents]: failed to open stream: Permission denied
in /Library/WebServer/Documents/cake/cake/basics.php on line 925

what is this issue all about?

thanks

Jeremy


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: internal redirect?

2006-05-12 Thread TheIdeaMan

I've run into the same problem. The closest thing I've found is the
requestAction() function of the Controller object (I'm using 1.0).
Trouble is, requestAction() doesn't seem to load the JavaScript which
is problematic if you're doing AJAX.

Ideally, the Controller::redirect() method would handle how it
processed the redirect() request: if it were non-AJAX, it would send
the HTTP redirect; if it were AJAX, it would "redirect" internally.

Yes, it could get out of hand and hard to debug, but that's going to
be up to the developer to avoid and remedy. I don't think it's any
more complicated than using AJAX -- it would actually make it simpler.

Anyway, just wanting to add my vote for this feature. I'm going to
check the ticket system now...

On 5/4/06, Armando Sosa <[EMAIL PROTECTED]> wrote:
> maybe just calling the action?
>
> $this->action()
>
> or using controller::setAction()
>
>
> On 5/4/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
>
> I think this could get out of control quickly and be very hard to
> debug.  Pages coming up from other methods but listed in the browser
> under another method.  Could get very confusing and no real way to
> debug.  If you used AJAX at least you could have a program to capture
> the XMLHTTPRequests.
>
> I would rethink what you are doing.
>
>
>
>
>
> --
> Armando Sosa
>
> www.nolimit-studio.com
> www.dospuntocero.info
>
>  >
>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Populate select options with rows from another model?

2006-05-12 Thread tom

Wait, so do you call generateList() on the model that you're using, or
the model which it is associated with?


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



Quick One: Associated form fields like the scaffolding.

2006-05-12 Thread tom

Hi, I'm working on making a nice input field for a certain Model, and
it has a hasOne association to another type of data (and vice versa,
that data has a belongsTo relationship). Is there a quick way to make
that nice dropdown menu that the scaffolding provides? Like, where the
values of the associated data are already there, so it's very simple.
I'd like to improve upon it a little bit, but I'm searching through the
scaffolding code and having a bit of a tough time.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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 use generateList

2006-05-12 Thread gwoo


you are getting that error because you are not using 'ModelName/field'
so $html->selectTag('ModelName/test',array('1' =>  
'value1','2'=>'value2'));



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



how to use generateList

2006-05-12 Thread [EMAIL PROTECTED]

I don't get it, I have tried everything to get both $html->selectTag
and $model->generateList to work correctly, I can't get either to work.

I tried this:

echo $html->selectTag('test',array('1' => 'value1','2'=>'value2');

No matter what data I send to $html->selectTag,  I get:

Notice: undefined offset 1 in ... path to helpers/html.php

Anyone know what is going on 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: Bug in the blog tutorial

2006-05-12 Thread calzone

the table should be named posts

the controller should use the plural, posts_controller.php and then
PostsController extends AppController

the first line inside your controller should be var $name = 'Posts'

the model should be Post

the first line inside your model should be var $name = 'Post'

the views should be inside a folder called posts


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Bug in the blog tutorial

2006-05-12 Thread modmans2ndcoming

Well, What else could it be? I copy and pasted everything from the
blog, the index page that comes with cakephp says I am connecting to
the database, I really do not know what else could be wrong except for
something in the code in the tutorial.


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



Is there an equivalent of GetAssoc() for ADODB?

2006-05-12 Thread [EMAIL PROTECTED]

A quick way to get an associative array from a SQL statement?  I
plugged through the api and can't find it, if it exists.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: square(croped) thumbnails

2006-05-12 Thread BoBB
Is there any documentation on how to use the library? I read through it, but I can't really figure it out heh <-- php newbOn 5/12/06, gwoo <
[EMAIL PROTECTED]> wrote:rdBloggery does this.
http://cakeforge.org/projects/rdos
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  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: Basic Associations question

2006-05-12 Thread Armando Sosa
yep they areOn 5/12/06, David Spitzley <[EMAIL PROTECTED]> wrote:
Am I correct that Associations need to be symmetric between Model files?  In other words, if I define A hasMany B or A hasOne B, then I must also define B belongsTo A?  And if A hasAndBelongsTo B then I must also state B hasAndBelongsTo A?
David-- Armando Sosawww.nolimit-studio.comwww.dospuntocero.info

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  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: Bug in the blog tutorial

2006-05-12 Thread John Anderson

What blog tutorial?

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

This one?

And the error you've linked to has to do with view code that is  
rendering, not a missing model error message...

*confused*

-- John

On May 12, 2006, at 2:08 PM, modmans2ndcoming wrote:

>
> I was following the blog tutorial and even went so far as to start  
> over
> and copy/paste the code to try to get it to work right. To no avail. I
> keep getting an error:
>
> "No Database table for model Post (expected "posts"), create it  
> first."
>
> or if I play with the singular/plurals in the model I get:
>
> "No class found for the model Post "
>
>  I did some looking around and found that this is a problem from a
> while ago:
>
> http://groups.google.com/group/cake-php/browse_frm/thread/ 
> c7cb24b36761663c/aef76e5c996455d5?q=blog 
> +tutorial&rnum=4#aef76e5c996455d5
>
> seems that he blog tutorial was not updated to account for the new way
> to get data.
>
> Someone might want to fix that because noobs like me are going to get
> frustrated .
>
>
> thanks,
>
> Jeremy
>
>
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: square(croped) thumbnails

2006-05-12 Thread gwoo

rdBloggery does this.
http://cakeforge.org/projects/rdos

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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 the blog tutorial

2006-05-12 Thread modmans2ndcoming

I was following the blog tutorial and even went so far as to start over
and copy/paste the code to try to get it to work right. To no avail. I
keep getting an error:

"No Database table for model Post (expected "posts"), create it first."

or if I play with the singular/plurals in the model I get:

"No class found for the model Post "

 I did some looking around and found that this is a problem from a
while ago:

http://groups.google.com/group/cake-php/browse_frm/thread/c7cb24b36761663c/aef76e5c996455d5?q=blog+tutorial&rnum=4#aef76e5c996455d5

seems that he blog tutorial was not updated to account for the new way
to get data.

Someone might want to fix that because noobs like me are going to get
frustrated .


thanks,

Jeremy


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



square(croped) thumbnails

2006-05-12 Thread BoBB
Does anyone know of any libraries or even a decent method to generate cropped square thumbnails

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  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: Populate select options with rows from another model?

2006-05-12 Thread gwoo

haha

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: More hasAndBelongsToMany Fun

2006-05-12 Thread David Spitzley

I'll admit to laziness in this case, but only because the topic had just been 
raised.


David

>>> [EMAIL PROTECTED] 05/12/06 3:26 PM >>>

:o)

/app/config/core.php

This is a pretty basic question - make sure you guys are at least  
trying to find this out for yourselves before asking. If you already  
did, kudos to you.

-- J

On May 12, 2006, at 1:24 PM, David Spitzley wrote:

>
> Perfection.  I'd been wondering how to recover the default SQL  
> statement for tweakage.  By the way, where does one set DEBUG?
>
>
> David
>
 [EMAIL PROTECTED] 05/12/06 3:20 PM >>>
>
> I'd run a normal Cake HABTM query, with DEBUG turned to 3.
>
> Take the query Cake is using for its vanilla HABTM fetch, and tweak
> it to your liking before specifying it as the finderSQL for your
> association.
>
> -- John
>
> On May 12, 2006, at 1:16 PM, [EMAIL PROTECTED] wrote:
>
>>
>> If you figure this out, please post the solution, I have  a very
>> similar situation, Counselors, Rooms, and Room Assignments that have
>> start time and end time, I haven't found a great way yet, except just
>> using the query() command and writing the sql myself.
>>
>>
>>>
>
>
>
>
>
> >





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: findAll recursive problem

2006-05-12 Thread theo

OK, I figured this out, though I'm not too thrilled with the solution.

It turns out the recursive functionality is very particular as to what
you name your hasMany relationship.

My Workflow hasMany relationship for Step was named "Step". When I
renamed it to "step", suddenly all my steps where populated with their
respective Rules.

Odd.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Populate select options with rows from another model?

2006-05-12 Thread roberts.sean

D'oh, generateList() seemed to work just fine!

That's twice today that I've answered my own question... maybe I should
stop posting.


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



Populate select options with rows from another model?

2006-05-12 Thread roberts.sean

I two models, "properties" and "regions."  Each property belongsTo a
region, and each region hasMany properties.  When I'm creating a new
property, I need to have a selectTag that allows the user to select
which region their property belongs to, but I can't figure out how to
get all of the regions into the select box, or how to specify which
data will be used for the value and which data will be used as the
title.

In my add.thtml:
selectTag('Property/region_id', $regions; ?>

I've tried the following in my properties_controller.php:

$this->set('regions', $this->Region->findAll());
- Didn't work because you can't run selects on models you're not
controlling

$this->set('regions',
$this->requestAction('/admin/regions/getRegionList');
- With $this->Region-findAll(); as the action I'm requesting, no select
object appears, and an attempt to print_r($regions) in my add.thtml
view turns up null.

$this->set('regions', $this->Property->findBySQL('SELECT * FROM
regions'));
- This is the closest I've gotten, but I get an "array to string
conversion" error and the array seems to be formatted in such a way
that I can't use it in the option selector.  This also doesn't seem
like a "best practice" as I thought that findBySQL() was meant for
pretty complex SQL statements.

So basically to recap, I want to take values from another model and
populate a select tag with them.  I'd also like to know how to specify
which data goes where.  I'd eventuall like it to be formatted as:

{the title of the
region}

I'm sure this is relatively simple but I'm just not getting it.  If
anyone could help me out I'd greatly appreciate it.  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
-~--~~~~--~~--~--~---



Re: More hasAndBelongsToMany Fun

2006-05-12 Thread [EMAIL PROTECTED]

I found a problem in the documentation, it says you pass in your own
SQL as the 'finderSql' parameter in the hasAndBelongsToMany array, but
it really needs the 'finderQuery' parameter, that is why I could not
get it to work.


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



Re: More hasAndBelongsToMany Fun

2006-05-12 Thread [EMAIL PROTECTED]

sorry, I found it right after I posted in haste.

What i discovered is that Cake is running a bunch of queries, it gets
the data from the first table, then loops through and queries the
second and third table joined together, using the id from the first to
filter the data.

Even when I pass in my sql, it doesn't use it for some reason, I wonder
why?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: More hasAndBelongsToMany Fun

2006-05-12 Thread John Anderson

:o)

/app/config/core.php

This is a pretty basic question - make sure you guys are at least  
trying to find this out for yourselves before asking. If you already  
did, kudos to you.

-- J

On May 12, 2006, at 1:24 PM, David Spitzley wrote:

>
> Perfection.  I'd been wondering how to recover the default SQL  
> statement for tweakage.  By the way, where does one set DEBUG?
>
>
> David
>
 [EMAIL PROTECTED] 05/12/06 3:20 PM >>>
>
> I'd run a normal Cake HABTM query, with DEBUG turned to 3.
>
> Take the query Cake is using for its vanilla HABTM fetch, and tweak
> it to your liking before specifying it as the finderSQL for your
> association.
>
> -- John
>
> On May 12, 2006, at 1:16 PM, [EMAIL PROTECTED] wrote:
>
>>
>> If you figure this out, please post the solution, I have  a very
>> similar situation, Counselors, Rooms, and Room Assignments that have
>> start time and end time, I haven't found a great way yet, except just
>> using the query() command and writing the sql myself.
>>
>>
>>>
>
>
>
>
>
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: More hasAndBelongsToMany Fun

2006-05-12 Thread David Spitzley

Perfection.  I'd been wondering how to recover the default SQL statement for 
tweakage.  By the way, where does one set DEBUG?


David

>>> [EMAIL PROTECTED] 05/12/06 3:20 PM >>>

I'd run a normal Cake HABTM query, with DEBUG turned to 3.

Take the query Cake is using for its vanilla HABTM fetch, and tweak  
it to your liking before specifying it as the finderSQL for your  
association.

-- John

On May 12, 2006, at 1:16 PM, [EMAIL PROTECTED] wrote:

>
> If you figure this out, please post the solution, I have  a very
> similar situation, Counselors, Rooms, and Room Assignments that have
> start time and end time, I haven't found a great way yet, except just
> using the query() command and writing the sql myself.
>
>
> >





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: More hasAndBelongsToMany Fun

2006-05-12 Thread John Anderson

/app/config/core.php

-- J

On May 12, 2006, at 1:22 PM, [EMAIL PROTECTED] wrote:

>
> Can you tell me where to set the DEBUG, is that global, or in this one
> model file?
>
>
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: More hasAndBelongsToMany Fun

2006-05-12 Thread [EMAIL PROTECTED]

Can you tell me where to set the DEBUG, is that global, or in this one
model file?


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




'using' another model causes erro

2006-05-12 Thread [EMAIL PROTECTED]

In Cake v1

I have Model 1
I have one single method, index(), that uses simple findAll() to return
data for Model 1.

If I set $uses = array('Model 2') in my Model1Controller class, I get:

"Call to a member function on a non-object in " the line that runs
$this->findAll();

there are no relationships defined in Model 2, nothing at all
really,just a shell for now.

Any ideas why it breaks?

Brian


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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 selectTag from an enum in the model

2006-05-12 Thread calzone

Wow, we cross-posted.

Looks like your approach is basically the same as mine.

:)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: More hasAndBelongsToMany Fun

2006-05-12 Thread John Anderson

I'd run a normal Cake HABTM query, with DEBUG turned to 3.

Take the query Cake is using for its vanilla HABTM fetch, and tweak  
it to your liking before specifying it as the finderSQL for your  
association.

-- John

On May 12, 2006, at 1:16 PM, [EMAIL PROTECTED] wrote:

>
> If you figure this out, please post the solution, I have  a very
> similar situation, Counselors, Rooms, and Room Assignments that have
> start time and end time, I haven't found a great way yet, except just
> using the query() command and writing the sql myself.
>
>
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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 selectTag from an enum in the model

2006-05-12 Thread calzone

No replies?   I guess I'm imagining things then and this isn't
supported by cake?

To help make this topic a better reference source should future people
have a question on this, use the following code in your model:


function getMyEnum()
{
$rows=$this->query("SHOW COLUMNS FROM myTable LIKE
'myEnumColumnName'");
foreach ($rows[0][0] as $key => $value)
{
if ($key=='Type')
{
 preg_match_all("/'(.*?)'/", $value, $matches);
 $arryEnum= $matches[1];
}
}
return $arryEnum;
}

(Obviously, replacing getMyEnum, myTable and myEnumColumn with whatever
your situation dictates.

And then in the controller, add:

$this->set('Myvar',$this->MyModel->getMyEnum());


This could be abstracted further by passing the table name and column
name to the function, but then, maybe such functionality might make a
good addition to the cake model?

However, the lesson I've learned from this is that you still require a
separate db query to load the enum array.  In that case, maybe it would
just be better to store enum values in a separate table with their own
model.  I don't know what kind of performance difference there may be
between the two approaches. But in general, I avoid enum because
changing the values involves an ALTER TABLE and the sql is
non-portable.  But there are cases where it is useful, and retrieving
selected values doesn't involve a join.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: More hasAndBelongsToMany Fun

2006-05-12 Thread [EMAIL PROTECTED]

I tried this and it did not work in Version 1 of Cake, don't know why,
but it just did a basic hABTM select and didn't use my SQL statement to
get the extra data in my join table.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: More hasAndBelongsToMany Fun

2006-05-12 Thread [EMAIL PROTECTED]

If you figure this out, please post the solution, I have  a very
similar situation, Counselors, Rooms, and Room Assignments that have
start time and end time, I haven't found a great way yet, except just
using the query() command and writing the sql myself.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: More hasAndBelongsToMany Fun

2006-05-12 Thread John Anderson


Is this something I have to do by explicitly setting the findersql  
property of the hABTM associations?

Yep.

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



More hasAndBelongsToMany Fun

2006-05-12 Thread David Spitzley

Say that I've got a requests table, a staff table and a join table named 
assignments.  In addition to request_id and staff_id, assignments contains a 
"role" field.  Once I set up the hasAndBelongsToMany associations between 
requests and staff, how would I pull up the role field?  Is this something I 
have to do by explicitly setting the findersql property of the hABTM 
associations?


David


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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 selectTag from an enum in the model

2006-05-12 Thread Daneel

I also faced this issue and the only solution I found was to use a
custom query. That is I created a funcion in the model that queries the
database for the enum values and creates an array based on it:

function generateDifficultyList() {
$ret = $this->query("SHOW COLUMNS FROM `recipes` LIKE
'difficulty';");

// WORKARROUND: The $ret array has different keys if
using MySQL.4 or 5
$key = array_keys($ret[0]);

foreach(split("','", substr($ret[0][$key[0]]['Type'],
6, -2)) AS $num => $name)
$return[$name] = $name;

return $return;
}

Then in the Controller I can do $this->set('difficulties'
$this->Recipe->generateDifficultyList()).

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: Mortgage Industry

2006-05-12 Thread gwoo

make a component 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Mortgage Industry

2006-05-12 Thread John Zimmerman [gmail]
I don't expect cake to know about the formats.  I am writing that code.I was wondering if someone has some tips about writing it within the cake framework so I had a headsup if there are some tricks that make it easier or pitfalls that I should steer clear of.
I have imported some basic files into mysql tables before, and also relied on some PEAR libraries for a couple of different formats.This time it is a bit more complicated and I am just getting started with Cake.
Thanks for the input.Any suggestions as to where this "import code" would fit best in the MVC model?  I was originally going to try to do it as a component but not sure what would be best here.
Thanks!On 5/12/06, Olwen Williams <[EMAIL PROTECTED]> wrote:
I wrote some import stuff for a couple of systems.  I just take thefile and parse it to a table then loop round and use cake to createrecords.  I didn't expect cake to know about the odd formats I wasgetting.
One of my systems gets files by ftp.  A simple cron job (a view on amodel) looks for a new file and runs the update.On 13/05/06, John Zimmerman [gmail] <[EMAIL PROTECTED]
> wrote:> This is sort of off topic, other than the fact I am developing in the cake> framework.>> I need to import data files exported by Loan Origination software.  There> are several different formats, one is space delimited and another is XML
> based.>> I have two questions.>> 1) Does anyone have experience importing (or exporting) in file formats used> in the mortgage industry?>>> 2) Does anyone have any tips regarding writing import/export code in the
> cake framework?> Thanks in advance.>>  >>

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


Re: Mortgage Industry

2006-05-12 Thread Olwen Williams

I wrote some import stuff for a couple of systems.  I just take the
file and parse it to a table then loop round and use cake to create
records.  I didn't expect cake to know about the odd formats I was
getting.

One of my systems gets files by ftp.  A simple cron job (a view on a
model) looks for a new file and runs the update.

On 13/05/06, John Zimmerman [gmail] <[EMAIL PROTECTED]> wrote:
> This is sort of off topic, other than the fact I am developing in the cake
> framework.
>
> I need to import data files exported by Loan Origination software.  There
> are several different formats, one is space delimited and another is XML
> based.
>
> I have two questions.
>
> 1) Does anyone have experience importing (or exporting) in file formats used
> in the mortgage industry?
>
>
> 2) Does anyone have any tips regarding writing import/export code in the
> cake framework?
>
>
>
>
> Thanks in advance.
>
>  >
>

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



Basic Associations question

2006-05-12 Thread David Spitzley

Am I correct that Associations need to be symmetric between Model files?  In 
other words, if I define A hasMany B or A hasOne B, then I must also define B 
belongsTo A?  And if A hasAndBelongsTo B then I must also state B 
hasAndBelongsTo A?


David


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



Mortgage Industry

2006-05-12 Thread John Zimmerman [gmail]
This is sort of off topic, other than the fact I am developing in the cake framework.I need to import data files exported by Loan Origination software.  There are several different formats, one is space delimited and another is XML based.
I have two questions.1) Does anyone have experience importing (or exporting) in file formats used in the mortgage industry?2) Does anyone have any tips regarding writing import/export code in the cake framework?
Thanks in advance.

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


csv data export

2006-05-12 Thread Eric Banford

I need to write a csv data export function for use in my admin pages, 
and was wondering if anyone had tackled this already? I have a simple 
version working for a single table, the problem come when I try to 
export a table with belongsTo relationships, some of those which have 
belongsTo, etc. Cycling through all of the relationships and getting all 
of the data is complex, so before tacking it I thought I'd ask if it had 
already been solved by someone (seems a common need). If it's not 
already out there, I'll share the solution when I get it done.

Thanks,
Eric


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



findAll recursive problem

2006-05-12 Thread theo

Hi there,

I'm also having a problem getting recursive data back greater than 1
level deep. Here's my data model:

Workflow hasMany Steps
Step hasMany Rules

I execute:

$workflow->id = 1;
$workflow->recursive = 3;
$workflow->findAll();

Result:

Workflow has Steps array populated, but all the Steps have empty Rules
arrays. The SQL that is returned trying to load the rules is:

SELECT `Rule`.`id`, `Rule`.`step_id`, `Rule`.`left_value`,
`Rule`.`right_value`, `Rule`.`comparison_operator`, `Rule`.`position`
FROM `rules` AS `Rule` WHERE `Rule`.`step_id`=NULL


HOWEVER, if I just read a Step directly, the Rules array is populated
perfectly.

Can someone help me out with this one? It appears to be an actual bug.

-Theo


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: rdAuth? Users? ACL?

2006-05-12 Thread John Anderson


On May 11, 2006, at 6:21 PM, tom wrote:

>
> I'm trying it out right now, and so far...
> in the last code sample, $this->checkAccess(); should probably be
> $this->checkSession();

Good eye... good eye.

Thanks!

-- 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: displaying data from has_and_belongs_to_many (habtm) relationship

2006-05-12 Thread John Anderson

What needs to be changed?

(btw: I think we need to check out the manual to see why some of the  
view code is missing carriage returns. Some views are still getting  
rendered as a single line on the manual site.)

-- J

On May 12, 2006, at 3:50 AM, gwoo wrote:

>
> Check out
> http://manual.cakephp.org/chapter/6
> there is an example towards the bottom with tags.
> in short:
> $this->set('post', $this->Post->read();
> then
> foreach($post['Tag'] as $tag)
>
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: rdAuth? Users? ACL?

2006-05-12 Thread Olivier percebois-Garve

You can also try this : 
http://othy.wordpress.com/2006/05/12/othauth-02-released/

tom wrote:
> Hi,
>
> I'm very experienced with PHP and somewhat experienced with CakePHP.
> I'm interested in building a simple app, but one of the things that I'm
> not sure how to do is user authentication. Is there a best practice for
> this? It seems like some people use rdAuth, which might be broken, and
> some use Access Control Manager, which is definitely broken, and some
> build their own with dbACL, but there's no documentation for that (or
> for the other two options.) Is there a good way to go about this?
>
> Thanks,
>
> Tom
>
>
> >
>
>   


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



ACL - Ajax

2006-05-12 Thread ivan

I think I read a some days ago that the ACL component was having
trouble with ajax implementation and when user opened multiple tabs.
Actually I'm not sure it was the ACL component, but I can`t find the
post anymore and I need to make sure to begin a project. If it was
fixed that would be even better...

well, hope somebody knows 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: Following blog tutorial.... problem

2006-05-12 Thread modmans2ndcoming

The SQL was copied from the tutorial:

CREATE TABLE posts (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(50),
body TEXT,
created DATETIME DEFAULT NULL,
modified DATETIME DEFAULT NULL
);


INSERT INTO posts (title,body,created)
VALUES ('The title', 'This is the post body.', NOW());
INSERT INTO posts (title,body,created)
VALUES ('A title once again', 'And the post body follows.', NOW());
INSERT INTO posts (title,body,created)
VALUES ('Title strikes back', 'This is really exciting! Not.',
NOW());

My database config is:

class DATABASE_CONFIG
{
var $default = array('driver'=> 'mysql',
 'connect'  => 'mysql_connect',
 'host' => 'localhost',
 'login'=> 'cakephp',
 'password' => 'cakephp0506',
 'database' => 'gradebook',
 'prefix'=> '');

var $test=  array('driver'=> 'mysql',
 'connect'  => 'mysql_connect',
 'host' => 'localhost',
 'login'=> 'user',
 'password' => 'password',
 'database' => 'project_name-test',
 'prefix'=> '');
}


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Scaffold problem

2006-05-12 Thread Samuel DeVore

Make sure the $hasMany and $belongsTo are capitalized correctly

var $hasMany = "Product";

On 5/12/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I  have downloaded last nightly build cake_nightly_20.03.2006.
>
> My app has the model (this is different files)
>
> class Group extends AppModel {
> var $hasMany = "product";
> }
> ...
> class Product extends AppModel {
> var $hasMany = "result";
> var $belongsTo = "group";
> }
> ...
> class Result extends AppModel {
> var $belongsTo = "product";
> }
>
> I have problem with select-ftag for product's group field. It's empty
> for Add/Edit view.
> But if I add id in table manually, i see correct relation in index
> view.
> What's the problem?
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Following blog tutorial.... problem

2006-05-12 Thread John Anderson


On May 12, 2006, at 7:44 AM, modmans2ndcoming wrote:
> Is there anything else you might need?

The SQL for the posts table, I suppose, and the contents of your /app/ 
config/database.php file.

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



Scaffold problem

2006-05-12 Thread [EMAIL PROTECTED]

I  have downloaded last nightly build cake_nightly_20.03.2006.

My app has the model (this is different files)

class Group extends AppModel {
var $hasMany = "product";
}
...
class Product extends AppModel {
var $hasMany = "result";
var $belongsTo = "group";
}
...
class Result extends AppModel {
var $belongsTo = "product";
}

I have problem with select-ftag for product's group field. It's empty
for Add/Edit view.
But if I add id in table manually, i see correct relation in index
view.
What's the problem?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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 go where?

2006-05-12 Thread roberts.sean

Oh... apparently they go in /app/webroot/img... what a surprise.

Nothing to see here :-)


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



Re: Helpers not available in my layout

2006-05-12 Thread Jason Lee

On 5/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Anytime I have this problem I either have tables missing in the
> database or the database file is misconfigured (typo).  You can do an
> if(isset($browser)) before calling the helper.  If you do that then you
> should see the error that CakePHP is trying to give you.  It just can't
> because there is code in there that relies on CakePHP and it has
> already bombed out.

Ah!  That was it!  If you're ever in Oklahoma City, I'll buy you a Slurpee :P

-- 
jason lee
http://www.steeplesoft.com
http://blogs.steeplesoft.com
http://littlezoper.livejournal.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
-~--~~~~--~~--~--~---



File uploads go where?

2006-05-12 Thread roberts.sean

I followed the tutorial found here on handling file uploads, but I'm
stuck on one thing.
http://groups.google.com/group/cake-php/browse_frm/thread/fe4c9d7739f8be2a/4bede155456ff93f?q=file+upload&rnum=4#4bede155456ff93f

Normally when PHP fails a file-upload it gives me a bunch of warnings,
but it doesn't seem to do that with this tutorial.  What I've basically
figured however, is that whatever directory the images are supposed to
be going to either isn't created or doesn't have permissions set
correctly.  So my question is this: Where exactly is
WWW_ROOT.IMAGES_URL and do I need to create it?

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



Re: Following blog tutorial.... problem

2006-05-12 Thread modmans2ndcoming

The name of the table in my database is "posts" that is the case and
the plurality. The columns are exactly as follows:

id, title, body, created, modified

My model code is this:

from /models/post.php:


My controller code is this:

from controllers/posts_controller.php:

set('posts', $this->Post->findall());
}
}
?>

My view is this:

from /views/posts/index.thtml:

Blog posts

IdTitleCreated




link($post['Post']['title'],
"/posts/view/".$post['Post']['id']); ?>






Is there anything else you might need?

thanks, 

Jeremy


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: default values in form fields

2006-05-12 Thread David Spitzley

>>> [EMAIL PROTECTED] 05/12/06 5:46 AM >>>

if you set in $this->data['Model']['field']
then the html helper will add the value to the field
you can use $html->tagValue('Model/field'); if you need the default  
data for something else.

so in your add form for example

function add()
{
if(empty($this->data)
{
$this->data['Model']['field1'] = 'default for field1';
}
else.
// form has posted
}

now in the view $html->input('Model/field1);  the default value will  
be "default of field1"
---

Actually, I was wading around in the code yesterday, and I think I'd implement 
default values in the "add" view.  The calls to the HTML helper all generally 
have the ability to process defaults.


David


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: rdAuth? Users? ACL?

2006-05-12 Thread sudonim

This rocks. I was just exploring this problem on Wednesday and lo and
behold - there is now an answer. Thank you John, and thank you Cake for
making the complex achievable.

John Anderson wrote:
> *throws confetti*
>
> http://manual.cakephp.org/chapter/19
>
> ;o)
>
> I was gonna wait till someone proofed it, but no one has bothered me
> about major problems with it.
>
> -- John
>
> On May 11, 2006, at 5:15 PM, calzone wrote:
>
> >
> > You beat me to it!
> >
> > I was very excited to see this chapter in the manual magically appear.
> > I'm very grateful to see this addition and I think it will really help
> > a lot of us just getting started.
> >
> > So come on, where's the confetti guys?  Jeesh, talk about a low key
> > announcement.
> >
> >
> > >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Usability of component 'Security'

2006-05-12 Thread 100rk

Thank You for answer, Nate - I'm sorry, I'm not able to follow changes
in manual, if I want to be familiar with changes in code - and I do
speak PHP better then English, You know ;-)

Problem is: this doesn't affect ajax calls only, user must not open any
link of Your page in other browser tabs/windows. So I don't think there
is (just because of this behaviour) some need for Prototype extension,
if we could make some rules for tokens in this brainly new component.
You know, I think we could make Security component manage more then one
'token' in one time - and not all of them must be re-created on every
request etc. Something like 'one-touch-token' (as it is just now) and
time-specific token ([$endTime [, $startTime]]). This solution will be
IMHO more flexible. What do You think about this idea, please?

You know,


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



Re: Helpers not available in my layout

2006-05-12 Thread Mika

Could be a problem with case? Try $helpers = array('html', browser');


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: displaying data from has_and_belongs_to_many (habtm) relationship

2006-05-12 Thread gwoo

Check out
http://manual.cakephp.org/chapter/6
there is an example towards the bottom with tags.
in short:
$this->set('post', $this->Post->read();
then
foreach($post['Tag'] as $tag)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: default values in form fields

2006-05-12 Thread gwoo

if you set in $this->data['Model']['field']
then the html helper will add the value to the field
you can use $html->tagValue('Model/field'); if you need the default  
data for something else.

so in your add form for example

function add()
{
if(empty($this->data)
{
$this->data['Model']['field1'] = 'default for field1';
}
else.
// form has posted
}

now in the view $html->input('Model/field1);  the default value will  
be "default of field1"


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



displaying data from has_and_belongs_to_many (habtm) relationship

2006-05-12 Thread mamaf

Hi,

Could someone explain how to display
say for example :
a post table
a tag table
a posts_tags table (habtm relationship)

in a post view, how can i display (for example in  list) the
list of tag names associated with this post ?
and in the other hand, in a tag view, how to display all the posts
related to a specific tag ?

Thank you for your help

Jean-Marc


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Screencasts lack audio

2006-05-12 Thread [EMAIL PROTECTED]

Hi there,

ok maybe i'll be hung for this but (and remember I love cake ;)

I'm not new to cake so everything u do in the screencast I understand
but

it goes awfully fast :)

I know how much time it takes to do these things believe me ;) but I
just wanted to point out that it's a real good thing you think about
adding audio.

Same screencast a little slower and with good explanation of whats
going on would be a real killer IMHO

Also maybe staying within the cake site would help feel more
comfortable.

Keep in mind that all i'm saying is to help get cake spread and that
i've had people saying it the docs needed improvement and so on.

On a more positive note : thanks a lot for this !!

thomas


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