Re: R: adding extra fields when reading a model

2007-05-30 Thread laptop

seems kind of messy way for a simple task... oh wells i will soldier
on

On May 31, 3:51 pm, <[EMAIL PROTECTED]> wrote:
> You Have 2 chance to accomplish this task
> 1. You can build fake field in your model afterFind() function
> function afterFind( $result ) {
>   $result = parent::afterFind( $result );
>   foreach( $result as $k => $v ) {
> $result[$k]['Table']['thumb_url'] = 'thumb_' . @$v['Table']['image'];
>   }
>   return $result;
>
> }
>
> 2. You can build your fake field with findAll
> $data = $this->Table->findAll(null, "*, CONCAT('thumb_', image) AS
> thumb_url");
> die(pr($data));
>
> Attention in case  2 the field is not added in the Table array but in array
> apart.
> See the pr output
> HTH
>
> > -Messaggio originale-
> > Da: cake-php@googlegroups.com
> > [mailto:[EMAIL PROTECTED] Per conto di laptop
> > Inviato: giovedì 31 maggio 2007 6.51
> > A: Cake PHP
> > Oggetto: adding extra fields when reading a model
>
> > Hi,
>
> > Is there a way to add a field to a model which is the result
> > of an SQL function. My scenario is that I have an image_url
> > field, the thumb of the image_url is also stored in the same
> > directory with '_thumb'
> > appended before the index.
>
> > ie bradcraig.jpg would become bradcraig_thumb.jpg
>
> > Is there a way I can include a SQL function when retrieving
> > the model?? The SQL to calculate it is below..
>
> > SELECT 'images/bradcraig.jpg' AS image_url,
> > CONCAT(SUBSTRING_INDEX('images/bradcraig.jpg', '.', 1),
> > '_thumb.', SUBSTRING_INDEX('images/bradcraig.jpg', '.', -1))
> > AS thumb_url;
>
> > Thanks


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



Re: Help: Ajax ( Iframe ) Upload

2007-05-30 Thread 浪漫様

Thanks for your reply, I had been looking that post before wirting
that question.
I can't find the implemention of the IFRAME... nobody has an example
code on how to use the IFRAME??
Thank you very much
Best Regards,

Rohman


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



Re: how can a controller access another model

2007-05-30 Thread AD7six



On 31 mayo, 08:19, Ita <[EMAIL PROTECTED]> wrote:
> Hi,
> Thanks for the tip I\ll try and use it today and see if it works.
> I actually do not use the object name it was just to simplify the
> example...

Yeah, that's often a bad idea ;). Tell it like it is and some
ambiguity is eliminated.

foobar,

AD


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



Re: how can a controller access another model

2007-05-30 Thread Ita

Hi,
Thanks for the tip I\ll try and use it today and see if it works.
I actually do not use the object name it was just to simplify the
example...
Thanks again,
Ita

On May 30, 4:46 pm, AD7six <[EMAIL PROTECTED]> wrote:
> Ita wrote:
> > Hi,
> > In my DB I have 3 tables
> > objects, users & votes
>
> You are going to have problems with a model class named 'Object' since
> it already exists - you need to choose a different  name.
>
> regarding the check, as I'm here, simply use your associations:
>
> if ($this->Vote->Thing->hasAny(array('Thing.name'=>$objectName)) {
> // cast vote.
>
> }
>
> hth,
>
> AD


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



Re: Pretty URL's

2007-05-30 Thread Arndtinho

Thanks.
I tried this configuration:

define ('BASE_URL', env('SCRIPT_NAME') . '?'); -> old: define
('BASE_URL', env('SCRIPT_NAME') );
$uri = env('PHP_SELF') . env('QUERY_STRING'); -> old: $uri = setUri();

And this is the result now: http://www.mydomain.de/index.php?/main/index

I checked the server configuration with phpinfo(): Apache/1.3.33
(Unix), Server API: CGI, PHP Version 4.4.7
I'm clueless.

Regards,
Arndtinho


On 30 Mai, 21:55, "Nicolas Rimbeau" <[EMAIL PROTECTED]> wrote:
> On 5/31/07, Arndtinho <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hello,
>
> > I have some problems with pretty url's. Following the domain name you
> > can see "index.php" e.g.
>
> >http://www.mydomain.de/index.php/main/index
>
> > On my local machine (WinXP, Apache2, mod_rewrite is enabled) works the
> > app without any problems. But on the webserver I get this problems. I
> > don't have permissons to change the httpd.conf.
>
> > What I did:
> > - uploaded the app on the server,
> > - deleted the .htaccess files in
>
> > /appdir
> > /appdir/app
> > /appdir/app/webroot
>
> > - and uncommented the BASE_URL line. The result you can see above.
>
> > If I try to start the app with all the .htaccess files I getting an
> > "500 server error".
> > To draw a comparison I installed the same app (with all the .htaccess
> > files and commented BASE_URL line) on an testing webserver at an other
> > host. On this host the app is working fine.
>
> > What do you think is the reason for the problem above and how can I
> > solve it?
>
> > Regards,
> > Arndtinho
>
> I recently had the same problem... I think this can help you :
>
> https://trac.cakephp.org/ticket/812
>
> Regards,
>
> --
> Nico
> "Sanctis recorda, sanctis deus rex"


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



Re: Change the Separator Character in the dateTimeOptionTag Output?

2007-05-30 Thread m.sbragi

Ok this is the most simple solution i can think.
echo
str_replace('-','/',$html->dateTimeOptionTag($field,'MDY','NONE',null,array(
),false));
OR 
Write your own helper that extends html and use your own char.
See manual for reference and search on list :)

> -Messaggio originale-
> Da: cake-php@googlegroups.com 
> [mailto:[EMAIL PROTECTED] Per conto di John David 
> Anderson (_psychic_)
> Inviato: giovedì 31 maggio 2007 2.29
> A: cake-php@googlegroups.com
> Oggetto: Re: Change the Separator Character in the 
> dateTimeOptionTag Output?
> 
> 
> 
> On May 30, 2007, at 6:18 PM, Chris Hartjes wrote:
> 
> >
> > On 5/30/07, Wole <[EMAIL PROTECTED]> wrote:
> >>
> >> Bump =)
> >>
> >
> > Bumping posts is bad etiquette on this list.  If someone 
> had an answer 
> > and read your message, they would've answered it.
> 
> Though I don't personally mind a bump if you make an effort 
> to ease the work needed to solve your problem. This can be 
> done in a number of ways:
> 
> 1. Add more detail. Debug output, schema information, code, etc.
> 2. Work on it more, and include what you've tried that also 
> did not work.
> 3. Offer lots of cash.
> 
> But above all, be patient. A bump is akin to the assumption 
> that you're owed a response.
> 
> -- John
> 
> 
> 
> 
> > 


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



R: adding extra fields when reading a model

2007-05-30 Thread m.sbragi

You Have 2 chance to accomplish this task 
1. You can build fake field in your model afterFind() function
function afterFind( $result ) {
  $result = parent::afterFind( $result );
  foreach( $result as $k => $v ) {
$result[$k]['Table']['thumb_url'] = 'thumb_' . @$v['Table']['image'];
  }
  return $result;
}

2. You can build your fake field with findAll
$data = $this->Table->findAll(null, "*, CONCAT('thumb_', image) AS
thumb_url");
die(pr($data));

Attention in case  2 the field is not added in the Table array but in array
apart.
See the pr output
HTH


> -Messaggio originale-
> Da: cake-php@googlegroups.com 
> [mailto:[EMAIL PROTECTED] Per conto di laptop
> Inviato: giovedì 31 maggio 2007 6.51
> A: Cake PHP
> Oggetto: adding extra fields when reading a model
> 
> 
> Hi,
> 
> Is there a way to add a field to a model which is the result 
> of an SQL function. My scenario is that I have an image_url 
> field, the thumb of the image_url is also stored in the same 
> directory with '_thumb'
> appended before the index.
> 
> ie bradcraig.jpg would become bradcraig_thumb.jpg
> 
> Is there a way I can include a SQL function when retrieving 
> the model?? The SQL to calculate it is below..
> 
> SELECT 'images/bradcraig.jpg' AS image_url, 
> CONCAT(SUBSTRING_INDEX('images/bradcraig.jpg', '.', 1), 
> '_thumb.', SUBSTRING_INDEX('images/bradcraig.jpg', '.', -1)) 
> AS thumb_url;
> 
> Thanks
> 
> 
> > 


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



Re: Using a Component in controller->beforeFilter in 1.2

2007-05-30 Thread gwoo

Components help out controllers with common business logic, so first
intialize, then modify in beforeFilter, then startup some automagic.


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



adding extra fields when reading a model

2007-05-30 Thread laptop

Hi,

Is there a way to add a field to a model which is the result of an SQL
function. My scenario is that I have an image_url field, the thumb of
the image_url is also stored in the same directory with '_thumb'
appended before the index.

ie bradcraig.jpg would become bradcraig_thumb.jpg

Is there a way I can include a SQL function when retrieving the
model?? The SQL to calculate it is below..

SELECT 'images/bradcraig.jpg' AS image_url,
CONCAT(SUBSTRING_INDEX('images/bradcraig.jpg', '.', 1), '_thumb.',
SUBSTRING_INDEX('images/bradcraig.jpg', '.', -1)) AS thumb_url;

Thanks


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



using beforeSave() with the blog tutorial

2007-05-30 Thread [EMAIL PROTECTED]

I'm using the blog tutorial to learn everything about CakePHP.  I
finished the tutorial and am just adding bells and whistles to figure
out what things do and I'm having a problem getting beforeSave() to
function:

I have a post controller, model and view and they're all working
fine.  What I wanted to do was just test the beforeSave() function by
overwriting the post message as follows:

function beforeSave() {
$this->data['Post']['body'] = "I've overwritten your post!";
   return true;
}

Shouldn't it be this simple or am I missing something?  This does not
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?hl=en
-~--~~~~--~~--~--~---



HELP: CakePHP & vBulletin

2007-05-30 Thread Alcuadrado

Hi, I'm new here.
I've been reading about cake and it es REALLY interesting for a
project I'm starting...
The problem is that I must do a website integrated with vBulltein
users system. And I guess that I have to use the same session for the
user in the forum and the web. But doesn't cake manage session
automatically? Can I do this website with cake? How? Any advice?


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



Re: cakePHP is slow!

2007-05-30 Thread Chris Hartjes

On 5/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> CakePHP is slow! Well not really... Cake is fine, but I'm a bit slow
> some times. I have seen several people complain about cake speeds, but
> I have never experienced a problem... Till now. Some of them/you may
> have had a bad directory structure. If you are missing the sub folders
> in the app/tmp folder, you will suffer from really slow page requests.
>
> So if your cake app seems really slow, make sure you have the
> following directories:
> app/tmp/cache
> app/tmp/sessions
> app/tmp/logs
> app/tmp/tests
>

Amazing tip!  A nod of my grumpy head to you for pointing this out.

-- 
Chris Hartjes

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

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

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



Re: cakePHP is slow!

2007-05-30 Thread Samuel DeVore
you should make a ticket against the documentation to include the tmp folder
layout as a 'required' thing that really should exist

On 5/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> CakePHP is slow! Well not really... Cake is fine, but I'm a bit slow
> some times. I have seen several people complain about cake speeds, but
> I have never experienced a problem... Till now. Some of them/you may
> have had a bad directory structure. If you are missing the sub folders
> in the app/tmp folder, you will suffer from really slow page requests.
>
> So if your cake app seems really slow, make sure you have the
> following directories:
> app/tmp/cache
> app/tmp/sessions
> app/tmp/logs
> app/tmp/tests
>
> I wonder if anyone has submitted a ticket for this yet?
>
> Following is the unabridged version:
>
> I set up a new site by copying the app folder from another project. I
> did not copy the tmp folder, since I knew it would contain dozens of
> extra files. I manually created the tmp folder but neglected to create
> the necessary sub folders.
>
> I then set about baking some files and creating some new layouts. When
> I tried out the app a couple days later, it was slow. Really SLOW!
> Even simple page loads that didn't access the database would take > 3
> seconds.
>
> So I started tearing everything down... removing components and
> helpers and elements... Nothing helped. Then I did what I should have
> done to begin with; I baked a whole new project (I love the new bake
> console in 1.2.0.5xxx). I then moved my files over one at a time. I
> had everything copied and my load time was still < 0.15. So I used win
> merge to compare the two app directories and the I saw the missing tmp
> folders in the old app folder. Like I said, I'm a bit slow some times.
>
> The moral of the story:
> Always bake your cake!
>
>
> >
>


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

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

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

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



Re: cakePHP's cache

2007-05-30 Thread Samuel DeVore
very often when you decompress files empty folders are not created, you
should make sure that the folder layout for the tmp folder is complete and
writable by the web server


On 5/30/07, shifaz <[EMAIL PROTECTED]> wrote:
>
>
> The views folder was not there under tmp/cache. After i created it,
> now it works like a charm. thanks
>
> On May 31, 5:11 am, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> > tmp/caches/view
> >
> > On 5/30/07, shifaz <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > can anyone explain to me where cakePHP stores its view caches?
> >
> > --
> > (the old fart) the advice is free, the lack of crankiness will cost you
> >
> > - its a fine line between a real question and an idiot
> >
> > http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
>
>
> >
>


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

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

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

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



cakePHP is slow!

2007-05-30 Thread [EMAIL PROTECTED]

CakePHP is slow! Well not really... Cake is fine, but I'm a bit slow
some times. I have seen several people complain about cake speeds, but
I have never experienced a problem... Till now. Some of them/you may
have had a bad directory structure. If you are missing the sub folders
in the app/tmp folder, you will suffer from really slow page requests.

So if your cake app seems really slow, make sure you have the
following directories:
app/tmp/cache
app/tmp/sessions
app/tmp/logs
app/tmp/tests

I wonder if anyone has submitted a ticket for this yet?

Following is the unabridged version:

I set up a new site by copying the app folder from another project. I
did not copy the tmp folder, since I knew it would contain dozens of
extra files. I manually created the tmp folder but neglected to create
the necessary sub folders.

I then set about baking some files and creating some new layouts. When
I tried out the app a couple days later, it was slow. Really SLOW!
Even simple page loads that didn't access the database would take > 3
seconds.

So I started tearing everything down... removing components and
helpers and elements... Nothing helped. Then I did what I should have
done to begin with; I baked a whole new project (I love the new bake
console in 1.2.0.5xxx). I then moved my files over one at a time. I
had everything copied and my load time was still < 0.15. So I used win
merge to compare the two app directories and the I saw the missing tmp
folders in the old app folder. Like I said, I'm a bit slow some times.

The moral of the story:
Always bake your cake!


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



Strange DB problem - savefield fails when field name changes

2007-05-30 Thread C. Ashcraft

Hi All,

This is my first project with CakePHP, so I could be doing something
really stupid, but I'm having a really bizarre DB issue. I can't seem
to save to fields added to the database after I baked the scaffolding
for my application. For instance, if WML is an original column, and
ALRT is a new column, $this->Alert->savefield("ALRT", $Alert-
>generateCAP()); will fail, and $this->Alert->savefield("WML", $Alert-
>generateCAP()); will succeed. I'm pretty sure that I'm making a
stupid mistake somewhere, but I'm not quite sure where. Any
suggestions? Thanks!

Cheers,
Cole


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



Re: cakePHP's cache

2007-05-30 Thread shifaz

The views folder was not there under tmp/cache. After i created it,
now it works like a charm. thanks

On May 31, 5:11 am, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> tmp/caches/view
>
> On 5/30/07, shifaz <[EMAIL PROTECTED]> wrote:
>
>
>
> > can anyone explain to me where cakePHP stores its view caches?
>
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/


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



Re: Change the Separator Character in the dateTimeOptionTag Output?

2007-05-30 Thread John David Anderson (_psychic_)


On May 30, 2007, at 6:18 PM, Chris Hartjes wrote:

>
> On 5/30/07, Wole <[EMAIL PROTECTED]> wrote:
>>
>> Bump =)
>>
>
> Bumping posts is bad etiquette on this list.  If someone had an answer
> and read your message, they would've answered it.

Though I don't personally mind a bump if you make an effort to ease  
the work needed to solve your problem. This can be done in a number  
of ways:

1. Add more detail. Debug output, schema information, code, etc.
2. Work on it more, and include what you've tried that also did not  
work.
3. Offer lots of cash.

But above all, be patient. A bump is akin to the assumption that  
you're owed a response.

-- John




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



Re: Help: Ajax ( Iframe ) Upload

2007-05-30 Thread Chris Hartjes

On 5/30/07, 浪漫様 <[EMAIL PROTECTED]> wrote:
>
> Can somebody place the code??... This is the code I use to Update the
> user's profile... now I want to do the code to Upload the user's
> picture with AJAX+Iframe. Thank you
>

http://groups.google.com/group/cake-php/browse_thread/thread/fca8c28837ae3f6e/0cf3916d62427d10?lnk=gst&q=ajax&rnum=9

I suggest searching on google as well.

Hope that helps.

-- 
Chris Hartjes

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

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

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



Re: Change the Separator Character in the dateTimeOptionTag Output?

2007-05-30 Thread Chris Hartjes

On 5/30/07, Wole <[EMAIL PROTECTED]> wrote:
>
> Bump =)
>

Bumping posts is bad etiquette on this list.  If someone had an answer
and read your message, they would've answered it.

-- 
Chris Hartjes

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

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

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



Re: Change the Separator Character in the dateTimeOptionTag Output?

2007-05-30 Thread Wole

Bump =)

On May 28, 4:28 pm, Wole <[EMAIL PROTECTED]> wrote:
> Is there a way to change the separator character that appears between
> the drop down lists in the dateTimeOptionTag output? The separator
> character is currently '-' and I want to change it to '/'. Also, is
> there a way to add a space between the year drop down list and the
> hour drop down list? I know I can achieve the result I'm looking for
> by using the dayOptionTag, monthOptionTag, etc and adding the
> separator I want but I was just wondering of there is a quicker way.
> Thanks.


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



Re: cakePHP's cache

2007-05-30 Thread Samuel DeVore
tmp/caches/view


On 5/30/07, shifaz <[EMAIL PROTECTED]> wrote:
>
>
> can anyone explain to me where cakePHP stores its view caches?
>
>
> >
>


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

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

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

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



Re: Paginator and custom routes problem (latest 1.2 alpha)

2007-05-30 Thread Mirko

I have exactly the same problem.
All I get is a link with nothing but controller name in it: 

Greets, Mirko


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



Help: Ajax ( Iframe ) Upload

2007-05-30 Thread 浪漫様

Dear Bakers,
I'm creating a personal blog with registered users. I want the users
to be able to modify their profile anywhere in the site using Ajax...
In the blog, there is a column showing the User's Profile on a 
By the moment I could succesfully do that they change their display
information and password with Ajax... but the problem is to change the
user's picture... I had been reading about it in this forum, and I
could understand that AJAX can't do the Upload itself, and an IFRAME
is needed... just my doubt is... if I modify  inside
the blog page to display the view with AJAX that has to upload the
photo... and I place an IFRAME there... how to do it for the AJAX view
to know that the photo in the IFRAME was uploaded and then modify the
blog page's  to show the updated user profile??...
Can somebody place the code??... This is the code I use to Update the
user's profile... now I want to do the code to Upload the user's
picture with AJAX+Iframe. Thank you

--
That's the blog's view part where the Profile Information is displayed
--

  image('ajax.gif',
array('border'=>"0",'align'=>"absmiddle")).' '.$lgloading; ?>Element.hide("ajaxicon");
  
User Profile

  
image('colegas/'.$colega['Colega']['icono'],
array('border'=>'0','align'=>'absmiddle')); ?>


  
  link('Edit Profile','../colegas/
perfil',array('update'=>'profile','loading'=>'Element.show("ajaxicon");','complete'=>'Element.hide("ajaxicon");stripe();'));
 ?
>
  link('Change photo','../colegas/
foto',array('update'=>'profile','loading'=>'Element.show("ajaxicon");','complete'=>'Element.hide("ajaxicon");stripe();'));
 ?
>
  
  
  

  

  

 

--
That's the part of the controller that edit the profile * NO PHOTO
--
function perfil()
{
  $this->set('idioma',$this->Session->read('idioma'));
  $this->userprofile();
  if($this->data)
  {
$this->data['Colega']['id'] = $this->Session->read('colega');
$this->Colega->save($this->data);
$this->redirect('colegas/refrescar); // This is to refresh the

  }
  else
  {
$result = $this->Colega->findById($this->Session-
>read('colega'));
$this->set('colega',$result);
  }
}

--
That's the view with AJAX to edit the Profile * NO PHOTO
--
link('prototype'); ?>



  
image('colegas/'.$colega['Colega']['icono'],
array('border'=>'0','align'=>'absmiddle')); ?>


  

  Name: input('Colega/nombre', array('value'=>$colega['Colega']['nombre'])) ?
>
  Password: input('Colega/password', array('value'=>$colega['Colega']
['password'])) ?>
  Email: input('Colega/email', array('value'=>$colega['Colega']['email'])) ?>
  
  submit('Update',array('url'=>'','update'=>'profile','loading'=>'Element.show("ajaxicon");','complete'=>'Element.hide("ajaxicon");stripe();'));
> ?
>
  submit('Cancel',array('url'=>'../colegas/
refrescar,'update'=>'profile','loading'=>'Element.show("ajaxicon");','complete'=>'Element.hide("ajaxicon");stripe();'));
 ?
>

  

  



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



Re: Using a Component in controller->beforeFilter in 1.2

2007-05-30 Thread Sarek

Well that's what ticket #2667 is saying. It's just that to me it
sounds like startup() is pretty important to get done before using the
component. But that's just based on the function name. Who know it
could be a leftover relic. Would like to understand a bit more about
it before I do anything on my own or just know that I shouldn't be
using components inside beforeFilter. :)


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



View this page "Cake Apps/Sites In The Wild"

2007-05-30 Thread shifaz

Jazeera Daily is a local news website created with cakePHP.

Click on http://groups.google.com/group/cake-php/web/cake-apps-sites-in-the-wild
- or copy & paste it into your browser's address bar if that doesn't
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?hl=en
-~--~~~~--~~--~--~---



cakePHP's cache

2007-05-30 Thread shifaz

can anyone explain to me where cakePHP stores its view caches?


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



Re: Select database at the model level per request?

2007-05-30 Thread davo

Thanks for the suggestion francky06l - $useDbConfig was the most
obvious solution i could see as well... the only problem is that we've
got about 400 clients and they get added/deleted dynamically, so it's
going to be a hell of a big config file. Also we'll probably have
joins between the master & client databases which $useDbConfig is
going to have trouble with (we're stuck on MySQL4 until everything's
migrated so we don't have the luxury of views). Ideally we want to get
the db name into the actual query, like 'select star from
my_app_customer_x.daily_hits' if that makes sense, then we don't need
to mess around with the actual connection too much.

Samuel, can the persistent connection thing can be set in the database
config file?

On May 30, 6:21 pm, francky06l <[EMAIL PROTECTED]> wrote:
> You could setup different database into the config.php, and set the
> $useDbConfig to point to the desired database into the model. After
> login, if all models are use the same DB you can put this into the
> app_model.php.
>
> On May 30, 11:07 am, davo <[EMAIL PROTECTED]> wrote:
>
> > Hi Guys,
>
> > We're trying to introduce cake into an existing php app, with the aim
> > of gradually porting the old legacy spaghetti code into cake. We have
> > to add some new features so this seems like a good time to start
> > migrating.
>
> > A bit of background - the application has a single 'master' database
> > that holds login and profile information. Each user belongs to a
> > 'profile' (basically a customer) with their own database, so after the
> > initial login they use their own separate database for customer-
> > specific data like crm, stats etc. So for example, if i am customer_x,
> > i might login using a master database called 'my_app', then after i'm
> > logged in use a database called 'my_app_customer_x'. I will still use
> > the master 'my_app' database for some things, such as user
> > administration etc.
>
> > The problem I'm running into is this - depending on the user's
> > 'profile' the model needs to use a different database. I can get the
> > name of the database i want inside the model, but i can't figure out
> > how to use it.
>
> > I have overcome a similar problem before with rails by setting the
> > table_prefix in the model to the database name (yes very hacky!), so
> > for a 'daily_stats' model for 'customer_x', the model name is set to
> > 'my_app_customer_x.daily_stats' at runtime, which works fine with
> > mysql.
>
> > This hack doesn't work at all in cake because the model keeps a list
> > of it's tables (in $db->listSources() i think), and i am banging my
> > head against the wall trying to think of a clean way to do this. I
> > don't care about any DB except MySQL if that makes any difference.
> > We'd like to avoid doing a separate mysql connection per request if
> > possible, because we tried that before with rails and it brought the
> > DB server down pretty quickly under load.
>
> > I hope you guys & gals can follow what i'm getting at - any & all help
> > would be greatly appreciated!
>
> > thanks
>
> > dave


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



Re: Upload a File with CakePHP 1.2.0.5137alpha

2007-05-30 Thread Andrea

Very good information!
I see the two different links but I don't understand quite weel how I
can use it.

Can you give some instructions?

Thanks a lot!

bye

Andrea

P/D: I'm an Italian speaker...

On 30 Mag, 15:51, dardosordi <[EMAIL PROTECTED]> wrote:
> Hi Andrea,
>
> I'm using this for file uploading in 1.2 an works like a charm
>
> http://bin.cakephp.org/saved/17539
>
> Here is how it works:
>
> http://blog.chris-partridge.info/2007/03/16/uploadbehavior-is-here/
>
> Hope it helps.
>
> P/D: Are you spanish speaker?
>
> On May 29, 1:48 pm, Andrea <[EMAIL PROTECTED]> wrote:
>
> > Hi to everybody!
> > I want to upload a file that I choose from a field of a form. How can
> > I do this action?
> > With the previous stable Version of Cake I do this, with the aid of
> > this extension:http://www.reversefolds.com/articles/show/filehandler
> > With this new version the controller always say to me that I don't
> > give to it the file.
>
> > In particular I want to upload an image.
>
> > Help me, please :D
>
> > Thanks
>
> > Ps. Sorry for my bad English!


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



Re: using uuid component to create id's into my model

2007-05-30 Thread Langdon Stevenson

Interesting solution.  I have been generating UUIDs in PHP for one of my 
projects as my ISP only offers MySQL 4.x.

Regards,
Langdon


Divagater wrote:
> I use database triggers to handle writing UUID's for all of my id's.
> This is not a PHP solution and may or may not be appropriate for
> scalability across a wide range of databases. In MySQL a trigger to to
> add a UUID as the id of a particular table would look like this:
> 
> CREATE TRIGGER `posts_id` BEFORE INSERT ON `posts` FOR EACH ROW SET
> NEW.id = UUID();
> 
> Cheers,
> Divagater

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



Re: How to enable a CSV webservice?

2007-05-30 Thread kionae

It actually seems to work just fine either way in IE and FireFox.  I
only have them after the foreach because for some reason it wasn't
playing nice with Safari when I had the header() calls first (and
Safari is the browser of choice for a lot of people in my company, so
it HAS to work there first and foremost).  Damned if I know why,
though.

-Kionae



On May 29, 3:58 pm, "Gonzalo Servat" <[EMAIL PROTECTED]> wrote:
> On 5/29/07, Howard Glynn <[EMAIL PROTECTED]> wrote:

> klonae: just wondering, shouldn't the header() calls be made just before the
> foreach begins?
>
> - Gonzalo


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



Re: Config CORE_PATH error?

2007-05-30 Thread gwoo

looks like your vendor library is using a function that does not exist
on your other servers php install


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



Re: Using a Component in controller->beforeFilter in 1.2

2007-05-30 Thread gwoo

Probably need to change startup to initialize


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



Re: cakephp mssql_dbo.php not working properly

2007-05-30 Thread bingo

hi Joshua,

$user_id = $this->params['form']['user_id'];
$role = $this->params['form']['role'];
if(empty($user_id)){
$this->set('failed', "Error: no user id found");
}else{

$criteria = array("UsersWorkspace.user_id" => 
"{$user_id}");
if(!empty($role) && in_array($role, array('creator', 
'observer')))
$criteria['UsersWorkspace.role'] = $role;

$fields = array('Workspace.id', 'Workspace.title',
'UsersWorkspace.role');

$this->Workspace->recursive = 2;
$this->Workspace->expects("UsersWorkspace");
$this->set('data', $this->Workspace->findAll($criteria,
$fields));
}

here is the snippet of code that produced the above ouput..i have
three tables
Workspaces ---> has many ---> artifacts_workspaces  and
artifacts_workspaces --> belongsTo -->Workspaces
artifacts ---> hasMany ---> artifacts_workspaces and
artifacts_workspaces --> belongsTo --> artifacts
workspaces <-- HABTM ---> artifacts

can you tell me more on how you are connecting to MSSQL..are you using
cakephp mssql_dbo.php class or something different

Regards,
Ritesh


On May 30, 12:02 pm, Joshua Benner <[EMAIL PROTECTED]> wrote:
> We use MSSQL when working with CakePHP 1.2 here, and I've never seen
> Cake output any SQL like that. Can you send some details about your
> model(s), etc?
>
> We run PHP 5.1 on Linux and connect to MSSQL using ODBTP-overrided PHP
> mssql extension functions, so our database setup looks like this:
>
> var $default = array('driver' => 'mssql',
> 'connect' => 'mssql_connect',
> 'host' => 'server',
> 'login' => 'user',
> 'password' => 'password',
> 'database' => 'db',
> 'prefix' => '');
>
> bingo wrote:
> > hi,
>
> > at my workplace, we are using MSSQL server. I have never used cakephp
> > with MSSQL before and this the first time I am using. I am using
> > CakePHP 1.2 on PHP 5.1. Although, I am able to connect to database, I
> > am not able query the data. The search query created by the
> > mssql_dbo.php looks funny and wrong..here is a sample search query
>
> > SELECT [Workspace].[id] AS [Workspace__id] AS [Workspace]__[id] AS
> > [Workspace__id] AS [Workspace]__[id] AS [Workspace__id] AS
> > [Workspace]__[id] AS [Workspace__id], [Workspace].[title] AS
> > [Workspace__title] AS [Workspace]__[title] AS [Workspace__title] AS
> > [Workspace]__[title] AS [Workspace__title] AS [Workspace]__[title] AS
> > [Workspace__title], [UsersWorkspace].[role] AS [UsersWorkspace__role]
> > AS [UsersWorkspace]__[role] AS [UsersWorkspace__role] AS
> > [UsersWorkspace]__[role] AS [UsersWorkspace__role] AS
> > [UsersWorkspace]__[role] AS [UsersWorkspace__role], [Workspace].[id]
> > AS [Workspace__id] AS [Workspace]__[id] AS [Workspace__id],
> > [Workspace].[id] AS [Workspace__id] FROM [srs_workspaces] AS
> > [Workspace] WHERE [UsersWorkspace].[user_id] = '2'
>
> > There are two problems
> > 1. all the fields are getting repeated
> > 2. Association is not working..
>
> > Is there other way to get MSSQL working with CakePHP


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



Re: SWFupload for cake1.2

2007-05-30 Thread msajpm

>
> Hopefully someone finds it useful.
> --
> Siegfried

Thanks Siegfried.
Just begining to use cakePHP and I was having a long time trying to
modify it by myself to use with 1.2.

I have two a questions.

I`m able to upload files using normal file tags but not swf way. Could
you use the swf way?

I have php.ini with a max_upload_file of 2M. When a try to upload
files between 2MB and aprox. 8MB I get the error saying that the files
exceded the maximus size but with files bigger thab 8MB I don't even
have a data array in the controller and nither error messages. Does it
happen to you too?


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



Re: data from model in a layout via pagescontroller

2007-05-30 Thread [EMAIL PROTECTED]

oops

On 30 mei, 21:51, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Dear List,
>
> Very new to cake, but learning the API way :-) I am using v1.2 and am
> creating a website for my girlfriend's ratshelter ;-) Well, rather
> rebuilding from a previous site.


> Can anyone tell me how to get the info from my Location Model in a
> default layout? Or am I missing the obvious?
>
> Thanks,
> Paul

I did search the archives, but now I stumbled upon the  "Frequent
Discussions" page on the gg page. I think I will give it a try. Or
is this a bad idea? ;-)

Thanks so far!
Paul


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



Using a Component in controller->beforeFilter in 1.2

2007-05-30 Thread Sarek

While this affects me trying to use the CookieComponent in the
controller->beforeFilter function this appears to me to affect any
component that needs to have it's startup function called before it's
used and you need to access the component in beforeFilter.

I am attempting to check for a cookie in the beforeFilter function of
the controller using the CookieComponent. Doing this based on previous
posts I've read for keeping a user logged in between visits.

What I have found is that controller->beforeFilter is called before
the components get their startup() functions called so the
CookieComponent doesn't get it's values setup correctly to access the
correct cookies.

You can see this code in dispatcher.php line 379 (from the 5-29
nightly build)

My first thought was to move the controller->beforeFilter call to
after the components loop but since I really don't know what that
could potentially break I thought better of it.

Maybe there's a better way to do what I'm attempting but it seems to
me that you'd need full access to your components inside of
beforeFilter.

I did see ticket #2667 that is pertaining to the same thing as this.
My thought though is that having the function called startup() makes
me things it needs to be called before the component is used so maybe
that ticket isn't the best solution.


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



Re: Documenting lessons learned...

2007-05-30 Thread Jon Bennett

> So I have been working on a installation of a client site that is in a low
> budget shared hosting environment (dreamhost) and have been working to make
> the app live a little better there, I am planning on writing up some of the
> lessons that I have learned and some things that might help others down the
> road.  A case study perhaps, my plan is to submit it to the Bakery when I am
> done, but was wondering if anyone might be interested in collaborating on
> such a document.  Or might have some lessons that they have learned that
> they would like to have included.   If so please reply off list in
> interested in collaborating or giving some insight.

not much help, but I have a number of cake sites hosted on dreamhost
and all run really well. If the server is running slow, ask support to
move you to a less crowded one, they are very obliging :)

The one thing I would always do is add:


mod_gzip_on Yes
mod_gzip_dechunk Yes


to my webroot .htaccess file, speeds things up no end.

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



Re: Pretty URL's

2007-05-30 Thread Nicolas Rimbeau

On 5/31/07, Arndtinho <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I have some problems with pretty url's. Following the domain name you
> can see "index.php" e.g.
>
> http://www.mydomain.de/index.php/main/index
>
> On my local machine (WinXP, Apache2, mod_rewrite is enabled) works the
> app without any problems. But on the webserver I get this problems. I
> don't have permissons to change the httpd.conf.
>
> What I did:
> - uploaded the app on the server,
> - deleted the .htaccess files in
>
> /appdir
> /appdir/app
> /appdir/app/webroot
>
> - and uncommented the BASE_URL line. The result you can see above.
>
> If I try to start the app with all the .htaccess files I getting an
> "500 server error".
> To draw a comparison I installed the same app (with all the .htaccess
> files and commented BASE_URL line) on an testing webserver at an other
> host. On this host the app is working fine.
>
> What do you think is the reason for the problem above and how can I
> solve it?
>
> Regards,
> Arndtinho
>
>
> >
>


I recently had the same problem... I think this can help you :

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

Regards,


-- 
Nico
"Sanctis recorda, sanctis deus rex"

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



data from model in a layout via pagescontroller

2007-05-30 Thread [EMAIL PROTECTED]

Dear List,

Very new to cake, but learning the API way :-) I am using v1.2 and am
creating a website for my girlfriend's ratshelter ;-) Well, rather
rebuilding from a previous site.

Most of the static informational pages I serve via the pages
controller /pages/blahblah. I use a simple 3 column layout with the
main content in the middle. Now I want to be able to inlcude data from
a model in my layout, so that it is available in all pages in the
right column.

So I thought I'd make a helper:

class LocHelper extends Helper {
var $helpers = array( 'Html' );
var $uses= array( 'Location' );

function locationList() {
$ret = Location::findAll();
return $this->output(print_r($ret, true) );
}
}

Abbreviated for testing purposes.

I thought I'd use this in the layout file as folows:

echo $Loc->locationList();

(I included the helper in the $helpers array in my AppController)

But I get the following error when viewing the page: Fatal error: Call
to a member function on a non-object in my default.thtml file in my
app directory.

I am stuck. Took a while to figure out if and when to use helpers or
elements. Still not sure what the preferred way is to have a "module-
like" page with information in one layout/view from several models.
But I thought I'd figure this one out first :-)

Can anyone tell me how to get the info from my Location Model in a
default layout? Or am I missing the obvious?

Thanks,
Paul


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



Documenting lessons learned...

2007-05-30 Thread Samuel DeVore
So I have been working on a installation of a client site that is in a low
budget shared hosting environment (dreamhost) and have been working to make
the app live a little better there, I am planning on writing up some of the
lessons that I have learned and some things that might help others down the
road.  A case study perhaps, my plan is to submit it to the Bakery when I am
done, but was wondering if anyone might be interested in collaborating on
such a document.  Or might have some lessons that they have learned that
they would like to have included.   If so please reply off list in
interested in collaborating or giving some insight.

Thanks
Sam D

sdevore at gmail dot com

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

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

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

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



Re: Does cake cache plugins

2007-05-30 Thread Davide
Samuel DeVore wrote:
> request the page once...  (see if it shows up in the caches/view folder
> in temp

I thought that too and no page in app/tmp/cache/views.


It comes in my mind: "Luke, use the source"... But if someone else has
an answer that can avoid me the source :)

Thanks
Davide




signature.asc
Description: OpenPGP digital signature


Re: debugging methods with cakePHP

2007-05-30 Thread Joshua Benner

Ita,

I tried Zend, but couldn't get it to work properly on my server. I ended 
up using Xdebug ( http://xdebug.org ) and the experimental Xdebug 
integration plugin for PDT ( 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=169408 ). There are a 
couple excellent guides to getting it running:

http://www.starbowconsulting.com/blog/tao/setting-eclipse-pdt-and-xdebug

http://www.inkompetent.se/wiki/php/remote_debugging_with_pdt_and_xdebug

Ita wrote:
> Hi,
> I'm trying to find my way around cake and having trouble as I'm new to
> it.
> I'm trying to find debug methods to debug the application I'm
> building.
>
> So far I installed xampp and the zend debugger so the phpinfo show:
>
> Expose Zend Debugger  always
> Passive Mode Timeout  20 seconds
>
> Directive Local Value Master Value
> zend_debugger.allow_hosts 127.0.0.1   127.0.0.1
> zend_debugger.allow_tunnelno valueno value
> zend_debugger.connect_passwordno valueno value
> zend_debugger.connector_port  10013   10013
> zend_debugger.deny_hosts  no valueno value
> zend_debugger.httpd_uid   -1  -1
> zend_debugger.max_msg_size2097152 2097152
>
> To develop and debug I use eclipse pdt all in one.
>
> next I was able to debug a single page php application(not cake
> related) , but I put a breakpoint in one of the cake controllers it
> never stops there.
>
> What I'm asking is does anyone uses the eclipse PTD to develop in
> cake?
> If so how do I debug 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?hl=en
-~--~~~~--~~--~--~---



Re: cakephp mssql_dbo.php not working properly

2007-05-30 Thread Joshua Benner

We use MSSQL when working with CakePHP 1.2 here, and I've never seen 
Cake output any SQL like that. Can you send some details about your 
model(s), etc?

We run PHP 5.1 on Linux and connect to MSSQL using ODBTP-overrided PHP 
mssql extension functions, so our database setup looks like this:

var $default = array('driver' => 'mssql',
'connect' => 'mssql_connect',
'host' => 'server',
'login' => 'user',
'password' => 'password',
'database' => 'db',
'prefix' => '');

bingo wrote:
> hi,
>
> at my workplace, we are using MSSQL server. I have never used cakephp
> with MSSQL before and this the first time I am using. I am using
> CakePHP 1.2 on PHP 5.1. Although, I am able to connect to database, I
> am not able query the data. The search query created by the
> mssql_dbo.php looks funny and wrong..here is a sample search query
>
> SELECT [Workspace].[id] AS [Workspace__id] AS [Workspace]__[id] AS
> [Workspace__id] AS [Workspace]__[id] AS [Workspace__id] AS
> [Workspace]__[id] AS [Workspace__id], [Workspace].[title] AS
> [Workspace__title] AS [Workspace]__[title] AS [Workspace__title] AS
> [Workspace]__[title] AS [Workspace__title] AS [Workspace]__[title] AS
> [Workspace__title], [UsersWorkspace].[role] AS [UsersWorkspace__role]
> AS [UsersWorkspace]__[role] AS [UsersWorkspace__role] AS
> [UsersWorkspace]__[role] AS [UsersWorkspace__role] AS
> [UsersWorkspace]__[role] AS [UsersWorkspace__role], [Workspace].[id]
> AS [Workspace__id] AS [Workspace]__[id] AS [Workspace__id],
> [Workspace].[id] AS [Workspace__id] FROM [srs_workspaces] AS
> [Workspace] WHERE [UsersWorkspace].[user_id] = '2'
>
> There are two problems
> 1. all the fields are getting repeated
> 2. Association is not working..
>
> Is there other way to get MSSQL working with CakePHP
>
>
> >
>   

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



hasMany findAll alternatives

2007-05-30 Thread uolax

Thanks so much for any time with this:

Forest->hasMany->Trees
trees->belongsTo->Forest

I want to:
find the forests that only have trees that are brown, (each tree can
only belong to one forest)
list the other trees in those respective forest,
and don't list forests that have no brown trees all from the
forests_controller.

Obviously I can't use the $conditions[trees][treecolor] = 'brown' in
the findAll method as hasMany doesn't seem to be a true joing.

I've unsuccesfully tried Bind/Unbind in the Forest Controller, setting
the conditions -> 'trees.treecolor = brown' while still using hasMany.
However, this still returns ALL forests but hides the associated data
that doesn't meet the condition.

I'm thinking maybe switching this relationship to HABTM using the
hasOne/belongsTo on a join table trick, but that seems like overkill
as each tree can only belong to one forest even though multiple trees
may be brown.

...would the best way to do this be a HABTM table in a quick bind/
unbind in the controller?

Any help would be great.

Thanks,
Beau


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



Re: gmailer and CakePHP

2007-05-30 Thread DanielSun

so you think the whole thing should work with Cake autoSession TRUE?

ad2. With such code I only get "1" returned. I'am not sure that the
above usage of the class is correct. Can anyone confirm?


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



Pretty URL's

2007-05-30 Thread Arndtinho

Hello,

I have some problems with pretty url's. Following the domain name you
can see "index.php" e.g.

http://www.mydomain.de/index.php/main/index

On my local machine (WinXP, Apache2, mod_rewrite is enabled) works the
app without any problems. But on the webserver I get this problems. I
don't have permissons to change the httpd.conf.

What I did:
- uploaded the app on the server,
- deleted the .htaccess files in

/appdir
/appdir/app
/appdir/app/webroot

- and uncommented the BASE_URL line. The result you can see above.

If I try to start the app with all the .htaccess files I getting an
"500 server error".
To draw a comparison I installed the same app (with all the .htaccess
files and commented BASE_URL line) on an testing webserver at an other
host. On this host the app is working fine.

What do you think is the reason for the problem above and how can I
solve it?

Regards,
Arndtinho


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



Re: Does cake cache plugins

2007-05-30 Thread Samuel DeVore
request the page once...  (see if it shows up in the caches/view folder in
temp

if yes then toss a superfluous
die( "Woops no Cache used");
in that view or controller action and request the page again.  If you get
back the page fine they I bet you got the cached one,  if you see your die
statement well, I bet you can guess ;)

Sam D

On 5/30/07, Chris Hartjes <[EMAIL PROTECTED]> wrote:
>
>
> On 5/30/07, Davide <[EMAIL PROTECTED]> wrote:
> >
> > Chris Hartjes wrote:
> > > As far as I know (I know I will be corrected if I am wrong) caching
> > > will only occur if you have debug set to 0.
> >
> > Maybe right but there's no mention of that in the manual. If true, how
> can
> > I check for cache working?
> >
>
> That's a good question...one people smarter than me will have to tell
> you.  In terms of testing, I guess the best way is to have your RSS
> feed spit out some time-specific info and if that info doesn't change,
> it's caching! ;)
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark - http://www.littlehart.net/attheballpark
> @TheKeyboard - http://www.littlehart.net/atthekeyboard
>
> >
>


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

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

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

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



Re: Select database at the model level per request?

2007-05-30 Thread Samuel DeVore
and again make sure you are not using a persistant db connection

On 5/30/07, francky06l <[EMAIL PROTECTED]> wrote:
>
>
> You could setup different database into the config.php, and set the
> $useDbConfig to point to the desired database into the model. After
> login, if all models are use the same DB you can put this into the
> app_model.php.
>
> On May 30, 11:07 am, davo <[EMAIL PROTECTED]> wrote:
> > Hi Guys,
> >
> > We're trying to introduce cake into an existing php app, with the aim
> > of gradually porting the old legacy spaghetti code into cake. We have
> > to add some new features so this seems like a good time to start
> > migrating.
> >
> > A bit of background - the application has a single 'master' database
> > that holds login and profile information. Each user belongs to a
> > 'profile' (basically a customer) with their own database, so after the
> > initial login they use their own separate database for customer-
> > specific data like crm, stats etc. So for example, if i am customer_x,
> > i might login using a master database called 'my_app', then after i'm
> > logged in use a database called 'my_app_customer_x'. I will still use
> > the master 'my_app' database for some things, such as user
> > administration etc.
> >
> > The problem I'm running into is this - depending on the user's
> > 'profile' the model needs to use a different database. I can get the
> > name of the database i want inside the model, but i can't figure out
> > how to use it.
> >
> > I have overcome a similar problem before with rails by setting the
> > table_prefix in the model to the database name (yes very hacky!), so
> > for a 'daily_stats' model for 'customer_x', the model name is set to
> > 'my_app_customer_x.daily_stats' at runtime, which works fine with
> > mysql.
> >
> > This hack doesn't work at all in cake because the model keeps a list
> > of it's tables (in $db->listSources() i think), and i am banging my
> > head against the wall trying to think of a clean way to do this. I
> > don't care about any DB except MySQL if that makes any difference.
> > We'd like to avoid doing a separate mysql connection per request if
> > possible, because we tried that before with rails and it brought the
> > DB server down pretty quickly under load.
> >
> > I hope you guys & gals can follow what i'm getting at - any & all help
> > would be greatly appreciated!
> >
> > thanks
> >
> > dave
>
>
> >
>


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

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

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

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



Re: gmailer and CakePHP

2007-05-30 Thread gwoo

you probably have some extraneous whitspace in code.


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



gmailer and CakePHP

2007-05-30 Thread DanielSun

Has anyone ever tried to use Gmailer class in a CakePHP framework? It
seems a very usable lib, but I just can't make it work inside Cake.
I simply include it on the beginning of the controller like so:
   var $uses = array('Email','GMailer');
//Email being my standard cntrlr class just for the sake of leaving
GMailer untouched

And it seems to work as I get connected to gmail successfully, but I
recieve a Notice:
A session had already been started - ignoring session_start() in C:
\NETbuild\eMama\app\models\g_mailer.php on line 514

I have then disabled the Cake auto Session in core.php config file and
there is no notice anymore.
1. question:
 - how and IF am I able to integrate the Gmailer session into Cake
session

2. question:
- How do I even get Gmailer to spit out the fetched? Is this the way:

//controller:

if ($gmailer->created) {
   $gmailer->setLoginInfo('user.login', 'password', '1');
   if ($gmailer->connect()) {
 echo "GMailer connected to Gmail
successfully.";
   // Do something with it.

   $gmail_posts=$gmailer-
>fetchBox(GM_STANDARD,'inbox',1);

$this->set('posts', $gmail_posts);
  }
}

//view
a loop that outputs $posts object


for a reference, here is the source on-line
http://gmail-lite.sourceforge.net/wordpress/docs/1.0.0-alpha/GMailer/GMailer.html


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



cakephp mssql_dbo.php not working properly

2007-05-30 Thread bingo

hi,

at my workplace, we are using MSSQL server. I have never used cakephp
with MSSQL before and this the first time I am using. I am using
CakePHP 1.2 on PHP 5.1. Although, I am able to connect to database, I
am not able query the data. The search query created by the
mssql_dbo.php looks funny and wrong..here is a sample search query

SELECT [Workspace].[id] AS [Workspace__id] AS [Workspace]__[id] AS
[Workspace__id] AS [Workspace]__[id] AS [Workspace__id] AS
[Workspace]__[id] AS [Workspace__id], [Workspace].[title] AS
[Workspace__title] AS [Workspace]__[title] AS [Workspace__title] AS
[Workspace]__[title] AS [Workspace__title] AS [Workspace]__[title] AS
[Workspace__title], [UsersWorkspace].[role] AS [UsersWorkspace__role]
AS [UsersWorkspace]__[role] AS [UsersWorkspace__role] AS
[UsersWorkspace]__[role] AS [UsersWorkspace__role] AS
[UsersWorkspace]__[role] AS [UsersWorkspace__role], [Workspace].[id]
AS [Workspace__id] AS [Workspace]__[id] AS [Workspace__id],
[Workspace].[id] AS [Workspace__id] FROM [srs_workspaces] AS
[Workspace] WHERE [UsersWorkspace].[user_id] = '2'

There are two problems
1. all the fields are getting repeated
2. Association is not working..

Is there other way to get MSSQL working with CakePHP


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



Re: Login On Home Page

2007-05-30 Thread jjw


[EMAIL PROTECTED] wrote:
> I made myself a fancy home.thtml and put it in /views/pages/
> home.thtml.  I'm scratching my head trying to figure out what
> controller goes to it.  I tried to use
>
> function home() in pages_controller.php but it didn't work.  Should I
> make a custom controller and use routing to / instead?

I had this same question.  Here is what my pages_controller.php looks
like:


render('home');
}
}
?>


Kinda weird that for / it calls display() instead of home() or index().


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



Config CORE_PATH error?

2007-05-30 Thread joe

Hi,

I am trying to move Cake and my app from one server to another on
CentOS release 5 (RH).

I think that mod_rewrite is working (moved from apache1.x to 2.x also)
but get the following error when going to the host url, (Document Root
has been set to /var/www/html//app/webroot) ...

Date(2007-05-30 17:45:58 (BST))Warning(2)filectime() [function.filectime]: stat failed for
cake/libs/view/templates/elements/dump.thtml in /var/www/html/app/
vendors/template_translator.php at line number(72)
Date(2007-05-30 17:45:58 (BST))Warning(2)file(cake/libs/view/templates/
elements/dump.thtml) [function.file]:
failed to open stream: No such file or directory in /var/www/html/app/
vendors/template_translator.php at line number(185)

...to me it looks like the CORE_PATH is not configured (it has not
been messed with) as I would expect to see the reference to cake/libs/
view/templates/elements/dump.thtml have some sort of PATH prepended to
it.


Any ideas?

Thanks,

Joe.


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



Re: HABTM and join attribute

2007-05-30 Thread Joshua Benner

I had a similar setup in an application -- my solution was to write a 
custom finderQuery. There are several posts on the message board about 
doing this, but I'll paste my code below. Bear in mind the query below 
is TSQL, so it might be a little unfamiliar if you're used to MySQL. 
Also, this code is written for CakePHP 1.2.x -- I'm not sure if there 
are differences required here for 1.1.x.

Three tables:

faculty (id, name, etc)
activities (id, name, etc)
activity_links (id, faculty_id, activity_id, students)

I wanted to pull the link ID and student count along with each activity 
that was linked to the faculty. Below is how I did it in the faculty model.

var $hasAndBelongsToMany = array(
'Activity' => array('className'  => 'Activity',
'joinTable'  => 
'facultyWorkload_activity_links',
'foreignKey' => 'faculty_id',
'associationForeignKey' => 'activity_id',
'unique' => true,
'finderQuery' => '
SELECT
[Activity].[id] as [Activity.id],
[Activity].[name] as [Activity.name],
[Activity].[activity_type_id] as [Activity.activity_type_id],
[Activity].[credits] as [Activity.credits],
[ActivityLink].[students] as [Activity.students],
[ActivityLink].[id] as [Activity.activity_link_id]
FROM
[facultyWorkload_activities] AS [Activity]
JOIN [facultyWorkload_activity_links] AS [ActivityLink] ON 
[ActivityLink].[activity_id] = [Activity].[id]
WHERE
[ActivityLink].[faculty_id] = {$__cakeID__$}
ORDER BY
[Activity].[name] ASC'
  ));

3mind wrote:
> Is possible have a join attribute in a findall result?
>
> I have 3 table:
>
> user(id,name)[var $hasAndBelongsToMany = array('Phone' =>
> array('className'  => 'Phone']))]
> user_phone(user_id,phone_id,myattribute)
> phone(id,number)  [var $hasAndBelongsToMany = array('User' =>
> array('className' => 'User'))]
>
> How i obtain "myattribute" when i do $this->User->findall() in the
> User controller?
>
> Is possible?
>
>
> >
>   

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



Re: using uuid component to create id's into my model

2007-05-30 Thread Divagater

I use database triggers to handle writing UUID's for all of my id's.
This is not a PHP solution and may or may not be appropriate for
scalability across a wide range of databases. In MySQL a trigger to to
add a UUID as the id of a particular table would look like this:

CREATE TRIGGER `posts_id` BEFORE INSERT ON `posts` FOR EACH ROW SET
NEW.id = UUID();

Cheers,
Divagater

On May 30, 11:18 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Please if you have any working code snippet showing me how to
> integrate Daniel Hofstetter  (http://cakebaker.42dh.com) Uuid
> component into my model, so the autoincrement id is not necesary in
> the future...
>
> Thanks !


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



Re: Does cake cache plugins

2007-05-30 Thread Chris Hartjes

On 5/30/07, Davide <[EMAIL PROTECTED]> wrote:
>
> Chris Hartjes wrote:
> > As far as I know (I know I will be corrected if I am wrong) caching
> > will only occur if you have debug set to 0.
>
> Maybe right but there's no mention of that in the manual. If true, how can
> I check for cache working?
>

That's a good question...one people smarter than me will have to tell
you.  In terms of testing, I guess the best way is to have your RSS
feed spit out some time-specific info and if that info doesn't change,
it's caching! ;)

-- 
Chris Hartjes

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

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

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



Re: cakephp doubt

2007-05-30 Thread Walker Hamilton

uhh..also, you could have misplaced the .htaccess files when you moved
everything over

mohan wrote:
> i have installed and configured cake php successfully in xampp  under
> the folder htdocs\cake
> i got the following  message also
>
> Your database configuration file is present.
>
> Cake is able to connect to the database.
>
> i have created  a database called project and with table name as
> bookmarks.
>
> I have a model named bookmark.php   with the following code stored in
> the /app/models
>
>  class Bookmark extends AppModel
> {
>   var $name = 'Bookmark';
> }
> ?>
>
> I have a controller  named bookmarks_controller.php   with the
> following code stored in the /app/controllers
>
>
>  class BookmarksController extends AppController
> {
>   var $name = 'Bookmarks';
>   var $scaffold;
> }
> ?>
> when i tried with the following url:
> http://localhost/bookmarks/
>
> i got the error below:
>
> Object not found!
> The requested URL was not found on this server. If you entered the URL
> manually please check your spelling and try again.
>
> If you think this is a server error, please contact the webmaster.
>
> Error 404
> localhost
> 05/30/07 19:54:00
> Apache/2.2.4 (Win32) DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8e
> mod_autoindex_color PHP/5.2.2
>
> Kindly  offer a solution as early as possible
>
> thank you.


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



Re: Does cake cache plugins

2007-05-30 Thread Davide

Chris Hartjes wrote:
> As far as I know (I know I will be corrected if I am wrong) caching
> will only occur if you have debug set to 0.

Maybe right but there's no mention of that in the manual. If true, how can
I check for cache working?

Thanks
Davide



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



Re: Debugging Cake app via DBG or Zend Debugger

2007-05-30 Thread Joshua Benner

I tried Zend Debugger but couldn't get it to load in my PHP environment 
properly, then I tried Xdebug (there's an Xdebug extension for PDT), and 
it worked beautifully! Only one workstation can debug per server, 
though. Still, it's wonderful to have access to debugger functionality.

Chris Hartjes wrote:
> On 5/29/07, Ming <[EMAIL PROTECTED]> wrote:
>   
>> Hi there,
>>
>> I wonder if anybody here can do me a favor by sharing his/her
>> experience in debugging a Cake app by DBG (if you are using PhpED) or
>> Zend Debugger ( if you are using Zend Studio or PDT).
>>
>> 
>
> I've used Komodo and XDebug to take a look at what's going on and
> didn't have any problems setting breakpoints etc.  Maybe you should
> ask this question on a Zend Studio mailing list?
>
>   

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



HABTM and join attribute

2007-05-30 Thread 3mind

Is possible have a join attribute in a findall result?

I have 3 table:

user(id,name)[var $hasAndBelongsToMany = array('Phone' =>
array('className'  => 'Phone']))]
user_phone(user_id,phone_id,myattribute)
phone(id,number)  [var $hasAndBelongsToMany = array('User' =>
array('className' => 'User'))]

How i obtain "myattribute" when i do $this->User->findall() in the
User controller?

Is possible?


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



Re: Does cake cache plugins

2007-05-30 Thread Chris Hartjes

On 5/30/07, Davide <[EMAIL PROTECTED]> wrote:
>
> Hello everybody.
>
> I'm trying the rss plugins[1] and it works great. However, in order to
> save server resources, I'm trying to cache the view. I've toggled
> debug to 3 in order to see if it's caching and I've putted
> CACHE_CHECK=true in config and then I tried to treat plugin controller
> as a normal controller with the following result

As far as I know (I know I will be corrected if I am wrong) caching
will only occur if you have debug set to 0.

-- 
Chris Hartjes

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

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

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



Does cake cache plugins

2007-05-30 Thread Davide

Hello everybody.

I'm trying the rss plugins[1] and it works great. However, in order to
save server resources, I'm trying to cache the view. I've toggled
debug to 3 in order to see if it's caching and I've putted
CACHE_CHECK=true in config and then I tried to treat plugin controller
as a normal controller with the following result

class RssController extends RssAppController {
var $name = 'Rss';
var $helpers = array('Time', "Cache");
var $uses = '';
var $model = null;
   var $cacheAction = "+1 hour";

However, watching at the generated rss appened there's always the
executed query (with different time of execution). So the question is:
am I wrong with somethig or cake doesn't support cache for plugins?

Thanks a lot
Davide

1.
http://bakery.cakephp.org/articles/view/automagic-rss-feed-generator-plugin






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



Re: cakephp doubt

2007-05-30 Thread Chris Hartjes

On 5/30/07, mohan <[EMAIL PROTECTED]> wrote:
> Kindly  offer a solution as early as possible

I hear that the manual offers a lot of solutions as early as you can read it.

Do you have mod_rewrite enabled for your web server?

-- 
Chris Hartjes

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

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

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



using uuid component to create id's into my model

2007-05-30 Thread [EMAIL PROTECTED]

Please if you have any working code snippet showing me how to
integrate Daniel Hofstetter  (http://cakebaker.42dh.com) Uuid
component into my model, so the autoincrement id is not necesary in
the future...

Thanks !


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



Re: cakephp doubt

2007-05-30 Thread John David Anderson (_psychic_)


On May 30, 2007, at 8:30 AM, mohan wrote:

>
> i have installed and configured cake php successfully in xampp  under
> the folder htdocs\cake

...

> http://localhost/bookmarks/

Should this be http://localhost/cake/bookmarks if you've installed  
CakePHP in /htdocs/cake?

-- John

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



cakephp doubt

2007-05-30 Thread mohan

i have installed and configured cake php successfully in xampp  under
the folder htdocs\cake
i got the following  message also

Your database configuration file is present.

Cake is able to connect to the database.

i have created  a database called project and with table name as
bookmarks.

I have a model named bookmark.php   with the following code stored in
the /app/models



I have a controller  named bookmarks_controller.php   with the
following code stored in the /app/controllers



when i tried with the following url:
http://localhost/bookmarks/

i got the error below:

Object not found!
The requested URL was not found on this server. If you entered the URL
manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.

Error 404
localhost
05/30/07 19:54:00
Apache/2.2.4 (Win32) DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8e
mod_autoindex_color PHP/5.2.2

Kindly  offer a solution as early as possible

thank you.


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



Re: Complex SQL Conditions (multiple ORs)

2007-05-30 Thread squidliberty

I believe that is how I am currently structuring my $conditions. The
following code doesn't work for me...

$conditions['NOT'] = array(blah);
$conditions[0]['OR'] = array(blah, blah);
$conditions[1]['OR'] = array(blah, blah);

Is it just me?

On May 28, 6:46 pm, Grant Cox <[EMAIL PROTECTED]> wrote:
> I'm not sure if this was an intended change, so we'll see what happens
> to your ticket.  But to get the query you want just put the 'or' keys
> inside another array.
>
> $conditions = array(
>   'NOT' => array(..expiration...),
>   array( 'OR' => array(...like $term...) ),
>   array( 'OR' => array(...like $term2...) )
> );
>
> To me this makes sense, as in the query you want each of these three
> conditions joined by AND, but the latter two conditions to have OR
> inside brackets.


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



Re: how can a controller access another model

2007-05-30 Thread AD7six


Ita wrote:
> Hi,
> In my DB I have 3 tables
> objects, users & votes

You are going to have problems with a model class named 'Object' since
it already exists - you need to choose a different  name.

regarding the check, as I'm here, simply use your associations:

if ($this->Vote->Thing->hasAny(array('Thing.name'=>$objectName)) {
// cast vote.
}

hth,

AD


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



Re: Date

2007-05-30 Thread m.sbragi

I suggest to use this approach:

In your View:
// The 2^ param 'MDY' for the sequence of selects
echo $html->dateTimeOptionTag('Client/dob', 'MDY', 'NONE',
$data['Client']['dob'], array(), false);

In your controller
$this->cleanupFields(); // automagically buld a single fields from the group
of date selects
$this->Client->save($this->data);

HTH
For more reference see the manual or api

> -Messaggio originale-
> Da: cake-php@googlegroups.com 
> [mailto:[EMAIL PROTECTED] Per conto di cake_learner
> Inviato: mercoledì 30 maggio 2007 15.15
> A: Cake PHP
> Oggetto: Date
> 
> 
> I am trying to insert date into database.
> 
> fieldname: dob
> type: date (y:m:d)
> 
> 
> views code:
> 
> 
> dayOptionTag('Client/d', $value = null, 
> $selected = null, $selectAttr = null, $optionAttr = null, 
> $showEmpty = true);?>
> monthOptionTag('Client/m', 
> $value = null, $selected = null, $selectAttr = null, 
> $optionAttr = null, $showEmpty = true)?>
> 
> 
> yearOptionTag('Client/y', 
> $value = null, $minYear = null, $maxYear = null, $selected = 
> null, $selectAttr = null, $optionAttr = null, $showEmpty = true)?>
> 
> 
> In the controller i have the code,
> 
> 
> $this->Client->save($this->data);
> 
> 
> 1.  How do i save date, month, year in one field?
> 
> 
> 2.  The controller has many drop down (select tag), whose 
> data is coming from different tables.  While saving should i 
> have to say as $this-Client->save?  The class has been 
> declared as,  class ClientsController extends AppController
> 
> 
> 3.  As i have allready mentioned the controller code contains 
> many dropdown tag.
>example : $this->set('City', $this->City->generateList(
> null, "city_id ASC", null, "{n}.City.city_id",
> "{n}.City.city")
> );
> 
> 
> > 


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



Re: how can a controller access another model

2007-05-30 Thread Repsah
In your controller:

var $uses = array('Vote', 'Object');

Then access the object model like you do form your objects controller

On 5/30/07, Ita <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
> In my DB I have 3 tables
> objects, users & votes
>
> as you probably guessed a user can vote for an object.
> I've created models, controllers and views for all 3.
> I've also made a user login and saved him on the session object.
>
> Now I want him to be able to vote.
> so on the objects view I created a form that calls the votes
> controller
> votes/castVote
> and sent the object ID via hidden form field.
>
> before I add the data to the DB I want to check that the object exists
> in the objects table.
> the problem is that I'm in the votes controller - how do I gain access
> to the objects model from a controller that is not his?
> What am I missing?
>
>
> >
>

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



how can a controller access another model

2007-05-30 Thread Ita

Hi,
In my DB I have 3 tables
objects, users & votes

as you probably guessed a user can vote for an object.
I've created models, controllers and views for all 3.
I've also made a user login and saved him on the session object.

Now I want him to be able to vote.
so on the objects view I created a form that calls the votes
controller
votes/castVote
and sent the object ID via hidden form field.

before I add the data to the DB I want to check that the object exists
in the objects table.
the problem is that I'm in the votes controller - how do I gain access
to the objects model from a controller that is not his?
What am I missing?


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



Re: Upload a File with CakePHP 1.2.0.5137alpha

2007-05-30 Thread dardosordi

Hi Andrea,

I'm using this for file uploading in 1.2 an works like a charm

http://bin.cakephp.org/saved/17539

Here is how it works:

http://blog.chris-partridge.info/2007/03/16/uploadbehavior-is-here/


Hope it helps.

P/D: Are you spanish speaker?

On May 29, 1:48 pm, Andrea <[EMAIL PROTECTED]> wrote:
> Hi to everybody!
> I want to upload a file that I choose from a field of a form. How can
> I do this action?
> With the previous stable Version of Cake I do this, with the aid of
> this extension:http://www.reversefolds.com/articles/show/filehandler
> With this new version the controller always say to me that I don't
> give to it the file.
>
> In particular I want to upload an image.
>
> Help me, please :D
>
> Thanks
>
> Ps. Sorry for my bad English!


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



Re: Sessions Issue

2007-05-30 Thread djiize

I had an issue like that with WAMP, it was due to an "underscore" in
the subdomains and the session didn't "fix".
Maybe not your case, but I must told you in case of ;)

On 30 mai, 14:51, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 5/29/07, Ketan Patel <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi Chris,
>
> > The debug is set to 2. The set up is WAMP where I experience this
> > issue. However, just to make sure that this happens on Linux box or
> > not, I booted into Linux and it works fine in linux. So I don't know
> > if its CakePHP issue or its WAMP configuration issue. Let me know.
>
> Sorry, no experience with WAMP at this end.  I don't know of any
> tried-and-true methods of debugging sessions.  There must be other
> people from the WAMP crowd on this list who can help you out.
>
> Good to see that debug is set to 2.  First step is to get as much
> information as possible. :)
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


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



Date

2007-05-30 Thread cake_learner

I am trying to insert date into database.

fieldname: dob
type: date (y:m:d)


views code:


dayOptionTag('Client/d', $value = null, $selected =
null, $selectAttr = null, $optionAttr = null, $showEmpty = true);?>
monthOptionTag('Client/m', $value =
null,
$selected = null, $selectAttr = null, $optionAttr = null, $showEmpty
=
true)?>


yearOptionTag('Client/y', $value =
null, $minYear
= null, $maxYear = null, $selected = null, $selectAttr = null,
$optionAttr = null, $showEmpty = true)?>


In the controller i have the code,


$this->Client->save($this->data);


1.  How do i save date, month, year in one field?


2.  The controller has many drop down (select tag), whose data is
coming from different tables.  While saving should i have to say as
$this-Client->save?  The class has been declared as,
 class ClientsController extends AppController


3.  As i have allready mentioned the controller code contains many
dropdown tag.
   example : $this->set('City', $this->City->generateList(
null, "city_id ASC", null, "{n}.City.city_id",
"{n}.City.city")
);


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



Re: Sessions Issue

2007-05-30 Thread Chris Hartjes

On 5/29/07, Ketan Patel <[EMAIL PROTECTED]> wrote:
>
> Hi Chris,
>
> The debug is set to 2. The set up is WAMP where I experience this
> issue. However, just to make sure that this happens on Linux box or
> not, I booted into Linux and it works fine in linux. So I don't know
> if its CakePHP issue or its WAMP configuration issue. Let me know.

Sorry, no experience with WAMP at this end.  I don't know of any
tried-and-true methods of debugging sessions.  There must be other
people from the WAMP crowd on this list who can help you out.

Good to see that debug is set to 2.  First step is to get as much
information as possible. :)


-- 
Chris Hartjes

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

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

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



Re: Question: Join two tables, count and sort result

2007-05-30 Thread Alexey Kuimov

Sorry for my urgency, but I still have a problem with grouping of
query results. With single word name (`count`) for COUNT result I get
additional array key [0]:
[0] => Array (
[count] => 10
)

If I add table name (`Vendor`.`count` for exampe), I get SQL error
#1064:
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near '.`count`

Tell me please how to get result without this additional array.


On May 9, 11:20 pm, Alexey Kuimov <[EMAIL PROTECTED]> wrote:
> It's strange, but I still get that error message :(. I added
> backticks, I tried to use `Vendor`.`total` instead `Vendor`.`count`
> with same negative result. Please, help me with code in controller.
> Now I'm using this:
>
> $this->Vendor->bindModel(array('hasOne'=>array('Model')));
> $fields = array('Vendor.name', 'Vendor.safe', 'COUNT(Model.vendor_id)
> AS `Vendor`.`count`');
> $conditions = 'GROUP BY Vendor.id';
> $order = 'Vendor.name ASC';
> $result = $this->Vendor->findAll($conditions, $fields, $order);
>
> On May 6, 5:32 pm, geoffriley <[EMAIL PROTECTED]> wrote:
>
> > You need to quote with backticks the `Vendor`.`count`.
>
> > Without the backticks the SQL interpreter thinks that you're
> > attempting to use the function count() again, so it's expecting
> > something to count but finds 'FROM' instead: hence the error.
>
> > So, make your SQL like this, and you should be okay:
>
> > SELECT
> >   `Vendor`.`name`,
> >   `Vendor`.`safe`,
> >   COUNT(Model.vendor_id) AS `Vendor`.`count`
> > FROM
> >   `vendors` AS `Vendor`
> >   LEFT JOIN `models` AS `Model` ON `Model`.`vendor_id` = `Vendor`.`id`
> > GROUP BY `Vendor`.`id`
> > ORDER BY `Vendor`.`name`  ASC
>
> > As an aside, I think you can safely replace
> >   ON `Model`.`vendor_id` = `Vendor`.`id`
> > with
> >   USING (`id`)
> > given that only two tables are involved.  But I could be wrong on that
> > one. :-)
>
> > Hope that helps.
>
> > Geoff


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



Re: The Slimfast Challange (or help me slim down my controller)

2007-05-30 Thread Tane Piper

Yep - thats the way there, works great :)

Tane

On 5/30/07, Jon Bennett <[EMAIL PROTECTED]> wrote:
>
> > you don't want to 'set' the variable to the view, or return it, simply do:
> >
> >
> > function beforeFilter()
> > {
> >   $level_check = $this->othAuth->group('level');
> >if (!empty($level_check))
> >{
> >$this->level = $level_check;
> >} else {
> >$this->level = 0;
> >}
> > }
>
> I think you could simplify this further by adding $level to the class
> with a default value, eg:
>
> class AppController extends Object()
> {
> var $level = 0;
> }
>
> function beforeFilter()
> {
>  $level_check = $this->othAuth->group('level');
>   if (!empty($level_check)) $this->level = $level_check;
> }
>
> 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?hl=en
-~--~~~~--~~--~--~---



Re: GoDaddy Subdomain Woes

2007-05-30 Thread unimatrixZxero

That all sounds pretty much correct to me. Where is your problem? If
you are confused where that url is created take a look at your
'.htaccess' files

On May 30, 12:12 am, "Ronald Chaplin" <[EMAIL PROTECTED]> wrote:
> OK. Here's my issue if anyone can help.
> I have created a subdomain, adcamp that relates to the url
> adcamp.midnightfury.info.
> The host is GoDaddy. I have pointed the root directory to
> /adcamp/app/webroot and the full directory structure is
> /home/content/d/e/t/dethriderr/html/adcamp/app/webroot.
> If you view the source of adcamp.midnightfury.info the css tag is
> href="/app/webroot/css/default.css" .
> I am using the default core files for 1.12 and have only adjusted the core
> file to disable mod_rewrite.
> I am using echo $html->css('default'); in my default layout.
> Also, webroot . 'favicon.ico';?> equates to
> href="/app/webroot/favicon.ico" .Any suggestions?
>
> --
> Thanks,
> Ron Chaplin
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> T73 Software & Designwww.t73-softdesign.com
> We'll make all of your wildest
> e-Commerce dreams come true!


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



Re: acl.php fatal error

2007-05-30 Thread KoD

Ok, I solve it. I use the SQL query in the acl.sql file.

On 30 Mag, 12:20, KoD <[EMAIL PROTECTED]> wrote:
> Hi,
> when I run "php acl.php initdb" php return the error:
>
> "PHP Fatal error: Allowed memory size of 1342177228 bytes exhausted
> (tried to allocate 786432 bytes) in C:\web\cake\libs\session.php on
> line 597"
>
> Someone know 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?hl=en
-~--~~~~--~~--~--~---



Re: The Slimfast Challange (or help me slim down my controller)

2007-05-30 Thread Jon Bennett

> you don't want to 'set' the variable to the view, or return it, simply do:
>
>
> function beforeFilter()
> {
>   $level_check = $this->othAuth->group('level');
>if (!empty($level_check))
>{
>$this->level = $level_check;
>} else {
>$this->level = 0;
>}
> }

I think you could simplify this further by adding $level to the class
with a default value, eg:

class AppController extends Object()
{
var $level = 0;
}

function beforeFilter()
{
 $level_check = $this->othAuth->group('level');
  if (!empty($level_check)) $this->level = $level_check;
}

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



Re: The Slimfast Challange (or help me slim down my controller)

2007-05-30 Thread Jon Bennett

> I did do as suggested below and it didn't work, I tried both return
> $level and $this->set('level', $level), both failing to return the
> value to the controller.  Writing my own function and calling it
> $this->levelcheck() was the only way it seemed to work.

you don't want to 'set' the variable to the view, or return it, simply do:


function beforeFilter()
{
  $level_check = $this->othAuth->group('level');
   if (!empty($level_check))
   {
   $this->level = $level_check;
   } else {
   $this->level = 0;
   }
}

alternatively you could put the call to $this->levelCheck() into your
beforeFilter().

eg:

function beforeFilter()
{
$this->levelCheck();
}


FYI any member variables set in app_controller are available to all
controllers, because all controllers extend app_controller. This means
you do not need to use return $var in beforeFilter.

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



Re: The Slimfast Challange (or help me slim down my controller)

2007-05-30 Thread Tane Piper

I did do as suggested below and it didn't work, I tried both return
$level and $this->set('level', $level), both failing to return the
value to the controller.  Writing my own function and calling it
$this->levelcheck() was the only way it seemed to work.

Tane


>
> will you not likely need to know the level for most functions? if so,
> would it not be best to follow the previous advice and put this in
> beforeFilter() in your app_controller, then you will never need to
> call levelCheck explicity, it will be done for you automatically.
>
> if you're using othAuth, you'll already have some code in
> beforeFilter, so just add the above to that...
>
> jb
>
> --
>
>
> jon bennett
> t: +44 (0) 1225 341 039 w: http://www.jben.net/
> iChat (AIM): jbendotnet Skype: jon-bennett
>
> >
>

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



i18n translation in db tables - how to do this like Symfony?

2007-05-30 Thread oleonav

Hi there,

For an upcomming project, a mutilangual site, I need the ability to
store different versions of the same content in a database. I've been
evaluating both Cake & Symfony as basis for this site.

Although I do like Cake for it's low footprint and simplicity to make
things work I need something like the the translation feaute build in
Symfony for i18n content. I've noticed that i18n is a feature of the
upcoming 1.2 release of Cake.

Questions?
1. Does anyone has a working solutions or documentation on how to
implement i18n in the new 1.2. version.
2. What will be the appro. relase date of Cake 1.2

Thanks


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



acl.php fatal error

2007-05-30 Thread KoD

Hi,
when I run "php acl.php initdb" php return the error:

"PHP Fatal error: Allowed memory size of 1342177228 bytes exhausted
(tried to allocate 786432 bytes) in C:\web\cake\libs\session.php on
line 597"

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



javascript helper, "defer" problem

2007-05-30 Thread Dia

hi

I didn't find if it's possible (I use cake 1.1) to use a second
argument with JavascriptHelper::link()

I wanted to use this to specify "defer", like this :


the only way I found to emulate that is to transform my JS file :
// code
into
window.onload = function() { // code }
and to call this file with the normal way : $javascript-
>link('pngfix')

is there a way to deal with it using the JavascriptHelper ?

something like JavascriptHelper::link($url, $defer) where $defer is a
boolean


as you can see, my problem is solved, this topic is just for my own
information and to do this suggestion

thanx


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



Re: The Slimfast Challange (or help me slim down my controller)

2007-05-30 Thread Jon Bennett

> Eventually solved it:
>
> In my app_controller:
>
> function levelcheck()
> {
> $level_check = $this->othAuth->group('level');
> if (!empty($level_check))
> {
> $level = $level_check;
> } else {
> $level = 0;
> }
> return $level;
> }
>
> Then I can call $this->levelcheck() when I need the users level.

will you not likely need to know the level for most functions? if so,
would it not be best to follow the previous advice and put this in
beforeFilter() in your app_controller, then you will never need to
call levelCheck explicity, it will be done for you automatically.

if you're using othAuth, you'll already have some code in
beforeFilter, so just add the above to that...

jb

-- 


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

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



Re: The Slimfast Challange (or help me slim down my controller)

2007-05-30 Thread Tane Piper

Eventually solved it:

In my app_controller:

function levelcheck()
{
$level_check = $this->othAuth->group('level');
if (!empty($level_check))
{
$level = $level_check;
} else {
$level = 0;
}
return $level;
}

Then I can call $this->levelcheck() when I need the users level.


Tane




On 5/29/07, Christopher E. Franklin, Sr.
<[EMAIL PROTECTED]> wrote:
>
> The best place to put this, I find, is in a copy of
> app_controller.php.  You place the copy into your app folder and add
> your beforeFilters() etc.  This way you don't have to write that
> function in every single controller.
>
> Throw this into it and see how it does for you:
>
> class AppController extends Controller {
> //public $ext = ".php";
> //public $helpers = array('Html', 'Javascript', 'Ajax');
>
> function beforeFilter()
> {
>$level_check = $this->othAuth->group('level');
> if (!empty($level_check))
> {
> $this->level = $level_check;
> } else {
> $this->level = 0;
> }
>
> }
> }
>
> Now, everytime a controller tries to run a "filter"  this function is
> called, no matter what controller it is.  If you want to limit the
> controllers that call this, name it another function and you will have
> to call it manually from the controller that you want to use it.
>
> On May 29, 11:27 am, Walker Hamilton <[EMAIL PROTECTED]> wrote:
> > function beforeFilter()
> > {
> >$level_check = $this->othAuth->group('level');
> > if (!empty($level_check))
> > {
> > $this->level = $level_check;
> > } else {
> > $this->level = 0;
> > }
> >
> > }
> >
> > then in your functions just grab $this->level when you need to.
>
>
> >
>

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



Re: Select database at the model level per request?

2007-05-30 Thread francky06l

You could setup different database into the config.php, and set the
$useDbConfig to point to the desired database into the model. After
login, if all models are use the same DB you can put this into the
app_model.php.

On May 30, 11:07 am, davo <[EMAIL PROTECTED]> wrote:
> Hi Guys,
>
> We're trying to introduce cake into an existing php app, with the aim
> of gradually porting the old legacy spaghetti code into cake. We have
> to add some new features so this seems like a good time to start
> migrating.
>
> A bit of background - the application has a single 'master' database
> that holds login and profile information. Each user belongs to a
> 'profile' (basically a customer) with their own database, so after the
> initial login they use their own separate database for customer-
> specific data like crm, stats etc. So for example, if i am customer_x,
> i might login using a master database called 'my_app', then after i'm
> logged in use a database called 'my_app_customer_x'. I will still use
> the master 'my_app' database for some things, such as user
> administration etc.
>
> The problem I'm running into is this - depending on the user's
> 'profile' the model needs to use a different database. I can get the
> name of the database i want inside the model, but i can't figure out
> how to use it.
>
> I have overcome a similar problem before with rails by setting the
> table_prefix in the model to the database name (yes very hacky!), so
> for a 'daily_stats' model for 'customer_x', the model name is set to
> 'my_app_customer_x.daily_stats' at runtime, which works fine with
> mysql.
>
> This hack doesn't work at all in cake because the model keeps a list
> of it's tables (in $db->listSources() i think), and i am banging my
> head against the wall trying to think of a clean way to do this. I
> don't care about any DB except MySQL if that makes any difference.
> We'd like to avoid doing a separate mysql connection per request if
> possible, because we tried that before with rails and it brought the
> DB server down pretty quickly under load.
>
> I hope you guys & gals can follow what i'm getting at - any & all help
> would be greatly appreciated!
>
> thanks
>
> dave


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



Re: cake not running on production server

2007-05-30 Thread francky06l

Seems to be a story of rights on directory or files. Be sure
your .htaccess in webroot does not contain any Deny All (also the
Allow, Deny order), these can also be into the httpd.conf.

On May 30, 10:33 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> I'm trying to run my cake application on my production server but all
> I get is a 403 message.
>
> I've got three machines with the following result:
> - my windows machine: works well
> - a friends linux server: works well
> - production server, VPS with linux: 403 forbidden access
>
> I haven't got a clue were to look for.
>
> Any hints would be appreciated!
> Solutions are even better!!! ;-)
>
> Tenx,
> Jos


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



Select database at the model level per request?

2007-05-30 Thread davo

Hi Guys,

We're trying to introduce cake into an existing php app, with the aim
of gradually porting the old legacy spaghetti code into cake. We have
to add some new features so this seems like a good time to start
migrating.

A bit of background - the application has a single 'master' database
that holds login and profile information. Each user belongs to a
'profile' (basically a customer) with their own database, so after the
initial login they use their own separate database for customer-
specific data like crm, stats etc. So for example, if i am customer_x,
i might login using a master database called 'my_app', then after i'm
logged in use a database called 'my_app_customer_x'. I will still use
the master 'my_app' database for some things, such as user
administration etc.

The problem I'm running into is this - depending on the user's
'profile' the model needs to use a different database. I can get the
name of the database i want inside the model, but i can't figure out
how to use it.

I have overcome a similar problem before with rails by setting the
table_prefix in the model to the database name (yes very hacky!), so
for a 'daily_stats' model for 'customer_x', the model name is set to
'my_app_customer_x.daily_stats' at runtime, which works fine with
mysql.

This hack doesn't work at all in cake because the model keeps a list
of it's tables (in $db->listSources() i think), and i am banging my
head against the wall trying to think of a clean way to do this. I
don't care about any DB except MySQL if that makes any difference.
We'd like to avoid doing a separate mysql connection per request if
possible, because we tried that before with rails and it brought the
DB server down pretty quickly under load.

I hope you guys & gals can follow what i'm getting at - any & all help
would be greatly appreciated!

thanks

dave


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



Re: How to enable a CSV webservice?

2007-05-30 Thread m.sbragi

What about a view like this.
I have not tested but extracted from a view in one project that is a little
more complex but it is just as an example.



hth


Da: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Per
conto di Gonzalo Servat
Inviato: martedì 29 maggio 2007 22.59
A: cake-php@googlegroups.com
Oggetto: Re: How to enable a CSV webservice?


On 5/29/07, Howard Glynn <[EMAIL PROTECTED]> wrote: 

Slightly bad karma to reply to one's own post so soon, but
after continuing to investigate,
I'd like to provide a solution for the mail archives. I just
didn't fully understand the route handling up until this point, but the
light is starting to go on for me. I have subsequently found 2 ways it can
be done: 

1) Less agreeable way: change the cake distro
libs/router.php around line 147, adding:

  $this->connect('/csv/:controller/:action/*',
array('webservices' => 'Csv')); 

2) More agreeable, add to the application
app/config/routes.php 

$Route->connect('/csv/:controller/:action/*',
array('webservices' => 'Csv'));

I am well aware that CSV is not a webservice as such but I
want the CSV output availability to be consistent with the XML approach. 


Is your requirement strictly CSV or can it be an actual Excel file?
I found this article recently at bakery.cakephp.org (which I plan on using)
to create an XLS file from database records: 



http://bakery.cakephp.org/articles/view/generate-excel-spreadsheets-from-you
r-database
 


If it's strictly CSV what you need, then it won't help, but I think
what klonae said is probably the simplest way. 

klonae: just wondering, shouldn't the header() calls be made just
before the foreach begins?

- Gonzalo







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



Re: navigation

2007-05-30 Thread luke BAKING barker

oh try this - could be useful, I just saw it :) -- Andy Dawsons whole
blog is a nice resource for Cake, also.

http://www.noswad.me.uk/MiBlog/Blogs/view/ACLPart1

On May 30, 10:00 am, luke BAKING barker <[EMAIL PROTECTED]> wrote:
> Hi
>
> Sounds to me like you have just that - 3 groups - here: I would think
> you should use othAuth (for example) as a nice (theres an article)
> simple implementation. Why reinvent the wheel, and not do something
> that will scale later , or be useful in another app?
>
> Otherwise, try figuring out the builtin acl / admin routing?
>
> imho :)
>
> Luke
>
> On May 30, 7:46 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > I don't really want to deal with users and groups. I have no need for
> > groups in this application at all.
> > Basically just visitors/users/admin
>
> > basically, visitors have no login information
> > users have been authenticated and have admin flag set to 0
> > admins have been authenticated and have an admin flag set to 1 or
> > something like that
>
> > I guess i could use the same idea as you said. THe problem is how do i
> > get that data to a global view.. thats what i'm working on
>
> > I'm guessing in my default template i can echo some variable and then
> > i just have to make sure that every controller actually sets something
> > for that variable. Basically i just want to know what the best way of
> > doing that is.. I don't want to add an element to every view though..
> > that seems
> > ugly.. but may have to do.
>
> > On May 29, 1:54 pm, "Tane Piper" <[EMAIL PROTECTED]>
> > wrote:
>
> > > If you use a similar idea to othAuth, and put users into groups - you
> > > could show a menu either based on the users group, or the access
> > > level.
>
> > > Some psudocode would be like:
>
> > > if ($this->User->level = 0)
> > > {
> > > output ('login')} else if ($this->User->level = 100) {
>
> > >output (' regular menu')} else if ($this->User->level = 200) {
>
> > >output ('admin menu')
>
> > > }
>
> > > Tane
>
> > > On 5/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > > > I have a website and i want to use a specific navigation menu but i
> > > > want the links to depend on the state.. Basically there are 1 of the
> > > > different navigation menus i want to render,
> > > > 1. no user logged in
> > > > 2. regular user logged in
> > > > 3. admin user logged in
>
> > > > Currently i have  a user model and the appropriate controllers and
> > > > views. I figured out how to enforce authentication and what not on the
> > > > pages, however i am unsure what a good way of supplying the navigation
> > > > menu would be for each.
>
> > > > Any ideas? I was thinking some kind of a ocmponent or something but
> > > > i'm not sure how to use those..
>
> > > > Thanks


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



Re: navigation

2007-05-30 Thread luke BAKING barker

Hi

Sounds to me like you have just that - 3 groups - here: I would think
you should use othAuth (for example) as a nice (theres an article)
simple implementation. Why reinvent the wheel, and not do something
that will scale later , or be useful in another app?

Otherwise, try figuring out the builtin acl / admin routing?

imho :)

Luke

On May 30, 7:46 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I don't really want to deal with users and groups. I have no need for
> groups in this application at all.
> Basically just visitors/users/admin
>
> basically, visitors have no login information
> users have been authenticated and have admin flag set to 0
> admins have been authenticated and have an admin flag set to 1 or
> something like that
>
> I guess i could use the same idea as you said. THe problem is how do i
> get that data to a global view.. thats what i'm working on
>
> I'm guessing in my default template i can echo some variable and then
> i just have to make sure that every controller actually sets something
> for that variable. Basically i just want to know what the best way of
> doing that is.. I don't want to add an element to every view though..
> that seems
> ugly.. but may have to do.
>
> On May 29, 1:54 pm, "Tane Piper" <[EMAIL PROTECTED]>
> wrote:
>
> > If you use a similar idea to othAuth, and put users into groups - you
> > could show a menu either based on the users group, or the access
> > level.
>
> > Some psudocode would be like:
>
> > if ($this->User->level = 0)
> > {
> > output ('login')} else if ($this->User->level = 100) {
>
> >output (' regular menu')} else if ($this->User->level = 200) {
>
> >output ('admin menu')
>
> > }
>
> > Tane
>
> > On 5/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > > I have a website and i want to use a specific navigation menu but i
> > > want the links to depend on the state.. Basically there are 1 of the
> > > different navigation menus i want to render,
> > > 1. no user logged in
> > > 2. regular user logged in
> > > 3. admin user logged in
>
> > > Currently i have  a user model and the appropriate controllers and
> > > views. I figured out how to enforce authentication and what not on the
> > > pages, however i am unsure what a good way of supplying the navigation
> > > menu would be for each.
>
> > > Any ideas? I was thinking some kind of a ocmponent or something but
> > > i'm not sure how to use those..
>
> > > Thanks


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



cake not running on production server

2007-05-30 Thread [EMAIL PROTECTED]

Hi,

I'm trying to run my cake application on my production server but all
I get is a 403 message.

I've got three machines with the following result:
- my windows machine: works well
- a friends linux server: works well
- production server, VPS with linux: 403 forbidden access

I haven't got a clue were to look for.

Any hints would be appreciated!
Solutions are even better!!! ;-)

Tenx,
Jos


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



debugging methods with cakePHP

2007-05-30 Thread Ita

Hi,
I'm trying to find my way around cake and having trouble as I'm new to
it.
I'm trying to find debug methods to debug the application I'm
building.

So far I installed xampp and the zend debugger so the phpinfo show:

Expose Zend Debuggeralways
Passive Mode Timeout20 seconds

Directive   Local Value Master Value
zend_debugger.allow_hosts   127.0.0.1   127.0.0.1
zend_debugger.allow_tunnel  no valueno value
zend_debugger.connect_password  no valueno value
zend_debugger.connector_port10013   10013
zend_debugger.deny_hostsno valueno value
zend_debugger.httpd_uid -1  -1
zend_debugger.max_msg_size  2097152 2097152

To develop and debug I use eclipse pdt all in one.

next I was able to debug a single page php application(not cake
related) , but I put a breakpoint in one of the cake controllers it
never stops there.

What I'm asking is does anyone uses the eclipse PTD to develop in
cake?
If so how do I debug 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?hl=en
-~--~~~~--~~--~--~---