Re: Bakery is not updating?

2008-05-01 Thread Vangel

thanks all,
but my original question was, if i submit an article to bakery, and
nothing happens. No emails, no comments, and no update to the status,
what do I do? Is this happening only to my pst or others as well?
Because if thats the case, obviously we wont see any useful stuff ever
show up in bakery. By the time they do, they might even be worthless.

I guess I'll just have to go and start blogging my cake related
posts.

The trac lists minor bugs like tags and saving article issues. Which
could be isolated, heck maybe my issue is isolated (not that I am
arrogant to assume the webmasters are deliberately ignoring me :) ).
Not seeing your articles published at all and not having any
notification could be a different problem.
When I said help, maybe they need some help adding auto notifications
or some Space/Server/bandwidth whatever.

Or there is no one to review and approve Articles anymore. In which
case bakery is at a standoff with total doom.

cheers!!


On Apr 30, 12:30 am, Sliv <[EMAIL PROTECTED]> wrote:
> It's also worth noting that the mail functionality that notifies you
> about stuff done on the bakery runs on the same server that has been
> undergoing DOS attacks lately, so draw your own conclusions.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Looking for the Rapid in Cakephp

2008-05-01 Thread Chris Hartjes

On Thu, May 1, 2008 at 11:12 PM, Dardo Sordi Bogado
<[EMAIL PROTECTED]> wrote:
>  No, I'm a free (not as in beer) software guy, so it will not work for
>  me, thanks anyway.

I will hopefully end this thread by crushing someone's spirit:

I use free software to code in Cake...on my MacBook...so unless your
PC was free, you should STFU about those who choose to spend money on
Apple hardware and use OS-X instead of PC hardware running a free OS
like GNU/Linux.

I have done both in my time.

Now, back to arguing about other CakePHP minutae!

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Looking for the Rapid in Cakephp

2008-05-01 Thread Dardo Sordi Bogado

On Thu, May 1, 2008 at 4:35 PM, mbavio <[EMAIL PROTECTED]> wrote:
>
>  This group doesnt allow you to speak badly about Mac! :P
>
>  No, seriously, have you tried some Mac development? I can asure you
>  that you wont go back never more to your PC.

No, I'm a free (not as in beer) software guy, so it will not work for
me, thanks anyway.

>  And about writing HTML, it´s always about tastes, I love to write good
>  and semantic html, without any kind of helpers.

Agree, is a matter of tastes.

- Dardo Sordi.

P.S. Sorry for going OT.

>  Cheers,
>  mbavio
>
>
>
>  On May 1, 3:37 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>  > >  Lol, if you want to write html fast, use some ide with autocomplete
>  > >  function, or the magic of Textmate. I dont see the benefits of using
>  > >  CakePHP in that cases. Seems to me like shooting to flies with canons.
>  >
>  > I do use an ide with autocomplete, just I don't like to write HTML, is
>  > just easier for *me* write it using CakePHP, it's a matter of taste.
>  > Btw, may the hell frozen before I use a Mac.
>  >
>  > >  Cheers,
>  > >  mbavio
>  >
>  > >  On Apr 30, 8:10 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>  > >  > >  Why on earth are you using CakePHP only for a form? Use PHP, and 5
>  > >  > >  minutes of your life.
>  >
>  > >  > Because he is trying to learn. And as a side note, I do use CakePHP
>  > >  > for everything I can, even when not using PHP, i.e. for writing HTML
>  > >  > forms and is really making my life easier. I really love CakePHP and
>  > >  > I've found I can write CakePHP faster than any other kind of code.
>  >
>  > >  > >  Cheers,
>  > >  > >  mbavio
>  > >  > >  mbavio.com.ar
>  >
>  > >  > >  On Apr 29, 1:20 pm, "John David Anderson (_psychic_)"
>  >
>  > >  > > <[EMAIL PROTECTED]> wrote:
>  > >  > >  > On Apr 29, 2008, at 10:15 AM, gstrock wrote:
>  >
>  > >  > >  > > thanks for the insight.
>  > >  > >  > > I think I'm just having a bad day.
>  > >  > >  > > I realize with everything there is
>  > >  > >  > > a learning curve.  I guess I just thought
>  > >  > >  > > it would be next to nothing for cake.  :-)
>  >
>  > >  > >  > > Actually, my project has 1 database with
>  > >  > >  > > 4 tables, so it's a good little task to try
>  > >  > >  > > cake out on, I think.
>  >
>  > >  > >  > > My perseverance machine just needs another
>  > >  > >  > > cup of coffee.   :-)
>  >
>  > >  > >  > The CakePHP IRC channel on freenode is another good resource.
>  > >  > >  > Sometimes it's good to have immediate help. I'm in there now if 
> you
>  > >  > >  > want to work on this.
>  >
>  > >  > >  > #cakephp
>  >
>  > >  > >  > -- John
>  >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Unique ID that could be referencing more than one model

2008-05-01 Thread validkeys

perfect. Thanks for the responses guys!

On May 1, 9:35 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> This may be of 
> help:http://bakery.cakephp.org/articles/view/polymorphic-behavior
>
> On Thu, May 1, 2008 at 10:28 PM, patcoll <[EMAIL PROTECTED]> wrote:
>
> >  fwiw, that's what Cake ACL does as well to reference different models
> >  in one table
>
> >  'model' -- references the cake model
> >  'foreign_key' -- references the unique id to that model's table.
>
> >  On May 1, 9:01 pm, Grant Cox <[EMAIL PROTECTED]> wrote:
> >  > That's the way I do it, and have had no problems.  It is quite trivial
> >  > to set up conditions on your associations, so that the associated rows
> >  > are loaded automatically.
>
> >  > On May 2, 9:52 am, validkeys <[EMAIL PROTECTED]> wrote:
>
> >  > > Quick question..
>
> >  > > I have a conversation going on between users and managers. users and
> >  > > managers are 2 seperate tables but the conversation posts are held in
> >  > > one table. When i reference the post i reference it by id and then
> >  > > have a field called model. The model field would hold either the word
> >  > > Manager or User depending on whether or not it was a user or manager
> >  > > that posted to the conversation. I was wondering if anyone had a
> >  > > better way to do this.
>
> >  > > Feel free to shoot me down and make me feel small.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Unique ID that could be referencing more than one model

2008-05-01 Thread Dardo Sordi Bogado

This may be of help:
http://bakery.cakephp.org/articles/view/polymorphic-behavior

On Thu, May 1, 2008 at 10:28 PM, patcoll <[EMAIL PROTECTED]> wrote:
>
>  fwiw, that's what Cake ACL does as well to reference different models
>  in one table
>
>  'model' -- references the cake model
>  'foreign_key' -- references the unique id to that model's table.
>
>
>
>  On May 1, 9:01 pm, Grant Cox <[EMAIL PROTECTED]> wrote:
>  > That's the way I do it, and have had no problems.  It is quite trivial
>  > to set up conditions on your associations, so that the associated rows
>  > are loaded automatically.
>  >
>  > On May 2, 9:52 am, validkeys <[EMAIL PROTECTED]> wrote:
>  >
>  > > Quick question..
>  >
>  > > I have a conversation going on between users and managers. users and
>  > > managers are 2 seperate tables but the conversation posts are held in
>  > > one table. When i reference the post i reference it by id and then
>  > > have a field called model. The model field would hold either the word
>  > > Manager or User depending on whether or not it was a user or manager
>  > > that posted to the conversation. I was wondering if anyone had a
>  > > better way to do this.
>  >
>  > > Feel free to shoot me down and make me feel small.
>  >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Unique ID that could be referencing more than one model

2008-05-01 Thread patcoll

fwiw, that's what Cake ACL does as well to reference different models
in one table

'model' -- references the cake model
'foreign_key' -- references the unique id to that model's table.

On May 1, 9:01 pm, Grant Cox <[EMAIL PROTECTED]> wrote:
> That's the way I do it, and have had no problems.  It is quite trivial
> to set up conditions on your associations, so that the associated rows
> are loaded automatically.
>
> On May 2, 9:52 am, validkeys <[EMAIL PROTECTED]> wrote:
>
> > Quick question..
>
> > I have a conversation going on between users and managers. users and
> > managers are 2 seperate tables but the conversation posts are held in
> > one table. When i reference the post i reference it by id and then
> > have a field called model. The model field would hold either the word
> > Manager or User depending on whether or not it was a user or manager
> > that posted to the conversation. I was wondering if anyone had a
> > better way to do this.
>
> > Feel free to shoot me down and make me feel small.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Unique ID that could be referencing more than one model

2008-05-01 Thread Grant Cox

That's the way I do it, and have had no problems.  It is quite trivial
to set up conditions on your associations, so that the associated rows
are loaded automatically.


On May 2, 9:52 am, validkeys <[EMAIL PROTECTED]> wrote:
> Quick question..
>
> I have a conversation going on between users and managers. users and
> managers are 2 seperate tables but the conversation posts are held in
> one table. When i reference the post i reference it by id and then
> have a field called model. The model field would hold either the word
> Manager or User depending on whether or not it was a user or manager
> that posted to the conversation. I was wondering if anyone had a
> better way to do this.
>
> Feel free to shoot me down and make me feel small.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Unique ID that could be referencing more than one model

2008-05-01 Thread Marcin Domanski

Maybe use uuid based primary key?  (char 36)

On Fri, May 2, 2008 at 1:52 AM, validkeys
<[EMAIL PROTECTED]> wrote:
>
>  Quick question..
>
>  I have a conversation going on between users and managers. users and
>  managers are 2 seperate tables but the conversation posts are held in
>  one table. When i reference the post i reference it by id and then
>  have a field called model. The model field would hold either the word
>  Manager or User depending on whether or not it was a user or manager
>  that posted to the conversation. I was wondering if anyone had a
>  better way to do this.
>
>  Feel free to shoot me down and make me feel small.
>  >
>



-- 
Marcin Domanski
http://kabturek.info

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



why does cache view keep on regenerating

2008-05-01 Thread robert123

I am using the latest  Cake build (1.2.0.6311 beta)

I have enable caching on my system by the two statement in the core
file

Configure::write('Cache.disable', false);
Configure::write('Cache.check', true);

The first time I accessed the url, a  cache view is generated in app
\tmp\cache\views.
But subsequently everytime I access same the url again, the same view
is regenerated again in the cache folder. The controller code is
executed and database is hit, Thus there is no improvement in
performance at all, anyone knows how to solve this issue? Thanks



www.generics.ws
www.genericsmed.com



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



Unique ID that could be referencing more than one model

2008-05-01 Thread validkeys

Quick question..

I have a conversation going on between users and managers. users and
managers are 2 seperate tables but the conversation posts are held in
one table. When i reference the post i reference it by id and then
have a field called model. The model field would hold either the word
Manager or User depending on whether or not it was a user or manager
that posted to the conversation. I was wondering if anyone had a
better way to do this.

Feel free to shoot me down and make me feel small.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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 Console issues

2008-05-01 Thread gmwebs

Sorry... forgot to tick save. Please see:

http://bin.cakephp.org/saved/31645
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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 Console issues

2008-05-01 Thread gmwebs

I am trying to figure out the Auth/Acl component and have started to
grasp how things *should* work, but am having problems creating Aros
with the console command.

Please would you have a look at http://bin.cakephp.org/view/2059927768
and provide any pointers?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: LEFT JOIN association type

2008-05-01 Thread KooT

On 1 Maj, 13:03, validkeys <[EMAIL PROTECTED]> wrote:
> Your film model belongs to your type model and your type model hasMany
> of your film model. So use those associations and you will get hwat
> you are looking.. let me know if that works for you

Yes, its working!
In Film model:

   var $belongsTo = array (
'Type' => array (
'className'  => 'Type',
'foreignKey' => 'type',
)
);

Now findAll() makes LEFT JOIN now. Thanks a lot for Your help!
--
RK
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Help with $this->Model->find('all')

2008-05-01 Thread [EMAIL PROTECTED]

Cake doesn't have an excellent way of doing this yet but grigri posted
this method the other day: 
http://groups.google.com/group/cake-php/browse_thread/thread/863305f8a7267067

which is a lot better than writing out the SQL by hand.

quoted (grigri):

I know nothing about using MySQL views, but I've never found it a
problem to filter/sort on deep associations.

The trick is to use dynamic associations - a temporary `hasOne`
instead of a `hasMany`, so that cakephp performs a join and you can
then filter inline in the query.

For example, let's assume that :

Post hasOne Author [class: User]
User hasOne Profile
Post hasAndBelongsToMany Tag [with: PostsTag]

And you want to find all posts written by a user with a [EMAIL PROTECTED]
email [in Profile] which is associated to either 'Bacon' or 'Eggs'
tags. You also want to order the results first by whether the Tag is
Bacon or Eggs, then by the Author's surname

[I'll do this manually here -- so you can see what's going on; there
are a lot of behaviors and extra code around to make it easier and
less verbose]

First, set up the dynamic bindings:

$this->Post->bindModel(array(
  'hasOne' => array(
'AuthorProfile' => array('className' => 'Profile', 'foreignKey' =>
false, 'conditions' => 'AuthorProfile.author_id=Author.id'),
'PostsTag1' => array('className' => 'PostsTag', 'foreignKey' =>
false, 'conditions' => 'PostsTag1.post_id=Post.id'),
'Tag1' => array('className' => 'Tag', 'foreignKey' => false,
'conditions' => 'PostsTag1.tag_id=Tag.id'),
  )
), false);

Now call findAll() with the conditions based on your previous keys:

$data = $this->Post->find('all', array(
  'fields' => 'Post.*, Author.*',
  'recursive' => 0, // This can be higher to fetch associated stuff,
of course [but not lower!]
  'conditions' => array('AuthorProfile.email' => 'LIKE
[EMAIL PROTECTED]',
'Tag1.tag' => array('Bacon', 'Eggs'), '1=1 GROUP BY Post.id'),
  'order' => array('(Tag1.tag = \'Bacon\') DESC', 'Author.surname
ASC')
));

And there ya go!

A few gotchas:

* You must either use the GROUP BY or a DISTINCT rowset to avoid
getting duplicate rows (e.g. if a Post was associated both with Bacon
and Eggs)
* If you're using paginate then don't forget the `false` parameter to
bindModel() or you'll be in trouble
* It's best to alias the dynamic joins distinctly from other
associations - hence the 'Tag1'.
* When performing multiple joins in a single query, make sure your
database tables are indexed properly. Use EXPLAIN SELECT with wild
abandon to get it fast and furious.

This is proof-of-concept only; in practice it's usually more efficient
to perform multiple queries than one giant one. Experiment away...

Anyway, hope this helps - and not too off-topic. Someone else can help
you out with using views, I'm sure.

On Apr 24, 6:49 pm, Sebastian Veggiani <[EMAIL PROTECTED]> wrote:

On May 1, 2:08 pm, clrockwell <[EMAIL PROTECTED]> wrote:
> I have two associated models - Newproduct hasMany Newproductimage -
>
> Ideally, I need to do a find that only returns the Newproductimage
> where 'newproductimage.thumbnail' is set to 1
>
> Doing:
> $conditions = array('Newproductimage.thumbnail' => 1)
> $this->Newproduct->find('all', array('conditions' => $conditions))
> searches through Newproduct for thumbnail, which does not exist.
>
> I know that I can rebuild the array with the returned results, but it
> seems like cake would handle this for me.
>
> Thanks for any tips.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Help with $this->Model->find('all')

2008-05-01 Thread clrockwell

I have two associated models - Newproduct hasMany Newproductimage -

Ideally, I need to do a find that only returns the Newproductimage
where 'newproductimage.thumbnail' is set to 1

Doing:
$conditions = array('Newproductimage.thumbnail' => 1)
$this->Newproduct->find('all', array('conditions' => $conditions))
searches through Newproduct for thumbnail, which does not exist.

I know that I can rebuild the array with the returned results, but it
seems like cake would handle this for me.

Thanks for any tips.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Looking for the Rapid in Cakephp

2008-05-01 Thread mbavio

This group doesnt allow you to speak badly about Mac! :P

No, seriously, have you tried some Mac development? I can asure you
that you wont go back never more to your PC.

And about writing HTML, it´s always about tastes, I love to write good
and semantic html, without any kind of helpers.

Cheers,
mbavio

On May 1, 3:37 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> >  Lol, if you want to write html fast, use some ide with autocomplete
> >  function, or the magic of Textmate. I dont see the benefits of using
> >  CakePHP in that cases. Seems to me like shooting to flies with canons.
>
> I do use an ide with autocomplete, just I don't like to write HTML, is
> just easier for *me* write it using CakePHP, it's a matter of taste.
> Btw, may the hell frozen before I use a Mac.
>
> >  Cheers,
> >  mbavio
>
> >  On Apr 30, 8:10 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> >  > >  Why on earth are you using CakePHP only for a form? Use PHP, and 5
> >  > >  minutes of your life.
>
> >  > Because he is trying to learn. And as a side note, I do use CakePHP
> >  > for everything I can, even when not using PHP, i.e. for writing HTML
> >  > forms and is really making my life easier. I really love CakePHP and
> >  > I've found I can write CakePHP faster than any other kind of code.
>
> >  > >  Cheers,
> >  > >  mbavio
> >  > >  mbavio.com.ar
>
> >  > >  On Apr 29, 1:20 pm, "John David Anderson (_psychic_)"
>
> >  > > <[EMAIL PROTECTED]> wrote:
> >  > >  > On Apr 29, 2008, at 10:15 AM, gstrock wrote:
>
> >  > >  > > thanks for the insight.
> >  > >  > > I think I'm just having a bad day.
> >  > >  > > I realize with everything there is
> >  > >  > > a learning curve.  I guess I just thought
> >  > >  > > it would be next to nothing for cake.  :-)
>
> >  > >  > > Actually, my project has 1 database with
> >  > >  > > 4 tables, so it's a good little task to try
> >  > >  > > cake out on, I think.
>
> >  > >  > > My perseverance machine just needs another
> >  > >  > > cup of coffee.   :-)
>
> >  > >  > The CakePHP IRC channel on freenode is another good resource.
> >  > >  > Sometimes it's good to have immediate help. I'm in there now if you
> >  > >  > want to work on this.
>
> >  > >  > #cakephp
>
> >  > >  > -- John
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Looking for the Rapid in Cakephp

2008-05-01 Thread Dardo Sordi Bogado

>  Lol, if you want to write html fast, use some ide with autocomplete
>  function, or the magic of Textmate. I dont see the benefits of using
>  CakePHP in that cases. Seems to me like shooting to flies with canons.

I do use an ide with autocomplete, just I don't like to write HTML, is
just easier for *me* write it using CakePHP, it's a matter of taste.
Btw, may the hell frozen before I use a Mac.


>  Cheers,
>  mbavio
>
>
>
>  On Apr 30, 8:10 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>  > >  Why on earth are you using CakePHP only for a form? Use PHP, and 5
>  > >  minutes of your life.
>  >
>  > Because he is trying to learn. And as a side note, I do use CakePHP
>  > for everything I can, even when not using PHP, i.e. for writing HTML
>  > forms and is really making my life easier. I really love CakePHP and
>  > I've found I can write CakePHP faster than any other kind of code.
>  >
>  > >  Cheers,
>  > >  mbavio
>  > >  mbavio.com.ar
>  >
>  > >  On Apr 29, 1:20 pm, "John David Anderson (_psychic_)"
>  >
>  > > <[EMAIL PROTECTED]> wrote:
>  > >  > On Apr 29, 2008, at 10:15 AM, gstrock wrote:
>  >
>  > >  > > thanks for the insight.
>  > >  > > I think I'm just having a bad day.
>  > >  > > I realize with everything there is
>  > >  > > a learning curve.  I guess I just thought
>  > >  > > it would be next to nothing for cake.  :-)
>  >
>  > >  > > Actually, my project has 1 database with
>  > >  > > 4 tables, so it's a good little task to try
>  > >  > > cake out on, I think.
>  >
>  > >  > > My perseverance machine just needs another
>  > >  > > cup of coffee.   :-)
>  >
>  > >  > The CakePHP IRC channel on freenode is another good resource.
>  > >  > Sometimes it's good to have immediate help. I'm in there now if you
>  > >  > want to work on this.
>  >
>  > >  > #cakephp
>  >
>  > >  > -- John
>  >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Database adding unwanted entries

2008-05-01 Thread [EMAIL PROTECTED]

There was abug with saving HABTM data a while back:

http://groups.google.com/group/cake-php/browse_thread/thread/2ad48c4e10f58fc0/c7c4511051071b52#c7c4511051071b52

not sure if it ever got fixed, but you might try out the suggested fix
and see if that helps.

On Apr 29, 5:28 pm, "b logica" <[EMAIL PROTECTED]> wrote:
> Yes, this is something that's come up before, though I can't remember
> the reason (nor the fix).
>
> You might want to check out this TagBehavior, though:
>
> http://bakery.cakephp.org/articles/view/simple-tagging-behavior
>
> On Mon, Apr 28, 2008 at 11:04 PM, AussieFreelancer
>
> <[EMAIL PROTECTED]> wrote:
>
> >  Hi all, I'm sure this must be me, but I can't see what I am doing
> >  wrong so thought I would post here.
>
> >  I am trying to set up a posts/tags kind of thing with a site I am
> >  building which stores presentations. So there can be tags associated
> >  with a presentation.
>
> >  I didn't want a multiple select box for the tags as there could be
> >  hundreds, and that wouldn't allow for adding new ones.
>
> >  So I have a text field, that the user can enter the keywords,
> >  separated with a coma.
>
> >  In my controller, I first remove any entries in the presentations_tags
> >  table, so that it is not associated with any tags.
>
> >  Then I split the value of the field, trim off white space, then loop
> >  through each tag (case insensitive) that has been submitted.
>
> >  If the tag exists, I update the presentations_tags table with the
> >  id's.
>
> >  If the tag does not exist, I first insert it in to the tags table,
> >  then using getLastInsertId() I proceed to update the
> >  presentations_tags table.
>
> >  Everything works, and does what I am asking it to, except that in the
> >  case of a tag not existing, it ALSO adds 4 entries for each tag.
>
> >  These entries always have the id of the tag in the tag_id field, but
> >  they also have the following presentation_id's:
>
> >  0, 2, 3, 10
>
> >  All 4 of these are additional to the desired result, and they always
> >  follow this pattern. If I add two new tags, I have 8 added, 4 for each
> >  tag, and they all follow the above pattern.
>
> >  This is the code I am using for when the tag isnt found:
>
> >  --- CODE
> >  ---
>
> >  //insert new tag
> >  $this->data['Tag']['name'] = $tag;
> >  $this->Tag->create();
> >  $this->Tag->save($this->data);
>
> >  //get insert id
> >  $last_insert_id = $this->Tag->getLastInsertId();
>
> >  //update presentations_tags
> >  $this->data['PresentationsTag']['presentation_id'] = $id;
> >  $this->data['PresentationsTag']['tag_id'] = $last_insert_id;
>
> >  $this->PresentationsTag->create();
> >  $this->PresentationsTag->save($this->data);
>
> >  --
>
> >  Has this been experienced before? I cant see any reason for it.
>
> >  As a sidenote, I have created a model for the presentations_tags table
> >  so that I can achieve what I am after.
>
> >  Any help would be greatly appreciated.
>
> >  Many Thanks
>
> >  Patrick
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Looking for the Rapid in Cakephp

2008-05-01 Thread [EMAIL PROTECTED]

I love the little t-rex next to the login link awesome.

On May 1, 6:56 am, validkeys <[EMAIL PROTECTED]> wrote:
> depending on your needs with this form as well, i would try something
> likehttp://www.wufoo.com
>
> its a pretty great application and form builder.
>
> On May 1, 5:41 am, mbavio <[EMAIL PROTECTED]> wrote:
>
> > I was talking just about XHTML code and some simple forms... If you
> > are going to grow so much, of course, use CakePHP, but that is a
> > matter of application design.
>
> > Cheers,
> > mbavio
>
> > On May 1, 5:58 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
>
> > > But these flies could mutate into giant-human-eating-flies and what
> > > will you do? throw mysql_connect at them ? ;)  I'm using cake for
> > > simple stuff too, i hate when i have to maintain some crazy-spaghetti
> > > code (for italian peopl - belive it or not but spaghetti here isn't
> > > good ;)
>
> > > On Thu, May 1, 2008 at 4:40 AM, mbavio <[EMAIL PROTECTED]> wrote:
>
> > > >  Lol, if you want to write html fast, use some ide with autocomplete
> > > >  function, or the magic of Textmate. I dont see the benefits of using
> > > >  CakePHP in that cases. Seems to me like shooting to flies with canons.
>
> > > >  Cheers,
> > > >  mbavio
>
> > > >  On Apr 30, 8:10 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> > > >  > >  Why on earth are you using CakePHP only for a form? Use PHP, and 5
> > > >  > >  minutes of your life.
>
> > > >  > Because he is trying to learn. And as a side note, I do use CakePHP
> > > >  > for everything I can, even when not using PHP, i.e. for writing HTML
> > > >  > forms and is really making my life easier. I really love CakePHP and
> > > >  > I've found I can write CakePHP faster than any other kind of code.
>
> > > >  > >  Cheers,
> > > >  > >  mbavio
> > > >  > >  mbavio.com.ar
>
> > > >  > >  On Apr 29, 1:20 pm, "John David Anderson (_psychic_)"
>
> > > >  > > <[EMAIL PROTECTED]> wrote:
> > > >  > >  > On Apr 29, 2008, at 10:15 AM, gstrock wrote:
>
> > > >  > >  > > thanks for the insight.
> > > >  > >  > > I think I'm just having a bad day.
> > > >  > >  > > I realize with everything there is
> > > >  > >  > > a learning curve.  I guess I just thought
> > > >  > >  > > it would be next to nothing for cake.  :-)
>
> > > >  > >  > > Actually, my project has 1 database with
> > > >  > >  > > 4 tables, so it's a good little task to try
> > > >  > >  > > cake out on, I think.
>
> > > >  > >  > > My perseverance machine just needs another
> > > >  > >  > > cup of coffee.   :-)
>
> > > >  > >  > The CakePHP IRC channel on freenode is another good resource.
> > > >  > >  > Sometimes it's good to have immediate help. I'm in there now if 
> > > > you
> > > >  > >  > want to work on this.
>
> > > >  > >  > #cakephp
>
> > > >  > >  > -- John
>
> > > --
> > > Marcin Domanskihttp://kabturek.info
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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 css files

2008-05-01 Thread Sliv

which site are you talking about, and why can't you grab the links
from the page source?

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

2008-05-01 Thread Samuel DeVore

like this?  http://cakeforge.org/themes/cake/css/forge.css



On Thu, May 1, 2008 at 8:19 AM, Carl <[EMAIL PROTECTED]> wrote:
>
>  Anybody know where I can find copies of the css files used on the
>  CakePHP site (forge.css, legacy.css, etc.) ?
>  >
>



-- 
-- 
(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/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

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



Re: Can cake do this or am I asking too much

2008-05-01 Thread Flipflops

Hi JoC

For me one of the things I like most about cake isn't so much managing
all the associations (although that is very nice (indeed)) it is the
fact that the rigid MVC structure makes it easy to find bits of code
because everything has its own place in the structure and is logically
organised.

I think one of the main benefits is just that you don't 'loose' bits
of code - if things aren't where you think they would be they are
normally pretty easy to find (e.g. just moved into a component /
element / helper etc.)

John

On Apr 29, 3:10 pm, JoC <[EMAIL PROTECTED]> wrote:
> Hello all,
> I am trying to write a maintenance software for a generator
> distributing company.
> The company works the following way
>
> 1 site has many generators
> 1 generators has 1 manufacturer and many parts
> 1 part has many generators
> 1 manufacturer has many generators and many models
> 1 model has one manufacturer
> 1 part works for many generators
> 1 manufacturer makes many models
> .
> .
> .
>
> Anyways as you can see is a very complex system. To which then we will
> add work orders, maintenance, etc..
> My questions is, will cake PHP make my life easier or harder I have
> been working with it for about 1 week and so far its been ok until I
> introduced the above concept today of many parts to many generators
> etc then it got really complex.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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 css files

2008-05-01 Thread Carl

Anybody know where I can find copies of the css files used on the
CakePHP site (forge.css, legacy.css, etc.) ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: accents not working with __()

2008-05-01 Thread Ithaka

Correction to my previous post: (était = & #233tait (without space))

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



Re: Can cake do this or am I asking too much

2008-05-01 Thread [EMAIL PROTECTED]

"HABTM is only meant for 2 entities. How can you tell
cake to handle a relationship of more than 2 entities (i.e. the join
table has 3 or more foreign keys)?"

You can access more fields in a HABTM join table using the "with" key
in the HABTM relationship definition. I've only used extra fields in a
join table to contain meta data about the relationship though, not
additional foreign keys. You bring up a good point, creating a 3 Model
join would be tricky at best using HABTM, It would be tricky any way
you implement it. You could use "with" property to join the 3rd model,
but if this were the case, you could ony retrieve the id, you couldn't
get at the 3rd model recursively. If you defined the 3 join table as a
model, then you'd be able to get at the data recursively, but you'd
run into the data validation problems I mentioned above.

On May 1, 1:31 am, zonium <[EMAIL PROTECTED]> wrote:
> 1. Many times I create a complete MVC for the join table, especially
> when I need to build complicated/flexible admin interfaces to work
> directly with additional fields in the join table.
> 2. I am not sure if cake can handle compound primary key of more than
> 2 foreign keys. HABTM is only meant for 2 entities. How can you tell
> cake to handle a relationship of more than 2 entities (i.e. the join
> table has 3 or more foreign keys)?
>
> Zonium
>
> On 30 Tháng Tư, 15:23, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > The only real downsides I can see other than complicated code is that
> > join tables will have a compound primary key which I don't think cake
> > can handle very well (ie a primary key of (user_id,post_id)). if
> > instead you use a primary key of id to get around this, and use
> > user_id and post_id as just regular fields, you could very easily end
> > up with duplicate data in your table if you aren't careful(ie two rows
> > where id is different but user_id, post_id are the same). This will
> > cause even more problems when you are trying to delete the M2M
> > relationship, if there are multiple entries for the relationship, when
> > you delete one the others will remain. Also, if you have related data
> > in the join table and you try to grab it by finding the join table
> > entry where user_id=$desiredUID AND post_id=$desiredPID, if there are
> > multiple entries in the table that satisfy these conditions, then the
> > data pulled may be incorrect. This seems like a data validation
> > nightmare to me and using Cakes HABTM relationship takes care of all
> > of these problems.
>
> > Also, I don't see why you'd ever want a controller functions for a
> > join table though. The only time you'd need controller functions for a
> > join table is if you were rendering a view for the join table and
> > you'd definitely never want to do that. If you really wanted functions
> > relating to the join table, they should be defined in the model of the
> > related table and called from the controller that will be rendering
> > the view.
>
> > Restating though, Any data that is related to the join table can be
> > accessesed through a related model using the "with" function so any
> > functions acting on the join table data could be easily implemented in
> > the related Model.
>
> > On Apr 30, 3:57 pm, validkeys <[EMAIL PROTECTED]> wrote:
>
> > > I did it the way that i did it so that I could write controller
> > > actions in the join table controller vs. in the relational tables. I
> > > guess you could just write those actions in the M2M controllers, but
> > > is it not cleaner to write those controller actions directly in the
> > > controller of the join table? Also, it keeps it clean with regards to
> > > creating custom model queries for the join table.
>
> > > David, as we are all trying to learn here, are their any definite
> > > downsides to the way that I am doing it besides the output data?
>
> > > Thanks!
>
> > > On Apr 30, 5:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > The way that validkeys describes is the exact same way that CakePHP
> > > > implements a HABTM relationship. It uses a join table just as
> > > > described. There really is no need to do it the way validkeys
> > > > describes, you don't need a controller and model for the join table,
> > > > it will just make your output data and query conditions that much more
> > > > complicated. If you need to get at extra data in the join table (data
> > > > other than the primary key) use the "with" key in the HABTM
> > > > relationship definition.
>
> > > > On Apr 30, 2:58 pm, validkeys <[EMAIL PROTECTED]> wrote:
>
> > > > > JoC,
>
> > > > > HABTM are good, but another way that I have been modeling M2M
> > > > > relationships is the following:
>
> > > > > assume we had students and classes. One class has many students and
> > > > > one student is in many classes
>
> > > > > classes --> | classes_students | <-- students
>
> > > > > 1. create tables for classes, classes_students and students
> > > > > 2.

Re: Inserting records via a model

2008-05-01 Thread Dovdimus Prime

Ah thanks. I needed to call create first.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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 app without a View?

2008-05-01 Thread validkeys

The following is my ASSUMPTION

When your non-cake app request XML info from your cake app, it is
basically requesting a page with XML. In your posts controller, you
would run your find all query and then pass it to the view. In the
view you would construct your XML. When your requesting app went to
(example) yourapp.com/posts/returnMyXML, the view would render the XML
and the requesting app would now have what it asked for.

Read up on the XML services regarding the view path and using the XML
requestHandler.

Hope that helps.

On May 1, 9:34 am, PST <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am trying to use CakePHP to create some basic webservices. I have an
> application that I would like to request data from a CakePHP
> webservice. For example, a basic findAll() performed on the posts
> table from the CakePHP tutorial, would need to pass back the records
> in XML format to the requesting app.
>
> How would this be done? Do I need to create a view?
>
> The code from the tutorial is as follows:
>  class PostsController extends AppController {
>
> var $name = 'Posts';
>
> function index() {
> $this->set('posts', $this->Post->findAll());
> }}
>
> ?>
>
> How do I store the results of the $this->Post->findAll() without
> sending it to the view?
>
> Cheers, Phil.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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 app without a View?

2008-05-01 Thread PST

Hello,

I am trying to use CakePHP to create some basic webservices. I have an
application that I would like to request data from a CakePHP
webservice. For example, a basic findAll() performed on the posts
table from the CakePHP tutorial, would need to pass back the records
in XML format to the requesting app.

How would this be done? Do I need to create a view?

The code from the tutorial is as follows:
set('posts', $this->Post->findAll());
}
}
?>

How do I store the results of the $this->Post->findAll() without
sending it to the view?

Cheers, Phil.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Inserting records via a model

2008-05-01 Thread validkeys

If you are doing all of this in your prompt model, you dont need to
specify $this->Prompt.

Try this:


if(!empty($this->data)){

$this->create();
if($this->save($this->data)){
return true;
}else{
return false;
}

}

On May 1, 9:23 am, Dovdimus Prime <[EMAIL PROTECTED]> wrote:
> Hi there
>
> I'm having difficulty inserting a new record. Documentation is pretty
> thin on the ground.
>
> My 'prompts' table has an autogenerated id, and a content field.
>
> In the Prompt controller I am making the following call to the Prompt
> model:
>
> $this->Prompt->id = null;
> $this->Prompt->save(array('Prompt' => array('content' => 'Something
> here')));
>
> My understanding is that if no id is supplied, Cake will automatically
> insert rather than update.
>
> I'm not sure if the first line ($this->Prompt->id = null;) is even
> necessary, since the following line supplies an array with no id
> anyway.
>
> The code is not inserting a record. It's not erroring, it's not doing
> anything at all. I have tested that the code block it is in is being
> executed.
>
> Can anyone make any suggestions?
>
> Thanks
>
> David
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Inserting records via a model

2008-05-01 Thread Dovdimus Prime

Hi there

I'm having difficulty inserting a new record. Documentation is pretty
thin on the ground.

My 'prompts' table has an autogenerated id, and a content field.

In the Prompt controller I am making the following call to the Prompt
model:

$this->Prompt->id = null;
$this->Prompt->save(array('Prompt' => array('content' => 'Something
here')));

My understanding is that if no id is supplied, Cake will automatically
insert rather than update.

I'm not sure if the first line ($this->Prompt->id = null;) is even
necessary, since the following line supplies an array with no id
anyway.

The code is not inserting a record. It's not erroring, it's not doing
anything at all. I have tested that the code block it is in is being
executed.

Can anyone make any suggestions?

Thanks

David
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Looking for the Rapid in Cakephp

2008-05-01 Thread validkeys

depending on your needs with this form as well, i would try something
like http://www.wufoo.com

its a pretty great application and form builder.

On May 1, 5:41 am, mbavio <[EMAIL PROTECTED]> wrote:
> I was talking just about XHTML code and some simple forms... If you
> are going to grow so much, of course, use CakePHP, but that is a
> matter of application design.
>
> Cheers,
> mbavio
>
> On May 1, 5:58 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
>
> > But these flies could mutate into giant-human-eating-flies and what
> > will you do? throw mysql_connect at them ? ;)  I'm using cake for
> > simple stuff too, i hate when i have to maintain some crazy-spaghetti
> > code (for italian peopl - belive it or not but spaghetti here isn't
> > good ;)
>
> > On Thu, May 1, 2008 at 4:40 AM, mbavio <[EMAIL PROTECTED]> wrote:
>
> > >  Lol, if you want to write html fast, use some ide with autocomplete
> > >  function, or the magic of Textmate. I dont see the benefits of using
> > >  CakePHP in that cases. Seems to me like shooting to flies with canons.
>
> > >  Cheers,
> > >  mbavio
>
> > >  On Apr 30, 8:10 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> > >  > >  Why on earth are you using CakePHP only for a form? Use PHP, and 5
> > >  > >  minutes of your life.
>
> > >  > Because he is trying to learn. And as a side note, I do use CakePHP
> > >  > for everything I can, even when not using PHP, i.e. for writing HTML
> > >  > forms and is really making my life easier. I really love CakePHP and
> > >  > I've found I can write CakePHP faster than any other kind of code.
>
> > >  > >  Cheers,
> > >  > >  mbavio
> > >  > >  mbavio.com.ar
>
> > >  > >  On Apr 29, 1:20 pm, "John David Anderson (_psychic_)"
>
> > >  > > <[EMAIL PROTECTED]> wrote:
> > >  > >  > On Apr 29, 2008, at 10:15 AM, gstrock wrote:
>
> > >  > >  > > thanks for the insight.
> > >  > >  > > I think I'm just having a bad day.
> > >  > >  > > I realize with everything there is
> > >  > >  > > a learning curve.  I guess I just thought
> > >  > >  > > it would be next to nothing for cake.  :-)
>
> > >  > >  > > Actually, my project has 1 database with
> > >  > >  > > 4 tables, so it's a good little task to try
> > >  > >  > > cake out on, I think.
>
> > >  > >  > > My perseverance machine just needs another
> > >  > >  > > cup of coffee.   :-)
>
> > >  > >  > The CakePHP IRC channel on freenode is another good resource.
> > >  > >  > Sometimes it's good to have immediate help. I'm in there now if 
> > > you
> > >  > >  > want to work on this.
>
> > >  > >  > #cakephp
>
> > >  > >  > -- John
>
> > --
> > Marcin Domanskihttp://kabturek.info
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Model conditions using session variable

2008-05-01 Thread validkeys

thanks zaboo. I guess what i was trying to figure out was:

If in every query on the users table I need to put the condition that
the user or users returned must belong to the session company, it
seems a bit repetetive and therefore was trying to place that
condition on the model to save me some typing time. Know what i mean?

On Apr 30, 10:23 pm, zaboo <[EMAIL PROTECTED]> wrote:
> You can use an array to specify conditions on 
> searcheshttp://manual.cakephp.org/view/449/find/
>
> $users = $this->Model->findAll(array('User.companies_id' =>
> $_SESSION['user']));
>
> $users = $this->Model->find('list', array('conditions' =>
> array('User.companies_id' => $_SESSION['user'])));
>
> You may also want to look into the Session Component.
>
> Good luck!
>
> On Apr 30, 10:09 pm, validkeys <[EMAIL PROTECTED]>
> wrote:
>
> > Lets say that i have a model company and a model employees. A company
> > has many employees. If I want to specify in the user model the
> > following condition:
>
> > 'condition' => 'User.companies_id = ' . $_SESSION['user']
> > ['companies_id']
>
> > I get an error that PHP wasn't expecting the period. This would be
> > useful (I THINK) from a data security standpoint in that all queries
> > using the user and company model would limit the users return to users
> > with the current user's company id.
>
> > What am I doing wrong here? Is this even going to do what i want it
> > to?
>
> > Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Simple MVC Question

2008-05-01 Thread validkeys

Hey Annie, I had similar problems when I started and still have
problems sometimes (although less often now) regarding where things go
and try to stick to the MVC architecture. This is sort of what i think
about when i have this problem.

1. If i am doing a complicated query (more than one condition) or a
query that i will call from more than one controller action, I put it
in the model. So pretty much anything more complicated than $this-
>Book->read(null,$id);

2. Any business logic regarding how to order my array of data, i put
in the controller

3. I put all of the HTML in the view file and any "display logic" like
if an array is empty, show an error message otherwise loop through my
data array and create my table.


So complicated and reuseable queries go in the model. Any logic that I
need to apply to the data passed from the model goes in the controller
and then any html and display logic in the view file

On May 1, 5:27 am, "annie.r.knight" <[EMAIL PROTECTED]>
wrote:
> Thanks again,
>
> It's starting to make sense now -- switching views depending on the
> result of the validation wasn't something I was really contemplating
> but I see how that would be a cleaner solution. I may be on IRC later
> to confirm my understanding!
>
> Much appreciated.
>
> On May 1, 10:10 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
>
> > if you do it my way - the error message from the validate array will
> > be put under the dropdown on the same page.
> > in the action there would be something similar to bake generates but
> > with $this->Model->validates() iinstead of save()
> > if it valdiates - show the other view with the table
>
> > you can come to the irc channel #cakephp for some help
>
> > On Thu, May 1, 2008 at 11:00 AM, annie.r.knight
>
> > <[EMAIL PROTECTED]> wrote:
>
> > >  Thanks for the quick reply.
>
> > >  I'm not sure whether that solves my problem: I'm okay with selecting
> > >  which output to produce, my problem is in the construction of the
> > >  books table/warning message. Where does this occur?
>
> > >  What I've got at the moment is something like this in the view:
>
> > >  if(!$showtable) {
> > >   // display the warning message
> > >  }
> > >  else {
> > >   // show the books table
> > >  }
>
> > >  The alternative, as I see it, would be to set the variable
> > >  $tableoutput in the controller to contain either the message or the
> > >  table and simply to echo that in the view.
>
> > >  With the first example I'm including logic in the view, with the
> > >  second I'm including presentation in the controller. I assume that,
> > >  since this isn't business logic, the first method is the correct one.
>
> > >  Is there a better way? I imagine so.
>
> > >  On May 1, 9:46 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
> > >  > Hey,
> > >  > From what you said you want to make a validation rule like >0 (if 0 is
> > >  > the value of ---please select a genre---) and Model::validate() it
> > >  > (you probably dont want to save it), if it valdiates - show the books
>
> > >  > On Thu, May 1, 2008 at 9:54 AM, annie.r.knight
>
> > > > <[EMAIL PROTECTED]> wrote:
>
> > >  > >  ... at least I hope it's simple for you guys. Clearly it's not 
> > > simple
> > >  > >  for me otherwise I wouldn't be asking here. I'm using 1.2.
>
> > >  > >  I'm trying to get the structure of my app 'right' in terms of MVC
> > >  > >  execution flow (and CakePHP's implementation of this flow). Here's 
> > > my
> > >  > >  situation:
>
> > >  > >  I've got a page where a drop-down menu offers a number of options
> > >  > >  relating to, say, the genre of books available in a small library. 
> > > The
> > >  > >  user chooses the genre from this drop-down and is then presented 
> > > with
> > >  > >  a table data relating to the individual books in that genre.
>
> > >  > >  All easy-peasy coding. In the past (pre-MVC) I would simply have
> > >  > >  included some logic in the page to say: if there is no genre 
> > > selected,
> > >  > >  then output a message telling user to select one; if there is then
> > >  > >  output the books in a nice table. This would, as I understand it, by
> > >  > >  an incorrect in terms of MVC.
>
> > >  > >  So here's my quandry.
>
> > >  > >  Do I 'set' the entire text of the table/user message in the
> > >  > >  controller, then output it as a simple $variable in the view? The
> > >  > >  disadvantage of this view would be that I need to include
> > >  > >  presentational logic when making the table/message within the
> > >  > >  controller.
>
> > >  > >  I've got a feeling there's a cleaner solution! Please advise!
>
> > >  > --
> > >  > Marcin Domanskihttp://kabturek.info
>
> > --
> > Marcin Domanskihttp://kabturek.info
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED

Re: simulating subdomains with the router rules?

2008-05-01 Thread validkeys

this is what i use for my subdomains:

if(!isset($_GET['url'])){
$_GET['url'] = '/';
}

if (env("HTTP_HOST") == "admin.mydomain.com") {
$_GET["url"] = "admin/" . $_GET["url"];
}elseif(env("HTTP_HOST") == "admin.mydomain"){
if(!isset($_GET['url'])){
$_GET['url'] = "/";
}
$_GET["url"] = "admin/" . $_GET["url"];
}elseif (strpos($_GET["url"], "admin") === 0) {
header ("HTTP/1.0 404 Not Found");
die();
}


Put that in bootstrap.php


2. Then explode your $_GET[url] to find the subdomain.

That should be all you need

just make sure to set up a wildcard DNS entry for your domain

On May 1, 7:00 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
> please search, there is a bakery article with great comments and a lot
> f resources in this group.
>
> On Thu, May 1, 2008 at 12:50 PM, Kupe3 <[EMAIL PROTECTED]> wrote:
>
> >  Hi
> >  i have companies controler, so i have
> >  site.com/companies/details/company_name
> >  but now they want to have subdomains for each company, so it should
> >  accept links like
> >  http://company_name.site.comand redirects 
> > tohttp://site.com/companies/details/company_name
> >  As i am not expirienced in regex and writing router rules, i would ask
> >  for some help
>
> >  thanks in advance
>
> --
> Marcin Domanskihttp://kabturek.info
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: LEFT JOIN association type

2008-05-01 Thread validkeys

in you wouldn't use left join explicity. cake will use left join to
query your data.

Your film model belongs to your type model and your type model hasMany
of your film model. So use those associations and you will get hwat
you are looking.. let me know if that works for you

On May 1, 4:09 am, KooT <[EMAIL PROTECTED]> wrote:
> How to make this query below, with one of this association type:
> hasOne, hasMany ,belongsTo, hasAndBelongsToMany ? Its just one simple
> LEFT JOIN, but i cant figure out how to make it...
>
> function getData() {
>   $ret = $this->query("SELECT films.id, films.title, films.body,
> films.pubdate, types.name as type ".
>   "FROM films films ".
>   "LEFT JOIN types types on
> films.type=types.id ORDER by films.id DESC");
>   return $ret;
>
> }
>
> --
> RK
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: simulating subdomains with the router rules?

2008-05-01 Thread Marcin Domanski

please search, there is a bakery article with great comments and a lot
f resources in this group.

On Thu, May 1, 2008 at 12:50 PM, Kupe3 <[EMAIL PROTECTED]> wrote:
>
>  Hi
>  i have companies controler, so i have
>  site.com/companies/details/company_name
>  but now they want to have subdomains for each company, so it should
>  accept links like
>  http://company_name.site.com and redirects to 
> http://site.com/companies/details/company_name
>  As i am not expirienced in regex and writing router rules, i would ask
>  for some help
>
>  thanks in advance
>  >
>



-- 
Marcin Domanski
http://kabturek.info

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



simulating subdomains with the router rules?

2008-05-01 Thread Kupe3

Hi
i have companies controler, so i have
site.com/companies/details/company_name
but now they want to have subdomains for each company, so it should
accept links like
http://company_name.site.com and redirects to 
http://site.com/companies/details/company_name
As i am not expirienced in regex and writing router rules, i would ask
for some help

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



JSObject Exception

2008-05-01 Thread oana

Hello,

In my .php file I am trying to use an applet which calls
JSObject.getWindow(this);

I keep getting this:

netscape.javascript.JSException
at netscape.javascript.JSObject.getWindow(Unknown Source)

When i test the applet alone (not in the cake suite it wotks perfect).
I added to the helpers in the controller the Javascript and the Embed
helper, and nothing.

Did anybody face this problem? How can i solve it?

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



LEFT JOIN association type

2008-05-01 Thread KooT

How to make this query below, with one of this association type:
hasOne, hasMany ,belongsTo, hasAndBelongsToMany ? Its just one simple
LEFT JOIN, but i cant figure out how to make it...

function getData() {
  $ret = $this->query("SELECT films.id, films.title, films.body,
films.pubdate, types.name as type ".
  "FROM films films ".
  "LEFT JOIN types types on
films.type=types.id ORDER by films.id DESC");
  return $ret;
}

--
RK

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Looking for the Rapid in Cakephp

2008-05-01 Thread mbavio

I was talking just about XHTML code and some simple forms... If you
are going to grow so much, of course, use CakePHP, but that is a
matter of application design.

Cheers,
mbavio

On May 1, 5:58 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
> But these flies could mutate into giant-human-eating-flies and what
> will you do? throw mysql_connect at them ? ;)  I'm using cake for
> simple stuff too, i hate when i have to maintain some crazy-spaghetti
> code (for italian peopl - belive it or not but spaghetti here isn't
> good ;)
>
>
>
> On Thu, May 1, 2008 at 4:40 AM, mbavio <[EMAIL PROTECTED]> wrote:
>
> >  Lol, if you want to write html fast, use some ide with autocomplete
> >  function, or the magic of Textmate. I dont see the benefits of using
> >  CakePHP in that cases. Seems to me like shooting to flies with canons.
>
> >  Cheers,
> >  mbavio
>
> >  On Apr 30, 8:10 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> >  > >  Why on earth are you using CakePHP only for a form? Use PHP, and 5
> >  > >  minutes of your life.
>
> >  > Because he is trying to learn. And as a side note, I do use CakePHP
> >  > for everything I can, even when not using PHP, i.e. for writing HTML
> >  > forms and is really making my life easier. I really love CakePHP and
> >  > I've found I can write CakePHP faster than any other kind of code.
>
> >  > >  Cheers,
> >  > >  mbavio
> >  > >  mbavio.com.ar
>
> >  > >  On Apr 29, 1:20 pm, "John David Anderson (_psychic_)"
>
> >  > > <[EMAIL PROTECTED]> wrote:
> >  > >  > On Apr 29, 2008, at 10:15 AM, gstrock wrote:
>
> >  > >  > > thanks for the insight.
> >  > >  > > I think I'm just having a bad day.
> >  > >  > > I realize with everything there is
> >  > >  > > a learning curve.  I guess I just thought
> >  > >  > > it would be next to nothing for cake.  :-)
>
> >  > >  > > Actually, my project has 1 database with
> >  > >  > > 4 tables, so it's a good little task to try
> >  > >  > > cake out on, I think.
>
> >  > >  > > My perseverance machine just needs another
> >  > >  > > cup of coffee.   :-)
>
> >  > >  > The CakePHP IRC channel on freenode is another good resource.
> >  > >  > Sometimes it's good to have immediate help. I'm in there now if you
> >  > >  > want to work on this.
>
> >  > >  > #cakephp
>
> >  > >  > -- John
>
> --
> Marcin Domanskihttp://kabturek.info
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Simple MVC Question

2008-05-01 Thread annie.r.knight

Thanks again,

It's starting to make sense now -- switching views depending on the
result of the validation wasn't something I was really contemplating
but I see how that would be a cleaner solution. I may be on IRC later
to confirm my understanding!

Much appreciated.

On May 1, 10:10 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
> if you do it my way - the error message from the validate array will
> be put under the dropdown on the same page.
> in the action there would be something similar to bake generates but
> with $this->Model->validates() iinstead of save()
> if it valdiates - show the other view with the table
>
> you can come to the irc channel #cakephp for some help
>
> On Thu, May 1, 2008 at 11:00 AM, annie.r.knight
>
>
>
> <[EMAIL PROTECTED]> wrote:
>
> >  Thanks for the quick reply.
>
> >  I'm not sure whether that solves my problem: I'm okay with selecting
> >  which output to produce, my problem is in the construction of the
> >  books table/warning message. Where does this occur?
>
> >  What I've got at the moment is something like this in the view:
>
> >  if(!$showtable) {
> >   // display the warning message
> >  }
> >  else {
> >   // show the books table
> >  }
>
> >  The alternative, as I see it, would be to set the variable
> >  $tableoutput in the controller to contain either the message or the
> >  table and simply to echo that in the view.
>
> >  With the first example I'm including logic in the view, with the
> >  second I'm including presentation in the controller. I assume that,
> >  since this isn't business logic, the first method is the correct one.
>
> >  Is there a better way? I imagine so.
>
> >  On May 1, 9:46 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
> >  > Hey,
> >  > From what you said you want to make a validation rule like >0 (if 0 is
> >  > the value of ---please select a genre---) and Model::validate() it
> >  > (you probably dont want to save it), if it valdiates - show the books
>
> >  > On Thu, May 1, 2008 at 9:54 AM, annie.r.knight
>
> > > <[EMAIL PROTECTED]> wrote:
>
> >  > >  ... at least I hope it's simple for you guys. Clearly it's not simple
> >  > >  for me otherwise I wouldn't be asking here. I'm using 1.2.
>
> >  > >  I'm trying to get the structure of my app 'right' in terms of MVC
> >  > >  execution flow (and CakePHP's implementation of this flow). Here's my
> >  > >  situation:
>
> >  > >  I've got a page where a drop-down menu offers a number of options
> >  > >  relating to, say, the genre of books available in a small library. The
> >  > >  user chooses the genre from this drop-down and is then presented with
> >  > >  a table data relating to the individual books in that genre.
>
> >  > >  All easy-peasy coding. In the past (pre-MVC) I would simply have
> >  > >  included some logic in the page to say: if there is no genre selected,
> >  > >  then output a message telling user to select one; if there is then
> >  > >  output the books in a nice table. This would, as I understand it, by
> >  > >  an incorrect in terms of MVC.
>
> >  > >  So here's my quandry.
>
> >  > >  Do I 'set' the entire text of the table/user message in the
> >  > >  controller, then output it as a simple $variable in the view? The
> >  > >  disadvantage of this view would be that I need to include
> >  > >  presentational logic when making the table/message within the
> >  > >  controller.
>
> >  > >  I've got a feeling there's a cleaner solution! Please advise!
>
> >  > --
> >  > Marcin Domanskihttp://kabturek.info
>
> --
> Marcin Domanskihttp://kabturek.info
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Simple MVC Question

2008-05-01 Thread Marcin Domanski

if you do it my way - the error message from the validate array will
be put under the dropdown on the same page.
in the action there would be something similar to bake generates but
with $this->Model->validates() iinstead of save()
if it valdiates - show the other view with the table

you can come to the irc channel #cakephp for some help

On Thu, May 1, 2008 at 11:00 AM, annie.r.knight
<[EMAIL PROTECTED]> wrote:
>
>  Thanks for the quick reply.
>
>  I'm not sure whether that solves my problem: I'm okay with selecting
>  which output to produce, my problem is in the construction of the
>  books table/warning message. Where does this occur?
>
>  What I've got at the moment is something like this in the view:
>
>  if(!$showtable) {
>   // display the warning message
>  }
>  else {
>   // show the books table
>  }
>
>  The alternative, as I see it, would be to set the variable
>  $tableoutput in the controller to contain either the message or the
>  table and simply to echo that in the view.
>
>  With the first example I'm including logic in the view, with the
>  second I'm including presentation in the controller. I assume that,
>  since this isn't business logic, the first method is the correct one.
>
>  Is there a better way? I imagine so.
>
>
>
>  On May 1, 9:46 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
>  > Hey,
>  > From what you said you want to make a validation rule like >0 (if 0 is
>  > the value of ---please select a genre---) and Model::validate() it
>  > (you probably dont want to save it), if it valdiates - show the books
>  >
>  > On Thu, May 1, 2008 at 9:54 AM, annie.r.knight
>  >
>  >
>  >
>
> > <[EMAIL PROTECTED]> wrote:
>  >
>  > >  ... at least I hope it's simple for you guys. Clearly it's not simple
>  > >  for me otherwise I wouldn't be asking here. I'm using 1.2.
>  >
>  > >  I'm trying to get the structure of my app 'right' in terms of MVC
>  > >  execution flow (and CakePHP's implementation of this flow). Here's my
>  > >  situation:
>  >
>  > >  I've got a page where a drop-down menu offers a number of options
>  > >  relating to, say, the genre of books available in a small library. The
>  > >  user chooses the genre from this drop-down and is then presented with
>  > >  a table data relating to the individual books in that genre.
>  >
>  > >  All easy-peasy coding. In the past (pre-MVC) I would simply have
>  > >  included some logic in the page to say: if there is no genre selected,
>  > >  then output a message telling user to select one; if there is then
>  > >  output the books in a nice table. This would, as I understand it, by
>  > >  an incorrect in terms of MVC.
>  >
>  > >  So here's my quandry.
>  >
>  > >  Do I 'set' the entire text of the table/user message in the
>  > >  controller, then output it as a simple $variable in the view? The
>  > >  disadvantage of this view would be that I need to include
>  > >  presentational logic when making the table/message within the
>  > >  controller.
>  >
>  > >  I've got a feeling there's a cleaner solution! Please advise!
>  >
>  > --
>  > Marcin Domanskihttp://kabturek.info
>
>
> >
>



-- 
Marcin Domanski
http://kabturek.info

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

2008-05-01 Thread annie.r.knight

Thanks for the quick reply.

I'm not sure whether that solves my problem: I'm okay with selecting
which output to produce, my problem is in the construction of the
books table/warning message. Where does this occur?

What I've got at the moment is something like this in the view:

if(!$showtable) {
 // display the warning message
}
else {
 // show the books table
}

The alternative, as I see it, would be to set the variable
$tableoutput in the controller to contain either the message or the
table and simply to echo that in the view.

With the first example I'm including logic in the view, with the
second I'm including presentation in the controller. I assume that,
since this isn't business logic, the first method is the correct one.

Is there a better way? I imagine so.


On May 1, 9:46 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote:
> Hey,
> From what you said you want to make a validation rule like >0 (if 0 is
> the value of ---please select a genre---) and Model::validate() it
> (you probably dont want to save it), if it valdiates - show the books
>
> On Thu, May 1, 2008 at 9:54 AM, annie.r.knight
>
>
>
> <[EMAIL PROTECTED]> wrote:
>
> >  ... at least I hope it's simple for you guys. Clearly it's not simple
> >  for me otherwise I wouldn't be asking here. I'm using 1.2.
>
> >  I'm trying to get the structure of my app 'right' in terms of MVC
> >  execution flow (and CakePHP's implementation of this flow). Here's my
> >  situation:
>
> >  I've got a page where a drop-down menu offers a number of options
> >  relating to, say, the genre of books available in a small library. The
> >  user chooses the genre from this drop-down and is then presented with
> >  a table data relating to the individual books in that genre.
>
> >  All easy-peasy coding. In the past (pre-MVC) I would simply have
> >  included some logic in the page to say: if there is no genre selected,
> >  then output a message telling user to select one; if there is then
> >  output the books in a nice table. This would, as I understand it, by
> >  an incorrect in terms of MVC.
>
> >  So here's my quandry.
>
> >  Do I 'set' the entire text of the table/user message in the
> >  controller, then output it as a simple $variable in the view? The
> >  disadvantage of this view would be that I need to include
> >  presentational logic when making the table/message within the
> >  controller.
>
> >  I've got a feeling there's a cleaner solution! Please advise!
>
> --
> Marcin Domanskihttp://kabturek.info
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Looking for the Rapid in Cakephp

2008-05-01 Thread Marcin Domanski

But these flies could mutate into giant-human-eating-flies and what
will you do? throw mysql_connect at them ? ;)  I'm using cake for
simple stuff too, i hate when i have to maintain some crazy-spaghetti
code (for italian peopl - belive it or not but spaghetti here isn't
good ;)



On Thu, May 1, 2008 at 4:40 AM, mbavio <[EMAIL PROTECTED]> wrote:
>
>  Lol, if you want to write html fast, use some ide with autocomplete
>  function, or the magic of Textmate. I dont see the benefits of using
>  CakePHP in that cases. Seems to me like shooting to flies with canons.
>
>  Cheers,
>  mbavio
>
>
>
>  On Apr 30, 8:10 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>  > >  Why on earth are you using CakePHP only for a form? Use PHP, and 5
>  > >  minutes of your life.
>  >
>  > Because he is trying to learn. And as a side note, I do use CakePHP
>  > for everything I can, even when not using PHP, i.e. for writing HTML
>  > forms and is really making my life easier. I really love CakePHP and
>  > I've found I can write CakePHP faster than any other kind of code.
>  >
>  > >  Cheers,
>  > >  mbavio
>  > >  mbavio.com.ar
>  >
>  > >  On Apr 29, 1:20 pm, "John David Anderson (_psychic_)"
>  >
>  > > <[EMAIL PROTECTED]> wrote:
>  > >  > On Apr 29, 2008, at 10:15 AM, gstrock wrote:
>  >
>  > >  > > thanks for the insight.
>  > >  > > I think I'm just having a bad day.
>  > >  > > I realize with everything there is
>  > >  > > a learning curve.  I guess I just thought
>  > >  > > it would be next to nothing for cake.  :-)
>  >
>  > >  > > Actually, my project has 1 database with
>  > >  > > 4 tables, so it's a good little task to try
>  > >  > > cake out on, I think.
>  >
>  > >  > > My perseverance machine just needs another
>  > >  > > cup of coffee.   :-)
>  >
>  > >  > The CakePHP IRC channel on freenode is another good resource.
>  > >  > Sometimes it's good to have immediate help. I'm in there now if you
>  > >  > want to work on this.
>  >
>  > >  > #cakephp
>  >
>  > >  > -- John
>  >
>



-- 
Marcin Domanski
http://kabturek.info

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

2008-05-01 Thread Q

I found this really useful, 
http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Simple MVC Question

2008-05-01 Thread Marcin Domanski

Hey,
>From what you said you want to make a validation rule like >0 (if 0 is
the value of ---please select a genre---) and Model::validate() it
(you probably dont want to save it), if it valdiates - show the books

On Thu, May 1, 2008 at 9:54 AM, annie.r.knight
<[EMAIL PROTECTED]> wrote:
>
>  ... at least I hope it's simple for you guys. Clearly it's not simple
>  for me otherwise I wouldn't be asking here. I'm using 1.2.
>
>  I'm trying to get the structure of my app 'right' in terms of MVC
>  execution flow (and CakePHP's implementation of this flow). Here's my
>  situation:
>
>  I've got a page where a drop-down menu offers a number of options
>  relating to, say, the genre of books available in a small library. The
>  user chooses the genre from this drop-down and is then presented with
>  a table data relating to the individual books in that genre.
>
>  All easy-peasy coding. In the past (pre-MVC) I would simply have
>  included some logic in the page to say: if there is no genre selected,
>  then output a message telling user to select one; if there is then
>  output the books in a nice table. This would, as I understand it, by
>  an incorrect in terms of MVC.
>
>  So here's my quandry.
>
>  Do I 'set' the entire text of the table/user message in the
>  controller, then output it as a simple $variable in the view? The
>  disadvantage of this view would be that I need to include
>  presentational logic when making the table/message within the
>  controller.
>
>  I've got a feeling there's a cleaner solution! Please advise!
>
>
>  >
>



-- 
Marcin Domanski
http://kabturek.info

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

2008-05-01 Thread Q

Hi,  I've actuall just sussed this out so i'm going to post the
solution here incase anyone else searches on this problem:

I put this in my app_controller inside function beforeFilter:

//this first line tests to see if the user is in the admin group - in
this case with the ID of 1
 if ($this->Auth->user('group_id') == 1) {
//user is admin:
$this->Auth->loginRedirect = array('controller' => 'admin/
MYCONTOLLERNAME');
}else{
//user is user:
$this->Auth->loginRedirect = array('controller' =>
'MYCONTROLLERNAME');
}

Which handily redirects admin users to admin screens and normal users
to normal view screens,  for example the difference between admin rout
index and a standard index view:

function admin_index() {}
function index() {}

these simple things can take hours to suss out when they shouldnt :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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: Auth Componant question

2008-05-01 Thread Marcin Domanski

look at Auth::autoRedirect [1], turn it off and redirect manually

[1] http://api.cakephp.org/1.2/auth_8php-source.html#l00182

HTH,

On Thu, May 1, 2008 at 8:24 AM, Q <[EMAIL PROTECTED]> wrote:
>
>  Hi,
>
>  I have a project setup to authorise access to both admin pages (admin
>  routes) and public pages using different groups for acess levels (eg
>  user and admin)
>
>  everything works fine - except i want to be able to redirect to 2
>  different pages (areas) for admin or users on login so for example
>  users would goto mysite.com/protectedcontent and admin users would
>  redirect to mysite.com/admin
>
>  At the moment my controller for this simply has a blank login function
>  (which is all it needs to work with the auth componant) eg:
>
>  function login()
> {
>
>   }
>
>  my question basically is what do i need to add to this to get the
>  redirects working as above?
>
>  Cheers, Quentin.
>
>
>
>  >
>



-- 
Marcin Domanski
http://kabturek.info

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



Simple MVC Question

2008-05-01 Thread annie.r.knight

... at least I hope it's simple for you guys. Clearly it's not simple
for me otherwise I wouldn't be asking here. I'm using 1.2.

I'm trying to get the structure of my app 'right' in terms of MVC
execution flow (and CakePHP's implementation of this flow). Here's my
situation:

I've got a page where a drop-down menu offers a number of options
relating to, say, the genre of books available in a small library. The
user chooses the genre from this drop-down and is then presented with
a table data relating to the individual books in that genre.

All easy-peasy coding. In the past (pre-MVC) I would simply have
included some logic in the page to say: if there is no genre selected,
then output a message telling user to select one; if there is then
output the books in a nice table. This would, as I understand it, by
an incorrect in terms of MVC.

So here's my quandry.

Do I 'set' the entire text of the table/user message in the
controller, then output it as a simple $variable in the view? The
disadvantage of this view would be that I need to include
presentational logic when making the table/message within the
controller.

I've got a feeling there's a cleaner solution! Please advise!


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

2008-05-01 Thread annie.r.knight

ValidKeys - thanks very much for your helpful answer.

On May 1, 2:20 am, validkeys <[EMAIL PROTECTED]> wrote:
> p.s if you dont update,
>
> change your code to this:
>  function add() {
>
> if (!empty($this->data)) {
> $this->Closeddate->create();
> $this->cleanUpFields();
> if ($this->Closeddate->save($this->data)) {
> $this->flash('The new details have
> been saved.','/closeddates');
> }
> }
>
> }
>
> function edit($id = null) {
>
> $this->Closeddate->id = $id;
>
> if (empty($this->data)) {
> $this->data = $this->Closeddate->read();
> }
> else {
> $this->cleanUpFields();
> if ($this->Closeddate->save($this->data)) {
> $this->flash('Your Closed Date
> has been updated.','/
> closeddates');
> }
> }
> }
>
> On Apr 30, 1:54 pm, "annie.r.knight" <[EMAIL PROTECTED]>
> wrote:
>
> > Thanks for the reply.
>
> > I print_r'ed the $this->data and I noted that it's split into a number
> > of array elements. That's fine.
>
> > But why is it necessary to 'clean up' when referring to the data as
> > $this->data['Closeddate'] when it is not necessary with $this->data?
>
> > On Apr 30, 2:22 pm, djiize <[EMAIL PROTECTED]> wrote:
>
> > > try a pr($this->data) in your controller and you'll the date is not
> > > "DB compliant" (it is split in several parts)
> > > do a $this->cleanUpFields() before Model->save()
>
> > > On 30 avr, 13:13, "annie.r.knight" <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > I'm very new to CakePHP so please do bear with me.
>
> > > > I've used the simple blog application from the manual as a crib for a
> > > > small application that I'm creating. I ran into a problem when simply
> > > > trying to deal with some date inputs in forms. The dates would insert
> > > > ok, but if I tried to edit them I'd run into a brick wall: there was
> > > > no update query being executed at all. If I changed the field type to
> > > > text it was working ok.
>
> > > > My controller's add() function looked like this:
>
> > > > function add() {
>
> > > > if (!empty($this->data)) {
> > > > if ($this->Closeddate->save($this->data)) {
> > > > $this->flash('The new details have been 
> > > > saved.','/closeddates');
> > > > }
> > > > }
>
> > > > }
>
> > > > And the edit() function:
>
> > > > function edit($id = null) {
>
> > > > $this->Closeddate->id = $id;
>
> > > > if (empty($this->data)) {
> > > > $this->data = $this->Closeddate->read();
> > > > }
> > > > else {
>
> > > > if 
> > > > ($this->Closeddate->save($this->data['Closeddate'])) {
> > > > $this->flash('Your Closed Date 
> > > > has been updated.','/
> > > > closeddates');
> > > > }
> > > > }
> > > > }
>
> > > > I fixed it by changing the parameter to the save() function to $this-
>
> > > > >data (less the array index).
>
> > > > So my question: Why does the broken method not work with dates? What
> > > > did I do wrong? What am I misunderstanding?
>
> > > > Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can cake do this or am I asking too much

2008-05-01 Thread zonium

1. Many times I create a complete MVC for the join table, especially
when I need to build complicated/flexible admin interfaces to work
directly with additional fields in the join table.
2. I am not sure if cake can handle compound primary key of more than
2 foreign keys. HABTM is only meant for 2 entities. How can you tell
cake to handle a relationship of more than 2 entities (i.e. the join
table has 3 or more foreign keys)?

Zonium

On 30 Tháng Tư, 15:23, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> The only real downsides I can see other than complicated code is that
> join tables will have a compound primary key which I don't think cake
> can handle very well (ie a primary key of (user_id,post_id)). if
> instead you use a primary key of id to get around this, and use
> user_id and post_id as just regular fields, you could very easily end
> up with duplicate data in your table if you aren't careful(ie two rows
> where id is different but user_id, post_id are the same). This will
> cause even more problems when you are trying to delete the M2M
> relationship, if there are multiple entries for the relationship, when
> you delete one the others will remain. Also, if you have related data
> in the join table and you try to grab it by finding the join table
> entry where user_id=$desiredUID AND post_id=$desiredPID, if there are
> multiple entries in the table that satisfy these conditions, then the
> data pulled may be incorrect. This seems like a data validation
> nightmare to me and using Cakes HABTM relationship takes care of all
> of these problems.
>
> Also, I don't see why you'd ever want a controller functions for a
> join table though. The only time you'd need controller functions for a
> join table is if you were rendering a view for the join table and
> you'd definitely never want to do that. If you really wanted functions
> relating to the join table, they should be defined in the model of the
> related table and called from the controller that will be rendering
> the view.
>
> Restating though, Any data that is related to the join table can be
> accessesed through a related model using the "with" function so any
> functions acting on the join table data could be easily implemented in
> the related Model.
>
> On Apr 30, 3:57 pm, validkeys <[EMAIL PROTECTED]> wrote:
>
> > I did it the way that i did it so that I could write controller
> > actions in the join table controller vs. in the relational tables. I
> > guess you could just write those actions in the M2M controllers, but
> > is it not cleaner to write those controller actions directly in the
> > controller of the join table? Also, it keeps it clean with regards to
> > creating custom model queries for the join table.
>
> > David, as we are all trying to learn here, are their any definite
> > downsides to the way that I am doing it besides the output data?
>
> > Thanks!
>
> > On Apr 30, 5:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > wrote:
>
> > > The way that validkeys describes is the exact same way that CakePHP
> > > implements a HABTM relationship. It uses a join table just as
> > > described. There really is no need to do it the way validkeys
> > > describes, you don't need a controller and model for the join table,
> > > it will just make your output data and query conditions that much more
> > > complicated. If you need to get at extra data in the join table (data
> > > other than the primary key) use the "with" key in the HABTM
> > > relationship definition.
>
> > > On Apr 30, 2:58 pm, validkeys <[EMAIL PROTECTED]> wrote:
>
> > > > JoC,
>
> > > > HABTM are good, but another way that I have been modeling M2M
> > > > relationships is the following:
>
> > > > assume we had students and classes. One class has many students and
> > > > one student is in many classes
>
> > > > classes --> | classes_students | <-- students
>
> > > > 1. create tables for classes, classes_students and students
> > > > 2. Create models and controllers for all 3 tables (note that the Model
> > > > for the classes_students would be ClassesStudent)
>
> > > > Your classes and students models would have many classes_students
>
> > > > Your classes_students model would belong to classes and students.
>
> > > > Thats another way to set up the M2M relationship.
>
> > > > On Apr 29, 11:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > > > wrote:
>
> > > > > Cake can handle a many to many relationship just fine. Do a search for
> > > > > HABTM (has and belongs to many) relationship to learn more about how
> > > > > to do this. Cake has sort of a steep learning curve, especially if you
> > > > > aren't familiar with MVC and OO programming. So, In my opinion Cake
> > > > > will make this task MUCH easier for someone well versed in Cake or at
> > > > > least well versed in MVC/OO. If you are just learning it will probably
> > > > > make the task moderately easier but any future web programming you do
> > > > > with it will be much easier and faster 

Re: Adding data in a One-To-Many Relationship

2008-05-01 Thread Reza Muhammad

That's right.

It works now.

Thank you :)

On May 1, 2008, at 8:25 AM, validkeys wrote:

>
> if you hadn't figured this one out.
>
> If you are trying to access your models model from your parts model to
> create a drop down of models in a parts view, use the following:
>
> latest 1.2: $this->Part->Model->find('list');
>
> earlier: $this->Part->Model->generateList();
>
> does that help?
>
> On Apr 30, 7:20 am, Reza Muhammad <[EMAIL PROTECTED]> wrote:
>> Forget my ignorance, I forgot to use var $belongsTo.
>> :)
>>
>> On Apr 30, 2008, at 3:22 PM, Reza Muhammad wrote:
>>
>>
>>
>>> Hi Guys,
>>
>>> I just started using CakePHP 1.2, and I have a question concerning a
>>> One to Many relationships.
>>
>>> I have two models, 'Model' and 'Part'.  One model can have many
>>> parts.  I don't have a problem creating Model controller, but when I
>>> want to add new parts, I want to have a list of the Models, and let
>>> the user choose using a drop down menu (>
>>> Can anyone tell me how to use this?
>>
>>> Thank you very much.
>>> -Reza
> >


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