Re: change language of setFlash()

2008-11-02 Thread Amit Badkas
2008/11/3 [EMAIL PROTECTED] <[EMAIL PROTECTED]>

>
> hi,
> I want to change setFlash message English to franch how can i change
> language of flash message?


- You can use syntax like $this->Session->setFlash(__('This is error
message', true)); in controller's action to use multi-lingual flash message

-- 
Amit

http://amitrb.wordpress.com/
http://coppermine-gallery.net/
http://cheesecake-photoblog.org/
http://www.sanisoft.com/blog/author/amitbadkas

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

2008-11-02 Thread jst4fun

In my above post I had said "These 4 groups
will be common for all office and the rules are predefined for these
for groups.". Please read it as "From these, 4 groups
will be common for all office and the rules for those four groups are
predefined"

On Nov 3, 11:44 am, jst4fun <[EMAIL PROTECTED]> wrote:
> Hi Stinkbug,
> Thanks again for your interest in helping me out. Sorry for the delay.
> I was able to setup permission dynamically. But still it is not
> proper. Before going further I will provide you my table structure
>
> offices table:
> id    -   int
> name - varchar
>
> groups Table
> id          - int
> office_id  - int
> name - int
>
> users table
> id - int
> group_id -int
> name - varchar
> password - varchar
>
> The aco, aro and acos_aros table is created by cake console script. I
> hope you dont need those tables. I have not altered it.
> My requirement is to set up roles with permission set for controller/
> action access. Each offices will have a set of groups. These 4 groups
> will be common for all office and the rules are predefined for these
> for groups. Even the administrator cannot change the roles for these
> four groups. Rest of the groups cannot be the duplicate for any office
> and the administrator can edit the permission for these groups.
> Groups will have many users and these users are depended on the
> office. That is user of office 'z' can be a part of group 'f' if and
> only if 'f' is a child group of 'z' office. A user can have multiple
> groups. I will post the code I have below. Now I am able to save a
> group under an office with a set of permission correctly. My issue is
> that:
> 1) I am not sure how to set 4 common groups to a offices when that
> office is created.
> 2) I am not sure on how to set up multiple groups for a user.
>
> Now I will provide the code I have done till date
>
> MODEL
> 1) Office model -http://pastebin.com/m3f1f37de
> 2) Group model -http://pastebin.com/m4464956
> 3) User model -http://pastebin.com/m1e7543f
>
> CONTROLLER
> 1) Groups Controller:http://pastebin.com/m315b2987
>
> I have done nothing related to ACL in office and user controller. The
> code which I have posted above was the result of lot of researches I
> had done on ACL :D. I guess this would be enough for you to understand
> what I am trying to do. I hope you will try to help me soon. Thanks
> once again.
>
> On Oct 31, 6:55 pm, Stinkbug <[EMAIL PROTECTED]> wrote:
>
> > Well, so much for an answer soon.  Sorry about that.  Not sure if you
> > still need help with this, but could you show us your aro and aco
> > structures so I get get a better idea as to what you're trying to do.
>
> > I think I see what you're trying to do, but let's see if you have a
> > proper ACl setup first.
>
> > On Oct 24, 5:45 am, jst4fun <[EMAIL PROTECTED]> wrote:
>
> > > Well I had gone through the links which you guys had provided. Thanks.
> > > But the issue for me to implement an ACL is that I am not sure what
> > > all function should be used due to the lack of documentation. One of
> > > the requirement is already discussed above. I think I was able to
> > > implement it partially. What I did was to create three tables one
> > > offices, groups and then users.I created parentNode() for group
> > > binding it to the office model and in users binding every users to
> > > group model. Now when I create a Group and select an office it is
> > > correctly created in aros table. Same with the users too. I found a
> > > script from cakebaker to list all controllers and save it as acos. Now
> > > I have aros and acos setup. In my application a superadmin can add new
> > > user, group and offices dynamically. This part i guess is already
> > > solved, thanks to parentNode(). When the super admin takes the add
> > > group page all the controllers with their actions are also displayed
> > > in that page. Actions will be having checkboxes to enable or disable
> > > that action to the user of that group. So my first doubt is
> > > 1) How is it possible to save a group and then its associated
> > > permissions dynamically?
> > > Then definitely the admin might have to delete a office or a group. In
> > > such a case
> > > 2) How is it possible to delete all the office and its group and
> > > remove the deleted group information from the users .
> > > I hope I have made everything clear and hope to get a reply soon.
> > > 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: Help with ACL

2008-11-02 Thread jst4fun

Hi Stinkbug,
Thanks again for your interest in helping me out. Sorry for the delay.
I was able to setup permission dynamically. But still it is not
proper. Before going further I will provide you my table structure

offices table:
id-   int
name - varchar

groups Table
id  - int
office_id  - int
name - int

users table
id - int
group_id -int
name - varchar
password - varchar

The aco, aro and acos_aros table is created by cake console script. I
hope you dont need those tables. I have not altered it.
My requirement is to set up roles with permission set for controller/
action access. Each offices will have a set of groups. These 4 groups
will be common for all office and the rules are predefined for these
for groups. Even the administrator cannot change the roles for these
four groups. Rest of the groups cannot be the duplicate for any office
and the administrator can edit the permission for these groups.
Groups will have many users and these users are depended on the
office. That is user of office 'z' can be a part of group 'f' if and
only if 'f' is a child group of 'z' office. A user can have multiple
groups. I will post the code I have below. Now I am able to save a
group under an office with a set of permission correctly. My issue is
that:
1) I am not sure how to set 4 common groups to a offices when that
office is created.
2) I am not sure on how to set up multiple groups for a user.

Now I will provide the code I have done till date

MODEL
1) Office model - http://pastebin.com/m3f1f37de
2) Group model - http://pastebin.com/m4464956
3) User model - http://pastebin.com/m1e7543f

CONTROLLER
1) Groups Controller: http://pastebin.com/m315b2987

I have done nothing related to ACL in office and user controller. The
code which I have posted above was the result of lot of researches I
had done on ACL :D. I guess this would be enough for you to understand
what I am trying to do. I hope you will try to help me soon. Thanks
once again.


On Oct 31, 6:55 pm, Stinkbug <[EMAIL PROTECTED]> wrote:
> Well, so much for an answer soon.  Sorry about that.  Not sure if you
> still need help with this, but could you show us your aro and aco
> structures so I get get a better idea as to what you're trying to do.
>
> I think I see what you're trying to do, but let's see if you have a
> proper ACl setup first.
>
> On Oct 24, 5:45 am, jst4fun <[EMAIL PROTECTED]> wrote:
>
> > Well I had gone through the links which you guys had provided. Thanks.
> > But the issue for me to implement an ACL is that I am not sure what
> > all function should be used due to the lack of documentation. One of
> > the requirement is already discussed above. I think I was able to
> > implement it partially. What I did was to create three tables one
> > offices, groups and then users.I created parentNode() for group
> > binding it to the office model and in users binding every users to
> > group model. Now when I create a Group and select an office it is
> > correctly created in aros table. Same with the users too. I found a
> > script from cakebaker to list all controllers and save it as acos. Now
> > I have aros and acos setup. In my application a superadmin can add new
> > user, group and offices dynamically. This part i guess is already
> > solved, thanks to parentNode(). When the super admin takes the add
> > group page all the controllers with their actions are also displayed
> > in that page. Actions will be having checkboxes to enable or disable
> > that action to the user of that group. So my first doubt is
> > 1) How is it possible to save a group and then its associated
> > permissions dynamically?
> > Then definitely the admin might have to delete a office or a group. In
> > such a case
> > 2) How is it possible to delete all the office and its group and
> > remove the deleted group information from the users .
> > I hope I have made everything clear and hope to get a reply soon.
> > 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
-~--~~~~--~~--~--~---



change language of setFlash()

2008-11-02 Thread [EMAIL PROTECTED]

hi,
I want to change setFlash message English to franch how can i change
language of flash message?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Using JQuery and Prototype in same application

2008-11-02 Thread si-mon

Hi all,
Is there any problem in using both JQuery and Prototype in the same
application?

--~--~-~--~~~---~--~~
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: Jquery or Scriptalicious?

2008-11-02 Thread Anupom
Prototype developers tried to make it like Ruby as well :P

On Mon, Nov 3, 2008 at 6:08 AM, 703designs <[EMAIL PROTECTED]> wrote:

>
> I'm not sure what you mean by that. jQuery is written in JavaScript
> (not like MochiKit, which tries to make JavaScript look like Python).
>
> On Oct 31, 2:43 pm, "Gabriel Gilini" <[EMAIL PROTECTED]> wrote:
> > The right answers is: learn real javascript
> > Yes, the learning curve with jQuery is way lower, but when you really
> know
> > javascript, take a look in proto ;)
> >
> > Gabriel Gilini
> >
> > www.usosim.com.br
> > [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
> >
> > On Fri, Oct 31, 2008 at 4:37 PM, Samuel DeVore <[EMAIL PROTECTED]>
> wrote:
> >
> > > Here's my take for what little it's worth (note I use scripa/proto)
> > > if you want to use the ajax helper at this point you are tied to
> > > scripta/proto.  now given that the stated plans in unofficial channels
> > > is that the helper is either being migrated to jQuery or being driving
> > > to a javascript _framwork_ agnostic place, it really doesn't matter.
> >
> > > If on the otherhand you see yourself not feeling like the helper as it
> > > exists now will meet your needs and you will be wanting insight and
> > > help from people on this list on integrating javascript _framework_
> > > into your project, then I would say that the responses to your
> > > question indicate, to me, that jQuery is a more of the current
> > > 'hotness' and you are likely to get more help from people jazzed up on
> > > jQuery.
> >
> > > To me it is a question of who is going to help you if you need it and
> > > what do you think your projected needs are.
> >
> > > See totally unhelpful answer ;)
> >
> > > Sam D
> >
> > > On Fri, Oct 31, 2008 at 12:16 PM, Gabriel Gilini <
> [EMAIL PROTECTED]>
> > > wrote:
> > > > Sorry, mate, but prototype also supports all CSS3 selectors.
> >
> > > > ps: I never use cakephp's ajax helpers, and I love writing javascript
> >
> > > > Cheers
> >
> > > > Gabriel Gilini
> >
> > > >www.usosim.com.br
> > > > [EMAIL PROTECTED]
> > > > [EMAIL PROTECTED]
> >
> > > > On Fri, Oct 31, 2008 at 10:45 AM, Josey <[EMAIL PROTECTED]>
> wrote:
> >
> > > >> I perfer jQuery as well.
> > > >> Many Bakers like prototype due to the javascript and ajax helpers
> that
> > > >> come with CakePHP.
> > > >> These make baking with JS quite a bit easier, not to mention faster
> > > >> however many Javascript experts would cringe to think that
> developers
> > > >> are using php helpers for the behavioral portion of their sites
> > > >> because the scripts are no longer unobtrusive.
> >
> > > >> jQuery is very easy to learn and uses many of the same selectors
> that
> > > >> CSS 2 and 3 use making it incredibly easy to develop around.
> > > >> However, if you require a JS helper there is a jQuery helper for
> > > >> CakePHP called pQuery.
> > > >>http://www.ngcoders.com/php/pquery-php-and-jquery
> >
> > > >> If not then spend some time at the jQuery API and read through the
> > > >> tutorials.
> > > >>http://docs.jquery.com/Main_Page
> >
> > > >> I love jQuery.
> >
> > > >> On Oct 30, 5:49 pm, Matthieu <[EMAIL PROTECTED]> wrote:
> > > >> > Hello,
> >
> > > >> > I'm gonna create a web app using CakePHP but I'm confused about
> > > >> > chosing between Jquery or Scriptalious? Which one should I choose?
> > > >> > Does it really matter? What's the differences between them?
> >
> > > >> > tks
> >
>


-- 
Anupom Syam
http://syamantics.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
-~--~~~~--~~--~--~---



Another pagination problem

2008-11-02 Thread 0x1A4

Hi all im relatively new to Cakephp.Currently im creating a web app
for our in house usage to track and monitor tenders.My problem right
now is im creating a search function.Whenever user submit strings to
the search query it all went well.However the problem occur on
pagination when the search result is more than 1 page.If the user
navigate to the 2nd page it will ignore all the search query.Below is
the pastebin of my code.Sorry for my bad english

Controller code http://bin.cakephp.org/saved/39125
View code http://bin.cakephp.org/saved/39126

--~--~-~--~~~---~--~~
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: Jquery or Scriptalicious?

2008-11-02 Thread 703designs

Except for using what's provided (being a light library), you can't
get very far in jQuery without learning JavaScript unless you plan to
only reuse other peoples' code.

On Nov 2, 7:38 pm, "Gabriel Gilini" <[EMAIL PROTECTED]> wrote:
> I mean that there is a hell lot of people learning jQuery, not JavaScript
> these days. Every allegedly javascript developer should, at least, read the
> ECMA-262.
> Gabriel Gilini
>
> www.usosim.com.br
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
> On Sun, Nov 2, 2008 at 10:08 PM, 703designs <[EMAIL PROTECTED]> wrote:
>
> > I'm not sure what you mean by that. jQuery is written in JavaScript
> > (not like MochiKit, which tries to make JavaScript look like Python).
>
> > On Oct 31, 2:43 pm, "Gabriel Gilini" <[EMAIL PROTECTED]> wrote:
> > > The right answers is: learn real javascript
> > > Yes, the learning curve with jQuery is way lower, but when you really
> > know
> > > javascript, take a look in proto ;)
>
> > > Gabriel Gilini
>
> > >www.usosim.com.br
> > > [EMAIL PROTECTED]
> > > [EMAIL PROTECTED]
>
> > > On Fri, Oct 31, 2008 at 4:37 PM, Samuel DeVore <[EMAIL PROTECTED]>
> > wrote:
>
> > > > Here's my take for what little it's worth (note I use scripa/proto)
> > > > if you want to use the ajax helper at this point you are tied to
> > > > scripta/proto.  now given that the stated plans in unofficial channels
> > > > is that the helper is either being migrated to jQuery or being driving
> > > > to a javascript _framwork_ agnostic place, it really doesn't matter.
>
> > > > If on the otherhand you see yourself not feeling like the helper as it
> > > > exists now will meet your needs and you will be wanting insight and
> > > > help from people on this list on integrating javascript _framework_
> > > > into your project, then I would say that the responses to your
> > > > question indicate, to me, that jQuery is a more of the current
> > > > 'hotness' and you are likely to get more help from people jazzed up on
> > > > jQuery.
>
> > > > To me it is a question of who is going to help you if you need it and
> > > > what do you think your projected needs are.
>
> > > > See totally unhelpful answer ;)
>
> > > > Sam D
>
> > > > On Fri, Oct 31, 2008 at 12:16 PM, Gabriel Gilini <
> > [EMAIL PROTECTED]>
> > > > wrote:
> > > > > Sorry, mate, but prototype also supports all CSS3 selectors.
>
> > > > > ps: I never use cakephp's ajax helpers, and I love writing javascript
>
> > > > > Cheers
>
> > > > > Gabriel Gilini
>
> > > > >www.usosim.com.br
> > > > > [EMAIL PROTECTED]
> > > > > [EMAIL PROTECTED]
>
> > > > > On Fri, Oct 31, 2008 at 10:45 AM, Josey <[EMAIL PROTECTED]>
> > wrote:
>
> > > > >> I perfer jQuery as well.
> > > > >> Many Bakers like prototype due to the javascript and ajax helpers
> > that
> > > > >> come with CakePHP.
> > > > >> These make baking with JS quite a bit easier, not to mention faster
> > > > >> however many Javascript experts would cringe to think that
> > developers
> > > > >> are using php helpers for the behavioral portion of their sites
> > > > >> because the scripts are no longer unobtrusive.
>
> > > > >> jQuery is very easy to learn and uses many of the same selectors
> > that
> > > > >> CSS 2 and 3 use making it incredibly easy to develop around.
> > > > >> However, if you require a JS helper there is a jQuery helper for
> > > > >> CakePHP called pQuery.
> > > > >>http://www.ngcoders.com/php/pquery-php-and-jquery
>
> > > > >> If not then spend some time at the jQuery API and read through the
> > > > >> tutorials.
> > > > >>http://docs.jquery.com/Main_Page
>
> > > > >> I love jQuery.
>
> > > > >> On Oct 30, 5:49 pm, Matthieu <[EMAIL PROTECTED]> wrote:
> > > > >> > Hello,
>
> > > > >> > I'm gonna create a web app using CakePHP but I'm confused about
> > > > >> > chosing between Jquery or Scriptalious? Which one should I choose?
> > > > >> > Does it really matter? What's the differences between them?
>
> > > > >> > tks
--~--~-~--~~~---~--~~
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: Jquery or Scriptalicious?

2008-11-02 Thread Gabriel Gilini
I mean that there is a hell lot of people learning jQuery, not JavaScript
these days. Every allegedly javascript developer should, at least, read the
ECMA-262.
Gabriel Gilini

www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]


On Sun, Nov 2, 2008 at 10:08 PM, 703designs <[EMAIL PROTECTED]> wrote:

>
> I'm not sure what you mean by that. jQuery is written in JavaScript
> (not like MochiKit, which tries to make JavaScript look like Python).
>
> On Oct 31, 2:43 pm, "Gabriel Gilini" <[EMAIL PROTECTED]> wrote:
> > The right answers is: learn real javascript
> > Yes, the learning curve with jQuery is way lower, but when you really
> know
> > javascript, take a look in proto ;)
> >
> > Gabriel Gilini
> >
> > www.usosim.com.br
> > [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
> >
> > On Fri, Oct 31, 2008 at 4:37 PM, Samuel DeVore <[EMAIL PROTECTED]>
> wrote:
> >
> > > Here's my take for what little it's worth (note I use scripa/proto)
> > > if you want to use the ajax helper at this point you are tied to
> > > scripta/proto.  now given that the stated plans in unofficial channels
> > > is that the helper is either being migrated to jQuery or being driving
> > > to a javascript _framwork_ agnostic place, it really doesn't matter.
> >
> > > If on the otherhand you see yourself not feeling like the helper as it
> > > exists now will meet your needs and you will be wanting insight and
> > > help from people on this list on integrating javascript _framework_
> > > into your project, then I would say that the responses to your
> > > question indicate, to me, that jQuery is a more of the current
> > > 'hotness' and you are likely to get more help from people jazzed up on
> > > jQuery.
> >
> > > To me it is a question of who is going to help you if you need it and
> > > what do you think your projected needs are.
> >
> > > See totally unhelpful answer ;)
> >
> > > Sam D
> >
> > > On Fri, Oct 31, 2008 at 12:16 PM, Gabriel Gilini <
> [EMAIL PROTECTED]>
> > > wrote:
> > > > Sorry, mate, but prototype also supports all CSS3 selectors.
> >
> > > > ps: I never use cakephp's ajax helpers, and I love writing javascript
> >
> > > > Cheers
> >
> > > > Gabriel Gilini
> >
> > > >www.usosim.com.br
> > > > [EMAIL PROTECTED]
> > > > [EMAIL PROTECTED]
> >
> > > > On Fri, Oct 31, 2008 at 10:45 AM, Josey <[EMAIL PROTECTED]>
> wrote:
> >
> > > >> I perfer jQuery as well.
> > > >> Many Bakers like prototype due to the javascript and ajax helpers
> that
> > > >> come with CakePHP.
> > > >> These make baking with JS quite a bit easier, not to mention faster
> > > >> however many Javascript experts would cringe to think that
> developers
> > > >> are using php helpers for the behavioral portion of their sites
> > > >> because the scripts are no longer unobtrusive.
> >
> > > >> jQuery is very easy to learn and uses many of the same selectors
> that
> > > >> CSS 2 and 3 use making it incredibly easy to develop around.
> > > >> However, if you require a JS helper there is a jQuery helper for
> > > >> CakePHP called pQuery.
> > > >>http://www.ngcoders.com/php/pquery-php-and-jquery
> >
> > > >> If not then spend some time at the jQuery API and read through the
> > > >> tutorials.
> > > >>http://docs.jquery.com/Main_Page
> >
> > > >> I love jQuery.
> >
> > > >> On Oct 30, 5:49 pm, Matthieu <[EMAIL PROTECTED]> wrote:
> > > >> > Hello,
> >
> > > >> > I'm gonna create a web app using CakePHP but I'm confused about
> > > >> > chosing between Jquery or Scriptalious? Which one should I choose?
> > > >> > Does it really matter? What's the differences between them?
> >
> > > >> > tks
> >
>

--~--~-~--~~~---~--~~
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: Jquery or Scriptalicious?

2008-11-02 Thread 703designs

I'm not sure what you mean by that. jQuery is written in JavaScript
(not like MochiKit, which tries to make JavaScript look like Python).

On Oct 31, 2:43 pm, "Gabriel Gilini" <[EMAIL PROTECTED]> wrote:
> The right answers is: learn real javascript
> Yes, the learning curve with jQuery is way lower, but when you really know
> javascript, take a look in proto ;)
>
> Gabriel Gilini
>
> www.usosim.com.br
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
> On Fri, Oct 31, 2008 at 4:37 PM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
> > Here's my take for what little it's worth (note I use scripa/proto)
> > if you want to use the ajax helper at this point you are tied to
> > scripta/proto.  now given that the stated plans in unofficial channels
> > is that the helper is either being migrated to jQuery or being driving
> > to a javascript _framwork_ agnostic place, it really doesn't matter.
>
> > If on the otherhand you see yourself not feeling like the helper as it
> > exists now will meet your needs and you will be wanting insight and
> > help from people on this list on integrating javascript _framework_
> > into your project, then I would say that the responses to your
> > question indicate, to me, that jQuery is a more of the current
> > 'hotness' and you are likely to get more help from people jazzed up on
> > jQuery.
>
> > To me it is a question of who is going to help you if you need it and
> > what do you think your projected needs are.
>
> > See totally unhelpful answer ;)
>
> > Sam D
>
> > On Fri, Oct 31, 2008 at 12:16 PM, Gabriel Gilini <[EMAIL PROTECTED]>
> > wrote:
> > > Sorry, mate, but prototype also supports all CSS3 selectors.
>
> > > ps: I never use cakephp's ajax helpers, and I love writing javascript
>
> > > Cheers
>
> > > Gabriel Gilini
>
> > >www.usosim.com.br
> > > [EMAIL PROTECTED]
> > > [EMAIL PROTECTED]
>
> > > On Fri, Oct 31, 2008 at 10:45 AM, Josey <[EMAIL PROTECTED]> wrote:
>
> > >> I perfer jQuery as well.
> > >> Many Bakers like prototype due to the javascript and ajax helpers that
> > >> come with CakePHP.
> > >> These make baking with JS quite a bit easier, not to mention faster
> > >> however many Javascript experts would cringe to think that developers
> > >> are using php helpers for the behavioral portion of their sites
> > >> because the scripts are no longer unobtrusive.
>
> > >> jQuery is very easy to learn and uses many of the same selectors that
> > >> CSS 2 and 3 use making it incredibly easy to develop around.
> > >> However, if you require a JS helper there is a jQuery helper for
> > >> CakePHP called pQuery.
> > >>http://www.ngcoders.com/php/pquery-php-and-jquery
>
> > >> If not then spend some time at the jQuery API and read through the
> > >> tutorials.
> > >>http://docs.jquery.com/Main_Page
>
> > >> I love jQuery.
>
> > >> On Oct 30, 5:49 pm, Matthieu <[EMAIL PROTECTED]> wrote:
> > >> > Hello,
>
> > >> > I'm gonna create a web app using CakePHP but I'm confused about
> > >> > chosing between Jquery or Scriptalious? Which one should I choose?
> > >> > Does it really matter? What's the differences between them?
>
> > >> > tks
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



afterSave problem..

2008-11-02 Thread spyros k.

Hi, in an app i'm developping i want to be able to copy a few files
between 2 aws s3 buckets. I'm using the s3 php class from undesigned
(http://undesigned.org.za/2007/10/22/amazon-s3-php-class), which works
just fine in any other operations.
Right now im trying to move 2 files, whose filenames are (w/o
extensions) "1" and "2", from "sourcebucket" to "targetbucket".
Through the s3 class one is able to specify the filename, of the
copied file, in the target bucket.

What I want to do is use the "id" field of my model (set as char(36))
as the filename, but for some reason that i cant understand i'm not
able to do that..

Below is the afterSave() callback in my model with which im trying to
implement this:

function afterSave($created){
if($created){
$imported = App::import('Vendor','s3');
$accs3 = new S3("xx","x",0);
$bucket1 = $accs3->getBucket("sourcebucket");
foreach ($bucket1 as $key => $conts){
$keynum = intval($key);
if ($keynum == $this->position){
$cp = $accs3->copyObject("sourcebucket",
$key,"targetbucket",$this->id);
}
}
}
}

Where $key is the filename in the $bucket1 array (thats the way the s3
php class returns it) and $this->position is the "position" field in
my model.
Finally im using intval() since (to my knowledge) $key is the filename
string and $this->position is an integer.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Cake Debug output?

2008-11-02 Thread 703designs

I'd like to pass any recommended source code (missing controller,
etc.) from Cake through highlight_string(). How can I customize this
output beyond simple styling?
--~--~-~--~~~---~--~~
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: ajax form submission - nothing happens

2008-11-02 Thread carlos ferrandis

Hi. Are you following the exercise in the book: Implementing Ajax
Features, chapter 8? if so I might me able to tell you that I found 3
errors on it. Reading your code I fix the last one. let me know then I
can drop you the code corrected.

carlos

On 31 out, 15:13, Kieron <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am trying to add a commentsformto a blog post, updating the page
> withajax, specifically using prototype.js.
> I've usedajax->form, however when I press the submit button
> absolutely nothing happens.
> I've tried theajaxsubmit method with the same result. If I submit
> theformwithoutajaxit works fine.
>
> my view code is as follows:
>
>     echo $ajax->form('/comments/
> add','post',array('update'=>'comments','url'=>'/comments/add'));
>     echo $form->input('Comment.name');
>     echo $form->input('Comment.content');
>     echo 
> $form->input('Comment.post_id',array('type'=>'hidden','value'=>$post['Post']
>
> ['id']));
>     echo $form->end('Add Comment');
>
> the add action in the comments controller is as follows:
>
>         function add() {
>                 if (!empty($this->data)) {
>                         $this->Comment->create();
>                         if ($this->Comment->save($this->data)) {
>                                 $comments = 
> $this->Comment->find('all',array('conditions'=>array('post_id'=>$this->data['Comment']
>
> ['post_id']),'recursive'=>-1));
>                                 $this->set(compact('comments'));
>                                 $this->render('add_success','ajax');
>                         } else {
>                                 $this->render('add_failure', 'ajax');
>                         }
>                 }
>         }
>
> and the created source is as follows:
>
>   
>     
>     
>       
>     
>     
> // Event.observe('form283226270', 'submit', function(event) { 
> newAjax.Updater('comments','/blog/comments/add', {asynchronous:true,
> evalScripts:true, parameters:Form.serialize('form283226270'),
> requestHeaders:['X-Update', 'comments']}) }, false);
> //]]>
>     
>     
>       Name
>        value="" id="CommentName" />
>     
>     
>       Content
>        id="CommentContent" >
>     
>      id="CommentPostId"/>
>     
>       
>     
>     
>   
>
> Does anyone know what might be wrong?
>
> I'd appreciate any feedback as I've spent a whole day trying to solve
> this and have no desire to quit the whole cakephp thing over something
> like this!
>
> Thanks
> Kieron.
--~--~-~--~~~---~--~~
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 is utf-8, page is utf-8, but i get weird characters

2008-11-02 Thread Dave J

Not sure why it would show up as a question mark when you generate the
form with the helper, however, when connecting to the database, make
sure you set the encoding as well.

var $default = array('driver' => 'mysql',
'host' => 'localhost',
'login' => 'username',
'password' => 'pass',
'database' => 'database_name',
'encoding' => 'utf8'
);



On Nov 2, 2:32 pm, bartvh <[EMAIL PROTECTED]> wrote:
> My MySQL5 database is encoded in utf-8, and the page is as well (which
> is declared in the html meta tags), however when I generate a select
> field with the form helper, an uncommon character (é to be precise)
> shows up as a question-diamond in firefox. if i manually set firefox
> to use western (iso-8859-1) the character shows up fine.
>
> what goes wrong here?
> 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: Broken image if shown with file_get_contents()

2008-11-02 Thread Samuel DeVore

On Sun, Nov 2, 2008 at 10:33 AM, Bernardo Vieira
<[EMAIL PROTECTED]> wrote:
>
> Maybe you forgot whitespace after closing a php tag.

My guess is that you have a controller, component, helper that has an
extra white space at the start or end.  You could try clearing the
output buffer 
before echoing out the file and then exiting


like

Configure::write('debug', 0);
ob_clear();
header('Content-type: image/jpeg;');
file_get_contents(WWW_ROOT . 'img' . DS . 'folder'   . DS .  'test.jpg');
 exit;


>
> Anupom wrote:
>> It works fine here! Did you try exiting at the end of the action?
>>
>> On Sun, Nov 2, 2008 at 7:48 PM, Giaco <[EMAIL PROTECTED]
>> > wrote:
>>
>>
>> That doesn't work either. The path is correct, put the output gets
>> scrambled. I think this is an encoding issue but I can't work around
>> it and don't find anything on the web about it.
>>
>> Does this function work as expected with your cake installation? (I'm
>> using UTF8)
>>
>> On Nov 2, 11:10 am, Anupom <[EMAIL PROTECTED]
>> > wrote:
>> > Can you please try with the following code?
>> >
>> > function view() {
>> > Configure::write('debug', 0);
>> > header('Content-type: image/jpeg;');
>> > echo file_get_contents(WWW_ROOT . 'img' . DS . 'folder'
>> . DS .
>> > 'test.jpg');
>> > exit;
>> > }
>> >
>> >
>> >
>> >
>> >
>> > On Sun, Nov 2, 2008 at 4:36 AM, Giaco <[EMAIL PROTECTED]
>> > wrote:
>> >
>> > > Hello,
>> >
>> > > for security reasons and on the fly resizing I route all picture
>> > > requests to /images/view ("images" being the controller).
>> >
>> > > But this function outputs only a broken image:
>> >
>> > > /* images controller (for testing purposes no use of view and
>> layout)
>> > > */
>> > > function view() {
>> > >Configure::write('debug', 0);
>> > >header('Content-type: image/jpeg;');
>> > >echo file_get_contents("img/folder/test.jpg");
>> > > }
>> >
>> > > When I don't send the header, I see the binary version of the
>> image.
>> > > What could this possibly be?
>> >
>> > --
>> > Anupom Syamhttp://syamantics.com/ 
>>
>>
>>
>>
>>
>> --
>> Anupom Syam
>> http://syamantics.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
-~--~~~~--~~--~--~---



Re: Test cakephp mail component in local host

2008-11-02 Thread Abhimanyu Grover

I'm looking for this as well.

On Nov 2, 9:38 pm, persianshadow <[EMAIL PROTECTED]> wrote:
> hi
>
> i need to test my cakephp application in localhost.
>
> my os is win xp.
>
> do you know good solution for this work ?
>
> 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
-~--~~~~--~~--~--~---



Test cakephp mail component in local host

2008-11-02 Thread persianshadow

hi

i need to test my cakephp application in localhost.

my os is win xp.

do you know good solution for this work ?

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: Broken image if shown with file_get_contents()

2008-11-02 Thread Bernardo Vieira

Maybe you forgot whitespace after closing a php tag.

Anupom wrote:
> It works fine here! Did you try exiting at the end of the action?
>
> On Sun, Nov 2, 2008 at 7:48 PM, Giaco <[EMAIL PROTECTED] 
> > wrote:
>
>
> That doesn't work either. The path is correct, put the output gets
> scrambled. I think this is an encoding issue but I can't work around
> it and don't find anything on the web about it.
>
> Does this function work as expected with your cake installation? (I'm
> using UTF8)
>
> On Nov 2, 11:10 am, Anupom <[EMAIL PROTECTED]
> > wrote:
> > Can you please try with the following code?
> >
> > function view() {
> > Configure::write('debug', 0);
> > header('Content-type: image/jpeg;');
> > echo file_get_contents(WWW_ROOT . 'img' . DS . 'folder'
> . DS .
> > 'test.jpg');
> > exit;
> > }
> >
> >
> >
> >
> >
> > On Sun, Nov 2, 2008 at 4:36 AM, Giaco <[EMAIL PROTECTED]
> > wrote:
> >
> > > Hello,
> >
> > > for security reasons and on the fly resizing I route all picture
> > > requests to /images/view ("images" being the controller).
> >
> > > But this function outputs only a broken image:
> >
> > > /* images controller (for testing purposes no use of view and
> layout)
> > > */
> > > function view() {
> > >Configure::write('debug', 0);
> > >header('Content-type: image/jpeg;');
> > >echo file_get_contents("img/folder/test.jpg");
> > > }
> >
> > > When I don't send the header, I see the binary version of the
> image.
> > > What could this possibly be?
> >
> > --
> > Anupom Syamhttp://syamantics.com/ 
>
>
>
>
>
> -- 
> Anupom Syam
> http://syamantics.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
-~--~~~~--~~--~--~---



Re: Broken image if shown with file_get_contents()

2008-11-02 Thread Anupom
It works fine here! Did you try exiting at the end of the action?

On Sun, Nov 2, 2008 at 7:48 PM, Giaco <[EMAIL PROTECTED]> wrote:

>
> That doesn't work either. The path is correct, put the output gets
> scrambled. I think this is an encoding issue but I can't work around
> it and don't find anything on the web about it.
>
> Does this function work as expected with your cake installation? (I'm
> using UTF8)
>
> On Nov 2, 11:10 am, Anupom <[EMAIL PROTECTED]> wrote:
> > Can you please try with the following code?
> >
> > function view() {
> > Configure::write('debug', 0);
> > header('Content-type: image/jpeg;');
> > echo file_get_contents(WWW_ROOT . 'img' . DS . 'folder' . DS .
> > 'test.jpg');
> > exit;
> > }
> >
> >
> >
> >
> >
> > On Sun, Nov 2, 2008 at 4:36 AM, Giaco <[EMAIL PROTECTED]> wrote:
> >
> > > Hello,
> >
> > > for security reasons and on the fly resizing I route all picture
> > > requests to /images/view ("images" being the controller).
> >
> > > But this function outputs only a broken image:
> >
> > > /* images controller (for testing purposes no use of view and layout)
> > > */
> > > function view() {
> > >Configure::write('debug', 0);
> > >header('Content-type: image/jpeg;');
> > >echo file_get_contents("img/folder/test.jpg");
> > > }
> >
> > > When I don't send the header, I see the binary version of the image.
> > > What could this possibly be?
> >
> > --
> > Anupom Syamhttp://syamantics.com/
>
> >
>


-- 
Anupom Syam
http://syamantics.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
-~--~~~~--~~--~--~---



Re: Broken image if shown with file_get_contents()

2008-11-02 Thread Giaco

That doesn’t work either. The path is correct, put the output gets
scrambled. I think this is an encoding issue but I can’t work around
it and don’t find anything on the web about it.

Does this function work as expected with your cake installation? (I’m
using UTF8)

On Nov 2, 11:10 am, Anupom <[EMAIL PROTECTED]> wrote:
> Can you please try with the following code?
>
>     function view() {
>         Configure::write('debug', 0);
>         header('Content-type: image/jpeg;');
>         echo file_get_contents(WWW_ROOT . 'img' . DS . 'folder' . DS .
> 'test.jpg');
>         exit;
>     }
>
>
>
>
>
> On Sun, Nov 2, 2008 at 4:36 AM, Giaco <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > for security reasons and on the fly resizing I route all picture
> > requests to /images/view ("images" being the controller).
>
> > But this function outputs only a broken image:
>
> > /* images controller (for testing purposes no use of view and layout)
> > */
> > function view() {
> >    Configure::write('debug', 0);
> >    header('Content-type: image/jpeg;');
> >    echo file_get_contents("img/folder/test.jpg");
> > }
>
> > When I don't send the header, I see the binary version of the image.
> > What could this possibly be?
>
> --
> Anupom Syamhttp://syamantics.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
-~--~~~~--~~--~--~---



database is utf-8, page is utf-8, but i get weird characters

2008-11-02 Thread bartvh

My MySQL5 database is encoded in utf-8, and the page is as well (which
is declared in the html meta tags), however when I generate a select
field with the form helper, an uncommon character (é to be precise)
shows up as a question-diamond in firefox. if i manually set firefox
to use western (iso-8859-1) the character shows up fine.

what goes wrong here?
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: Broken image if shown with file_get_contents()

2008-11-02 Thread Giaco

I now found out then when viewed binarily the only difference between
the real picture and the scrambled one of cake is:
  * one empty line at the top
  * line delimiter is CRLF not CR

If I change those two, the image works as expected. How can I tell
cake to show the image properly?


On Nov 2, 11:10 am, Anupom <[EMAIL PROTECTED]> wrote:
> Can you please try with the following code?
>
>     function view() {
>         Configure::write('debug', 0);
>         header('Content-type: image/jpeg;');
>         echo file_get_contents(WWW_ROOT . 'img' . DS . 'folder' . DS .
> 'test.jpg');
>         exit;
>     }
>
>
>
>
>
> On Sun, Nov 2, 2008 at 4:36 AM, Giaco <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > for security reasons and on the fly resizing I route all picture
> > requests to /images/view ("images" being the controller).
>
> > But this function outputs only a broken image:
>
> > /* images controller (for testing purposes no use of view and layout)
> > */
> > function view() {
> >    Configure::write('debug', 0);
> >    header('Content-type: image/jpeg;');
> >    echo file_get_contents("img/folder/test.jpg");
> > }
>
> > When I don't send the header, I see the binary version of the image.
> > What could this possibly be?
>
> --
> Anupom Syamhttp://syamantics.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
-~--~~~~--~~--~--~---



bake + PHP5

2008-11-02 Thread sjordan

Hi,

I am new to CakePHP.

I have been following along in a tutorial and got to bake.

I understand I can use bake to generate models, views, controllers for
example.

In this instance I had already contructed a model and was using bake
to create a controller.

My model looked like the following:

class Product extends AppModel {
public $name = 'Product';
public $belongsTo = array('Dealer' => array('className'  =>
'Dealer',   
'foreignKey' => 'dealer_id')
  );
}

In the end, I changed the references to public to var and bake worked
like a champ.

I would prefer to write (and have written via bake) all code to be
PHP5.

How to I configure things such that all code generated by bake and any
other "magic" is PHP5 compliant?

Thank you 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: PHPShop v2 is a cake app!

2008-11-02 Thread acoustic_overdrive

Nate, that's kind of what I had in mind, nice explanation.

J

On Oct 28, 5:51 pm, Nate <[EMAIL PROTECTED]> wrote:
> I think it would be possible to write the core of the application as a
> plugin, but distribute it inside of an application that provides the
> front-end.  This would serve the purpose of (a) appealing to a mass
> market by making it a working application out of the box, (b)
> providing a plugin for CakePHP developers to integrate into their own
> apps, and (c) an example application that demonstrates how to
> integrate said plugin, for the benefit of those who wish to do so.
>
> I think a lot of re-distributable CakePHP apps could benefit from
> being designed like this.  Anyway, something to think about.

--~--~-~--~~~---~--~~
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: Warning (2): fopen(cakephp/app/tmp/cache/persistent/cake_core_dir_map) [function.fopen]: failed to open stream: Permission denied [CORE/cake/libs/file.php, line 146]

2008-11-02 Thread Anupom
I think you need to set writable permission to the /app/tmp directory and
its subdirectories.

On Sun, Nov 2, 2008 at 7:59 PM, Malcolm Krugger <[EMAIL PROTECTED]
> wrote:

>
> From time to time I get the following cakephp error
>
> Warning (2): fopen(cakephp/app/tmp/cache/persistent/cake_core_dir_map)
> [function.fopen]: failed to open stream: Permission denied [CORE/cake/
> libs/file.php, line 146]
>
> What could possibly be the reason?
>
> I'm using the latest cakephp
>
> Mal
> >
>


-- 
Anupom Syam
http://syamantics.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
-~--~~~~--~~--~--~---



Warning (2): fopen(cakephp/app/tmp/cache/persistent/cake_core_dir_map) [function.fopen]: failed to open stream: Permission denied [CORE/cake/libs/file.php, line 146]

2008-11-02 Thread Malcolm Krugger

>From time to time I get the following cakephp error

Warning (2): fopen(cakephp/app/tmp/cache/persistent/cake_core_dir_map)
[function.fopen]: failed to open stream: Permission denied [CORE/cake/
libs/file.php, line 146]

What could possibly be the reason?

I'm using the latest cakephp

Mal
--~--~-~--~~~---~--~~
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: Building "Tagging" feature in my site

2008-11-02 Thread Anupom
Sorry I got it wrong in hurry :) Can you please check out the following
schema again?

tags: id, name
entity_types: id, name   [(0, Posts), (1, Teachers), (2, Books)]
posts: id, name
teachers: id, name
books: id, name
entities_tags: id, entity_id, entity_type_id, tag_id

With this schema please have your models like the following,

*Post Model*
 array (
'className' => 'Tag',
'joinTable' => 'entities_tags',
'foreignKey' => 'entity_id',
'associationForeignKey' => 'tag_id',
'conditions' => 'entity_type_id = 0'
)
);
}
?>

*Teacher Model*
 array (
'className' => 'Tag',
'joinTable' => 'entities_tags',
'foreignKey' => 'entity_id',
'associationForeignKey' => 'tag_id',
'conditions' => 'entity_type_id = 1'
)
);
}
?>

*Book Model*
 array (
'className' => 'Tag',
'joinTable' => 'entities_tags',
'foreignKey' => 'entity_id',
'associationForeignKey' => 'tag_id',
'conditions' => 'entity_type_id = 2'
)
);
}
?>

*Tag Model*



I could not try out this code. But I hope it will work and serve the purpose
:)

Thanks.


On Sun, Nov 2, 2008 at 5:36 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

>
> This does not serve the purpose because tagging needs to be
> implemented on all the 3 types of entities : Posts, Teachers and
> Books .
>
> On Nov 1, 11:15 pm, Anupom <[EMAIL PROTECTED]> wrote:
> > Please find my suggested db design below,
> >
> > tags: id, name
> > types: id, name
> > posts: id, name
> > teachers: id, name
> > books: id, name, type_id
> > books_tags: id, book_id, tag_id
> > All ids are auto increment & primary  fields.
> >
> > So if, the book with (id, name, type_id) = (6, 'Bookname', 2) has two
> tags
> > with (id, name) = (11, 'Chemistry') & (23, 'Grade A'), then the entry in
> the
> > books_tags(book_id, tag_id) table for this will be -  (6, 11) & (6, 23) .
> > Also read this page from the dochttp://
> book.cakephp.org/view/24/Model-and-Database-Conventions
> >
> > --
> > Anupom Syamhttp://syamantics.com/
> >
> > On Sat, Nov 1, 2008 at 8:42 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
> >
> > > Hi All,
> >
> > > I am trying to build a tagging feature in my site which is a community
> > > site for a school.
> >
> > > In my site, I have various entity types like : Blog Post, Teacher,
> > > Book .
> >
> > > Every entry for these entities will have tags associated with it . So,
> > > a tag may belong to one or more items of different entities.
> >
> > > In a normal core PHP project, I would have designed tables for this in
> > > the following manner :-
> >
> > > 1) tags : tag_id, tag_name .
> > > 2) entity_types : entity_type_id, entity_type_name .   [(0, Posts),
> > > (1, Teachers), (2, Books)]
> > > 3) posts : post_id, post_name .
> > > 4) teachers : teacher_id, teacher_name .
> > > 5) books : book_id, book_name
> > > 6) entities_tags : tag_id, entity_type_id, entity_id .
> >
> > > So, if a book (entity_type_id = 2) with book_id = 6 has 2 tags
> > > (tag_id, tag_name) : (11, 'Chemistry') & (23, 'Grade A') , then the
> > > entry in entities_tags for this will be : (11, 2, 6) & (23, 2, 6) .
> >
> > > I am using CakePHP for my project and I am not able to design the
> > > tables in CakePHP for this Tagging Feature.
> >
> > > It would be great if people could come up with their suggestions.
> >
> > > Thanks a lot !!
> >
>


-- 
Anupom Syam
http://syamantics.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
-~--~~~~--~~--~--~---



Re: Building "Tagging" feature in my site

2008-11-02 Thread [EMAIL PROTECTED]

This does not serve the purpose because tagging needs to be
implemented on all the 3 types of entities : Posts, Teachers and
Books .

On Nov 1, 11:15 pm, Anupom <[EMAIL PROTECTED]> wrote:
> Please find my suggested db design below,
>
> tags: id, name
> types: id, name
> posts: id, name
> teachers: id, name
> books: id, name, type_id
> books_tags: id, book_id, tag_id
> All ids are auto increment & primary  fields.
>
> So if, the book with (id, name, type_id) = (6, 'Bookname', 2) has two tags
> with (id, name) = (11, 'Chemistry') & (23, 'Grade A'), then the entry in the
> books_tags(book_id, tag_id) table for this will be -  (6, 11) & (6, 23) .
> Also read this page from the 
> dochttp://book.cakephp.org/view/24/Model-and-Database-Conventions
>
> --
> Anupom Syamhttp://syamantics.com/
>
> On Sat, Nov 1, 2008 at 8:42 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > Hi All,
>
> > I am trying to build a tagging feature in my site which is a community
> > site for a school.
>
> > In my site, I have various entity types like : Blog Post, Teacher,
> > Book .
>
> > Every entry for these entities will have tags associated with it . So,
> > a tag may belong to one or more items of different entities.
>
> > In a normal core PHP project, I would have designed tables for this in
> > the following manner :-
>
> > 1) tags : tag_id, tag_name .
> > 2) entity_types : entity_type_id, entity_type_name .   [(0, Posts),
> > (1, Teachers), (2, Books)]
> > 3) posts : post_id, post_name .
> > 4) teachers : teacher_id, teacher_name .
> > 5) books : book_id, book_name
> > 6) entities_tags : tag_id, entity_type_id, entity_id .
>
> > So, if a book (entity_type_id = 2) with book_id = 6 has 2 tags
> > (tag_id, tag_name) : (11, 'Chemistry') & (23, 'Grade A') , then the
> > entry in entities_tags for this will be : (11, 2, 6) & (23, 2, 6) .
>
> > I am using CakePHP for my project and I am not able to design the
> > tables in CakePHP for this Tagging Feature.
>
> > It would be great if people could come up with their suggestions.
>
> > Thanks a lot !!
--~--~-~--~~~---~--~~
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: Not able to see my first page

2008-11-02 Thread Anupom
Point your browser to http://localhost/CakeTooDoo/tasks/index, this should
show you the page.

If you want to make the tasks/index page your home page, then open
/app/config/routes.php and find the following line there,
 Router::connect('/', array('controller' => 'tasks', 'action' =display',
'homedex'));
Replace this line with the following,
Router::connect('/', array('controller' => 'tasks', 'action' =>
'index'));

On Sun, Nov 2, 2008 at 12:29 PM, pritz <[EMAIL PROTECTED]> wrote:

>
> Hello Members,
>
> Database name:caketodo
> table name:tasks
>
> CakeTooDoo\app\views\tasks\index.cpt
>
> Tasks
>
> CakeTooDoo\app\controllers\tasks_controller.php
>
> 
> class TasksController extends AppController{
>var $name='Tasks';
>
>function index()
>{
>   $this->set('tasks', $this->Post->find('all'));
>}
> }
> ?>
>
> \CakeTooDoo\app\models\task.php
> 
> class Task extends AppModel {
>var $name='Task';
> }
> ?>
>
> This is how i started instead of showing message Tasks  it is
> showing me the index page of CakeTooDoo directory ...
>
> CakePHP Rapid Development
> Your database configuration file is present.
>
> Cake is able to connect to the database.
>
>
>
> CakePHP release information is on CakeForge
> Read the release notes and get the latest version
> Editing this Page
> To change the content of this page, create: /app/views/pages/
> home.thtml.
> To change its layout, create: /app/views/layouts/default.thtml.
> See the views section of the manual for more info
> You can also add some CSS styles for your pages at: app/webroot/css/.
>
> More about Cake
> CakePHP is a rapid development framework for PHP which uses commonly
> known design patterns like Active Record, Association Data Mapping,
> Front Controller and MVC.
>
> 
>
> Please let me know what i am missing.
>
> I am working on WAMP on window xp.
>
> Plz help to solve this.
>
> Thanks.
>
> >
>


-- 
Anupom Syam
http://syamantics.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
-~--~~~~--~~--~--~---



Not able to see my first page

2008-11-02 Thread pritz

Hello Members,

Database name:caketodo
table name:tasks

CakeTooDoo\app\views\tasks\index.cpt

Tasks

CakeTooDoo\app\controllers\tasks_controller.php

set('tasks', $this->Post->find('all'));
}
}
?>

\CakeTooDoo\app\models\task.php


This is how i started instead of showing message Tasks  it is
showing me the index page of CakeTooDoo directory ...

CakePHP Rapid Development
Your database configuration file is present.

Cake is able to connect to the database.



CakePHP release information is on CakeForge
Read the release notes and get the latest version
Editing this Page
To change the content of this page, create: /app/views/pages/
home.thtml.
To change its layout, create: /app/views/layouts/default.thtml.
See the views section of the manual for more info
You can also add some CSS styles for your pages at: app/webroot/css/.

More about Cake
CakePHP is a rapid development framework for PHP which uses commonly
known design patterns like Active Record, Association Data Mapping,
Front Controller and MVC.



Please let me know what i am missing.

I am working on WAMP on window xp.

Plz help to solve this.

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: Broken image if shown with file_get_contents()

2008-11-02 Thread Anupom
Can you please try with the following code?

function view() {
Configure::write('debug', 0);
header('Content-type: image/jpeg;');
echo file_get_contents(WWW_ROOT . 'img' . DS . 'folder' . DS .
'test.jpg');
exit;
}

On Sun, Nov 2, 2008 at 4:36 AM, Giaco <[EMAIL PROTECTED]> wrote:

>
> Hello,
>
> for security reasons and on the fly resizing I route all picture
> requests to /images/view ("images" being the controller).
>
> But this function outputs only a broken image:
>
> /* images controller (for testing purposes no use of view and layout)
> */
> function view() {
>Configure::write('debug', 0);
>header('Content-type: image/jpeg;');
>echo file_get_contents("img/folder/test.jpg");
> }
>
> When I don't send the header, I see the binary version of the image.
> What could this possibly be?
>
> >
>


-- 
Anupom Syam
http://syamantics.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
-~--~~~~--~~--~--~---



Re: Form fields after bad submit

2008-11-02 Thread Adam Royle

Make sure you post back to the same action the form is on, and you
aren't redirecting between when the validation error occurs and the re-
display of the form.

Cheers,
Adam

On Nov 2, 8:55 am, Al <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm using Cake 1.2 RC3.
>
> In a signup form after a submit, (after a validation error occurs) all
> of the text that the user tried to submit is cleared.  How can I get
> that to stay after a validation error so that they can just correct
> the mistake they made an resubmit?
>
> For some reason I though that cake handled that automagically, but
> maybe I'm not doing something right.. Any suggestions?
>
> Thanks,
> al
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---