Re: Proper way to handle empty localization strings?

2010-04-21 Thread O.J. Tibi
Oh, and by the way, a follow up tip: if you need to embed variable
values INSIDE your translation strings, you may want to use sprintf()
and named parameters for argument swapping. Check http://php.net/sprintf
for details on these.

Cheers again!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to output UTF-8 sign?

2010-04-21 Thread John Andersen
Try to add a CSS class to the sort link and then use CSS to add
something to the link.
For example:

[code]
$paginator-sort('id', 'id', array('class' = 'asc');
[/code]

and when clicked on, change into:

[code]
$paginator-sort('id', 'id', array('class' = 'desc');
[/code]

Then with CSS make the sort link have an after symbol:

[code]
.asc{
   background:url(up_arrow.png) no-repeat top right;
   padding-right:8px;
}
.desc{
   background:url(down_arrow.png) no-repeat top right;
   padding-right:8px;
}
[/code]

I haven't tested the above pseudo code :) but maybe it can be done!
The padding ensures that the background image will be visible to the
right of the link text - assuming you can make an arrow that is max 8
pixels wide.
Enjoy,
   John

On Apr 21, 8:54 am, sebb86 kahlc...@googlemail.com wrote:
 Addition:
 [code]
 uarr;
 [/code]

 also works. But also _not_ inside the paginate source code.
 Any ideas?

 Thanks if someone can help!
 [snip]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: View (form-input) - Disable word wrap?

2010-04-21 Thread sebb86
John

Thanks a lot for all your help.
In your example, is the cake.generic.css file the original?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: date display

2010-04-21 Thread violet nunda
thank you very much for the immediate response,i figured out that it was
because of the css settings in the cake.generic.css.now forms are displaying
well,now have to work on making the Interface appear better.i am also trying
to work on implementing sending email to someone using phpmailer-cakePHP.i
tried to follow the cook book,but now i dont see the functionality working.i
was refering to the following link:
http://bakery.cakephp.org/articles/view/sending-email-with-phpmailer

they stated 5 major functionalities i had 2 build,of which i only created
empty files as i didnt know whether there where supposed to be lines of code
inside them.
5 functionalities:
You will create:

1. cakePHP component
2. a vendor package
3. view for plain text email body
4. view for HTML email body
5. a function in your controller to send mail.
i really want to have this functionality,thank you in advance Cricket


On Tue, Apr 20, 2010 at 5:47 PM, cricket zijn.digi...@gmail.com wrote:

 On Apr 20, 5:30 am, OpnetITGuru vnu...@gmail.com wrote:
  hi i am getting a very bad date output on my form,i am still new in
  cakePHP framework.i want it to display in one horizintal line i.e
  showing  in the following manner (YMD) in a sigle horizontal  line not
  in vertical format like this:year displaying  in one line followed by
  month in another line.
 
  code in the form: ?php
  echo $form-input('date logged',array('type'='date',
 'format'='Y-M-
  D'));
  ?

 I think this is due to the HTML elements not having enough space and
 wrapping. Are these displayed inside a table cell?

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to output UTF-8 sign?

2010-04-21 Thread sebb86
Hello and sry that i have to ask again.
But i dont know, what the correct syntax for the pagination is.
At the moment i have:
[code]
?php echo $paginator-sort(array('asc' ='id v', 'desc' ='id ^'),
'id'); ?
[/code]

How do i get class definitions inside?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: mac users, which ide are you using to develop cakephp?

2010-04-21 Thread j0n4s.h4rtm...@googlemail.com
Textmate.app
Sequel Pro.app
git PushPull via GitHub and Cyberduck.app
Terminal.app + Cake Bake
Console.app / Text Logs and Cake Debug
Could use DebugKit
Could use XDebug
Could use Fixtures and Test Cases

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


How to avoid the redundant code, is it possible to write that code write in one function and we have to call other functions, please help me out

2010-04-21 Thread Narendra Padala
Hi all i am new to cake php please help me

My problem is:

common code for all the controller methods and other controller
methods also

--common code start---

 if(!isset($intCurrentMenu)){
  $intCurrentMenu = -1;
 // $this-set('intCurrentMenu', $intCurrentMenu );
 }

 if($intCurrentMenu == ){
 $intCurrentMenu = -1;
 $this-set('intCurrentMenu', $intCurrentMenu );
 }


 if(isset($intCurrentMenu)){
 // $this-set('intCurrentMenu', $intCurrentMenu );
 }




 ## Start menu population ##



 $arrMenuItem = array(Wizard,
  Advertisements,
  Music,
  Settings,
  Logs,
  Program Options
 );




 $arrMenuHint = array(Links on wizard main page,
  Play advertisements,
  Manipulate music,
  Change settings,
  View logs,
  Create users and groups);







 //$strURLDir = player/;


 $arrMenuChild[0] = array(Volumes,
  Format Clock,
  Times,
  Today's Music,
  Feedback,
  Profiles,
  Media Loader,
  System,
  Reports,
  Details,
  Broadcast Manager
);


 $arrMenuImg[0] = array(wizard_volume.png,
format_clock.gif,
wizard_time.png,
wizard_music.png,
wizard_feedback.png,
wizard_profile.png,
media_loader1.png,
wizard_diagnostic.png,
wizard_reports.png,
wizard_details.png,
broadcast1.png
  );


 $arrMenuURL[0] = array(volumes.php,
format_clock/index.php,
store_times.php,
todays_music.php,
feedback.php,
profiles.php,
medialoader.php,
system.php,
menu.php,
store_details.php,
broadcastmanagement.php
   );





 //$strURLDir = ;



 $arrMenuChild[1] = array(Play an Advertisement,
  Multiple Scheduler,
  Media Loader,
  Advertisement Schedule,
  Scheduled Files In Waiting,
  Scheduled Files Played
 );


 $arrMenuImg[1] = array(play.gif,
multiple.png,
medialoader.png,
annsched.png,
schedfileswait.png,
schedfilesplayed.png
   );


 $arrMenuURL[1] = array(custom_scheduler.php,
custom_scheduler_multiple.php,
medialoader.php,
announcement_schedule.php,
schedfiles_waiting.php,
schedfiles_played.php
   );


 //$strURLDir = ;


 $arrMenuChild[2] = array(Music History,
  Music Profiles,
  Media Loader,
  CD-ROM Tray
 );


 $arrMenuImg[2] = array(music_history.gif,
music_profiles.png,
medialoader.png,
cdromtray.png
   );


 $arrMenuURL[2] = array(music_history.php,
music_profiles.php,
medialoader.php,
cdromtray.php
   );



 //$strURLDir = ;


 $arrMenuChild[3] = array(Settings,
  Volume Settings,
  System,
  

Helpers in controllers

2010-04-21 Thread calvin
So I just encountered a situation where I'd like to use a helper in my
controller even though this seems to break with Cake's MVC design.
Googling the topic turned up a thread in this group in which
loadHelper() is proposed as a means of doing just that, but it still
seems to be discouraged.

What I'm wondering is, if this is discouraged, then why does the Time
Helper have day/daysAsSql(). I cannot fathom a common scenario where
you would need to display a date as:

($field_name = '2008-01-21 00:00:00') AND ($field_name = '2008-01-21
23:59:59')

in a view to justify the inclusion of those two functions in a helper
rather than a component.

Is using a helper in a view really so taboo?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Advance Cakephp problem

2010-04-21 Thread accou...@myadengine.com
Hi,

Anyone ever tried adword api with cake before?

I got this problem, and don't know how to solve. Let say we have
KeywordsController in cake, and within this controller we create new
google keyword object, with new Keyword().

Then what happen was, the cakephp object Keyword, get overwritten by
google Keyword Object. When i comes to render the view, all the
viewVars show the value of google keyword object and return an error.

I tried to save the cakephp Object by using like :  $cakeObj =
serialize($this). I was thinking that I can re - overwrite google
keyword object with cakephp object, but don't know how exactly to do
this.

Any idea ?

Thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Advance Cakephp problem

2010-04-21 Thread Jeremy Burns
Or rename your controller to something that doesn't clash with Google's?

Jeremy Burns
jeremybu...@me.com
On 21 Apr 2010, at 08:27, accou...@myadengine.com wrote:

 Hi,
 
 Anyone ever tried adword api with cake before?
 
 I got this problem, and don't know how to solve. Let say we have
 KeywordsController in cake, and within this controller we create new
 google keyword object, with new Keyword().
 
 Then what happen was, the cakephp object Keyword, get overwritten by
 google Keyword Object. When i comes to render the view, all the
 viewVars show the value of google keyword object and return an error.
 
 I tried to save the cakephp Object by using like :  $cakeObj =
 serialize($this). I was thinking that I can re - overwrite google
 keyword object with cakephp object, but don't know how exactly to do
 this.
 
 Any idea ?
 
 Thanks
 
 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.
 
 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Helpers in controllers

2010-04-21 Thread euromark
this question has been answered like a million times
please try to search for it first!
helper controller in the above search field gets

http://groups.google.com/group/cake-php/browse_thread/thread/64c8ae45d89f4c76/f715c23b12822374
+ many others


On 21 Apr., 07:10, calvin cal...@rottenrecords.com wrote:
 So I just encountered a situation where I'd like to use a helper in my
 controller even though this seems to break with Cake's MVC design.
 Googling the topic turned up a thread in this group in which
 loadHelper() is proposed as a means of doing just that, but it still
 seems to be discouraged.

 What I'm wondering is, if this is discouraged, then why does the Time
 Helper have day/daysAsSql(). I cannot fathom a common scenario where
 you would need to display a date as:

 ($field_name = '2008-01-21 00:00:00') AND ($field_name = '2008-01-21
 23:59:59')

 in a view to justify the inclusion of those two functions in a helper
 rather than a component.

 Is using a helper in a view really so taboo?

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Helpers in controllers

2010-04-21 Thread euromark
and no
its not that much of a taboo as long as there arent any corresponding
components/libs etc

the cleaner approach would be to write lib classes that get inherited
from both a component for controllers
and the helper for views
but as long as it is not so you have to break with the design a little
bit in order to avoid code redundance

just import the helper as mentioned in the link
for those time functions it is usually not neccessary to do that - a
simple date(...) call usually does the trick
but for flash messages with some formatting in it or other similar
matters i had to use some helpers, too

and it does only work for helpers that are independent (which dont
call $this-AnyOtherHelper inside each other)


On 21 Apr., 10:20, euromark dereurom...@googlemail.com wrote:
 this question has been answered like a million times
 please try to search for it first!
 helper controller in the above search field gets

 http://groups.google.com/group/cake-php/browse_thread/thread/64c8ae45...
 + many others

 On 21 Apr., 07:10, calvin cal...@rottenrecords.com wrote:



  So I just encountered a situation where I'd like to use a helper in my
  controller even though this seems to break with Cake's MVC design.
  Googling the topic turned up a thread in this group in which
  loadHelper() is proposed as a means of doing just that, but it still
  seems to be discouraged.

  What I'm wondering is, if this is discouraged, then why does the Time
  Helper have day/daysAsSql(). I cannot fathom a common scenario where
  you would need to display a date as:

  ($field_name = '2008-01-21 00:00:00') AND ($field_name = '2008-01-21
  23:59:59')

  in a view to justify the inclusion of those two functions in a helper
  rather than a component.

  Is using a helper in a view really so taboo?

  Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
  with their CakePHP related questions.

  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
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to avoid the redundant code, is it possible to write that code write in one function and we have to call other functions, please help me out

2010-04-21 Thread Zaky Katalan-Ezra
If I understood your problem currently.
Create an element for the menu.
Pass arguments to the element in order to decide which menu items to render.

You can consider splitting the menu to items with logic and static items,
then you will be able to cache the static items menu.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Kaching: CakePHP Shopping Cart Framework Plugin

2010-04-21 Thread fabio
Dear Mike,

thanks a lot for sharing your good work...

I'm trying to get Kaching working, but i've encountered an obstacle
regarding plugin routing... i guess
I'm trying and trying to solve this but I couldn't solve it yet...
that's why I'll try to explain it and hope on a little help...

Basicly I've correctly installed a fresh version of CakePHP 1.3 RC4 in
a subdirectory kache of my site:

http://www.example.com/kache

Then, I've followed all your precious guidelines on
http://code.google.com/p/kaching-php/wiki/Installation and it seems
that Kaching works fine underground, except for the routing problem
i'm going to explain with the following facts:

- if i point the browser to http://www.example.com/kache/kaching/ i
get a 403 Forbidden error
- if i point the browser to http://www.example.com/kache/kaching i get
a redirect to url http://www.trebiano.it/kache/app/webroot/kaching/
which ends with a 403 Forbidden error as well
- i could correctly create an admin user by pointing to url
http://www.example.com/kache/kaching/users/install (even if css style
was missing)
- i can correctly login to the admin interface by pointing to url
http://www.example.com//kache/kaching/users/login (even if css style
is missing)
- looking at html source of the pages i've noticed that all referred
elements (css stylesheet, images, ... ) are missing the kache part
in their url, and if i add it by virtually modifying the code with
FireBug everything renders fine...
- similarly, all the internal url-links in the pages are missing the
kache part and pointing to 404 error, but if i add the the kache
part to url they point fine

es.
http://www.example.com/kaching/categories/index -- 404error
http://www.example.com/kache/kaching/categories/index  -- OK (with no
css style)

http://www.example.com/kaching/shoppingcarts/view  -- 404error
http://www.example.com/kache/kaching/shoppingcarts/view -- OK (with
no css style)

..
..

and so on for all the pages...

In the end, since i think this is probably a rounting problem, I'm
trying to modify something in the files:

app/config/core.php
app/config/routes.php
app/plugins/kaching/config/routes.php

but with no succes til now... :-(

Actually i'm a web developer not yet 100% skilled in CakePHP and i
think i'm possibly missing both some basic routing concepts or maybe
something very stupid (as often happens)...

Did you maybe recognize where could be the problem looking at my
description ? Any useful tips ?

Thanks a lot in advance for a little help ;-)


Best regards

Tres





I'm a web developer not yet 100% skilled on CakePHP



On 16 Mar, 03:12, Mike mfrie...@gmail.com wrote:
 If your looking for a shoppingcart plugin for CakePHP that is
 distributed under the MIT License, here you 
 go...http://code.google.com/p/kaching-php

 Kachingis tailored for developers that want full control on building
 their online store.  Kachingprovides the store administration and
 lots of features (see project page).  You build the store's look and
 feel interacting with our controllers.

 Hopefully people can find this useful and either contribute features
 back or at least be able to use it as a starting point for their own
 online stores.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Kaching: CakePHP Shopping Cart Framework Plugin

2010-04-21 Thread fabio
Dear Mike,

thanks a lot for sharing your good work...

I'm trying to get Kaching working, but i've encountered an obstacle
regarding plugin routing... i guess
I'm trying and trying to solve this but I couldn't solve it yet...
that's why I'll try to explain it and hope on a little help...

Basicly I've correctly installed a fresh version of CakePHP 1.3 RC4 in
a subdirectory kache of my site:

http://www.example.com/kache

Then, I've followed all your precious guidelines on
http://code.google.com/p/kaching-php/wiki/Installation and it seems
that Kaching works fine underground, except for the routing problem
i'm going to explain with the following facts:

- if i point the browser to http://www.example.com/kache/kaching/ i
get a 403 Forbidden error
- if i point the browser to http://www.example.com/kache/kaching i get
a redirect to url http://www.example.com/kache/app/webroot/kaching/
which ends with a 403 Forbidden error as well
- i could correctly create an admin user by pointing to url
http://www.example.com/kache/kaching/users/install (even if css style
was missing)
- i can correctly login to the admin interface by pointing to url
http://www.example.com//kache/kaching/users/login (even if css style
is missing)
- looking at html source of the pages i've noticed that all referred
elements (css stylesheet, images, ... ) are missing the kache part
in their url, and if i add it by virtually modifying the code with
FireBug everything renders fine...
- similarly, all the internal url-links in the pages are missing the
kache part and pointing to 404 error, but if i add the the kache
part to url they point fine

es.
http://www.example.com/kaching/categories/index -- 404error
http://www.example.com/kache/kaching/categories/index  -- OK (with no
css style)

http://www.example.com/kaching/shoppingcarts/view  -- 404error
http://www.example.com/kache/kaching/shoppingcarts/view -- OK (with
no css style)

..
..

and so on for all the pages...

In the end, since i think this is probably a rounting problem, I'm
trying to modify something in the files:

app/config/core.php
app/config/routes.php
app/plugins/kaching/config/routes.php

but with no succes til now... :-(

Actually i'm a web developer not yet 100% skilled in CakePHP and i
think i'm possibly missing both some basic routing concepts or maybe
something very stupid (as often happens)...

Did you maybe recognize where could be the problem looking at my
description ? Any useful tips ?

Thanks a lot in advance for a little help ;-)

Best regards

Tres

On 16 Mar, 03:12, Mike mfrie...@gmail.com wrote:
 If your looking for a shoppingcart plugin for CakePHP that is
 distributed under the MIT License, here you 
 go...http://code.google.com/p/kaching-php

 Kachingis tailored for developers that want full control on building
 their online store.  Kachingprovides the store administration and
 lots of features (see project page).  You build the store's look and
 feel interacting with our controllers.

 Hopefully people can find this useful and either contribute features
 back or at least be able to use it as a starting point for their own
 online stores.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


ACL: $model-parentNode() and inheritence

2010-04-21 Thread Andras
hello again,

i have noticed the parentNode() of a model that actsAs an ACL
requester must return a parent record ( if it exists ) and not an
actual acl ( aro ) parent node as the name would suggest.

My question: is permission inheritance still possible this way? If i
have a Group that is directly parent to the User, but their AROs are
not, will my User still inherit Permissions from it's Group?

What i originally wanted to do is not have to establish a Group model,
but let certain bottom-level ARO ACL nodes represent user groups. ie.
User-parentNode( ) would not return a pointer to a Group record but
the actual parent node of it's aro node - shouldn't this be possible?

regards,
Andras

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Multi-level Models in CakePHP

2010-04-21 Thread WebbedIT
 wouldn't one be able to use $this-Model-unbindModel() to take away any 
 unwanted, extra associations?

Yes, but that's exactly why Containable was written, it's a
convenience wrapper that binds/unbinds all the relevant models based
on the info you supply in the contain array of your find call ... no
need to do it manually?

HTH

Paul

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: drop-down list - displayed values

2010-04-21 Thread WebbedIT
It;s likely that what jeremy says is right, and if this is the case
you can either

a) Rename a field in your db table to name

b) Specify the displayField attribute in your model to use a different
field for find('list')

c) Add a fields array to your find('list',
array('fields'=array('Model.id', 'Model.custom_name_field')));

HTH

Paul

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Different time outs for different Session variabes.

2010-04-21 Thread #2Will
Hello.

Is it possible to have different timeouts for different session
variables in cake?  I have a long session set in config.php so that
the admin area doesn't time out too quick. But i want variables
storing google tracking codes to time out on closing the window.

Thanks for any help.

Will

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: is it advisable to use jquery on cakephp?

2010-04-21 Thread WebbedIT
I've recently switched to jQuery from Prototype as there seems to be a
much wider availability of higher quality scripts available for it.

I'm on Cake 1.2.6 so I call everything manually and I found the
transition from Prototype to jQuery very easy (and I am terrible at
javascript).

HTH

Paul

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: News with Comments - how to sort by comments count?

2010-04-21 Thread WebbedIT
Whilst you doubt that your add/delete actions/callbacks are causing
the automagic not to happen, I can assure you that it must be
something somewhere in your configuration as counterCache works very
well :o)

Cricket may be on to something though, if your site is in production
mode (debug set to 0) then your models can get cached in the tmp
folder and your new changes do not get applied.

Paul

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Problem with rewrite or routing

2010-04-21 Thread WhyNotSmile
Hi, I've been trying for a while to get my cake site up and running
online... it's nearly there, but I seem to be having trouble with
routing, or rewriting or something.

Firstly, Cake doesn't seem to be finding my webroot.  When it looked
for the css directory, it was looking in domain.co.uk/css/file.css,
rather than in the webroot.  I uploaded the css and images directory
to the top level, i.e. in the same directory as 'app', and it can now
find them.

Secondly, it won't show me any page apart from the home page.  If I
try to link to another page, say domain.co.uk/pages/4, it says it
can't find it.  Presumably this is because it's looking for a
directory called 'pages' at the same level as app, and since that's
not there, it bails out.  In routes.php I have the line:
Router::connect('/pages/*', array('controller' = 'pages', 'action'
= 'display'));

The domain is softwaresolutionsni.co.uk, if anyone would be kind
enough to look.

Can anyone suggest what's going on?  I'm not particularly good with
rewrite rules and so on, so I don't really know where to start.

Thank you.
Sharon

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Advanced search form

2010-04-21 Thread WebbedIT
At present this query is a little general to get a good answer from
anyone.

What part of creating this form are you struggling with?

It's pretty much the same form you would show for adding a product
minus a number of the fields, but you'd still have a drop-down for
type, location, colour etc.

When submitted all the options would be available in $this-data and
you would then need to build your conditions for your find call?

HTH

Paul

On Apr 20, 7:59 pm, viis tarmo.ta...@gmail.com wrote:
 Is there anywhere a sample of an advanced search form that could be
 used for advanced search

 - where the user can select different criteria of search

 ( for example product type, select price range, select location,
 color,  etc.)

 would appreciate to see some code

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: refining search results

2010-04-21 Thread WebbedIT
At present this query is a little general to get a good answer from
anyone.  It's unlikely that someone will stop what they're doing,
write a load of code and hand it over to you, but if you give it a go
yourself and ask for assistance on specific problems as you hit them
then you are much more likely to get help.

What part of creating the forms/submitting ajax calls/building your
find queries are you struggling with?

HTH

Paul

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: reuseable Code with cakePHP

2010-04-21 Thread John Andersen
Are the data on the two servers the same? I just want to make sure
that it is not an issue with the data :)

As the two examples both are from the same location, then I would
still think that the issue is the data, or may even be old code (not
replaced in last code update).

I received your reply in my mailbox, please reply to the group as
standard!
Enjoy,
   John

On Apr 21, 8:22 am, davido xxx wrote:
 Hallo!

 If I would have found a mistake in the expected data I would be happy!
 But the code works on my local XAMPP but not on the live-server?

 regards

 david

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


CMS

2010-04-21 Thread chandrasekhar reddy
Hi friends,
 I need some information Regarding CMS(Content Management System). Is There
any CMS was Related to cakephp  (Like joomla,drupal ( for php))

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


where can i write controller for elements please help me out.

2010-04-21 Thread Narendra Padala

Hi All,
I am new to cakephp, When i am try to create menu i have problem,
where can i write controller for elements please help me out.


include file code here : views/elements/gravitybar.ctp
--

---gravitybar.ctp code start---
CENTER
?php

   $intCurrentMenuDispplay=$intCurrentMenu;
?

 TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 align=center

   TR
 TDnbsp;/TD
   /TR

   ?php

   //---POPU LATE THE PARENT MENU---

   $arrImages[0] = wizard.png;

   $arrImages[1] = announcements.png;

   $arrImages[2] = music.png;

   $arrImages[3] = settings.png;

   $arrImages[4] = logs.png;

   $arrImages[5] = program_options.png;

   for($mainmenu = 0;$mainmenu  count($arrMenuItem);$mainmenu++){

$strMainMenu = $arrMenuItem[$mainmenu];

$hint = $arrMenuHint[$mainmenu];

$strMainMenu2 = $mainmenu;

if($mainmenu == $intCurrentMenu){
$strMainMenu2 = ;
}

   ?

   TR

TD ALIGN=center

?php
   $intCurrentMenu=$strMainMenu2;
   echo $html-
image($arrImages[$mainmenu],array('title'=$hint,
 
'border'=0,
 
'url' = array(
 
'controller'=$ctrl,
 
'action'='$metchod',
 
$intCurrentMenu,)));
?

TABLE align=center BGCOLOR=#4E4E4E

?php

//---POPULATE THE CHILD MENU---

if($intCurrentMenuDispplay == $mainmenu) {

   for($submenu = 0;
   $submenu  count($arrMenuChild[$mainmenu]);
   $submenu++){

$strSubMenu = $arrMenuChild[$mainmenu]
[$submenu];

$strMenuImg = $arrMenuImg[$mainmenu]
[$submenu];

$strMenuURL = $arrMenuURL[$mainmenu]
[$submenu];

$strHeader =
stripslashes(urlencode($strSubMenu));

?

TR

  TD ALIGN=center NOWRAP
  BR /

   ?php  echo $html-
image($strMenuImg,array('title'= $hint,
 
'border'=0,
  'url' =
array(
 
'controller'=$ctrl,
 
'action'='index',$strMenuURL,)));
   ?
  BR /
  FONT SIZE=1 COLOR=#FF 
B
 ?php
echo stripslashes($strSubMenu);
 ?
/B
  /FONT
  /A

?php

if(($submenu + 1) ==
count($arrMenuChild[$mainmenu])) {

?
BRBR
?php

}

?

/TD

/TR

?php

}

}

?

 /TABLE/TD

  /TR

?php

}

?
/TABLE

/CENTER

---gravitybar.ctp code end---


Controller method
---

function gravitybar($intCurrentMenu=-1){

 if(!isset($intCurrentMenu)){
  $intCurrentMenu = -1;
 // $this-set('intCurrentMenu', $intCurrentMenu );
 }

 if($intCurrentMenu == ){
 $intCurrentMenu = -1;
 $this-set('intCurrentMenu', $intCurrentMenu );
 }


 if(isset($intCurrentMenu)){
 // $this-set('intCurrentMenu', $intCurrentMenu );
 }




 ## Start menu population ##



 $arrMenuItem = array(Wizard,
  Advertisements,
  Music,
  Settings,
  Logs,
  Program Options
 );




 $arrMenuHint = array(Links on wizard main page,
  Play advertisements,
  Manipulate music,
  Change settings,
  View logs,
  Create users and groups);







 //$strURLDir = player/;


 $arrMenuChild[0] = array(Volumes,
  Format Clock,
  Times,
  Today's Music,
  Feedback,
  Profiles,
  Media Loader,
  System,
  Reports,
  Details,
  Broadcast Manager
);


 $arrMenuImg[0] = array(wizard_volume.png,
format_clock.gif,
wizard_time.png,
wizard_music.png,
wizard_feedback.png,

update status bar issue

2010-04-21 Thread Bryan Lim
Hi all,

I am new to cakephp.
I want to create a simple twitter update status bar. I use
twitterlibphp. But it can't seems to work. I am not sure what is
wrong. Can only deduce that the view has a problem. I simply took the
add() view and modify it. Should I be using a form? I also attached my
controller method update_status() under tweets_controller.

the url is localhost/twitter/tweets/update_status
following localhost/application/controller/action



so here's my view.

update_status.ctp

div class=tweets form
?php echo $form-create('');?
fieldset
legend?php __('Status Update');?/legend
?php
echo $form-input('what are you doing now?');
?
/fieldset
?php echo $form-end('Update');?
/div
div class=actions
ul
li?php echo $html-link(__('List Tweets', true), 
array('action'
= 'index'));?/li
/ul
/div



update_status() under tweets controller

   function update_status($id = null) {


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

  $status_string = $this-data;
  $twitter = new Twitter(userid,
pwd,);

if ($twitter-updateStatus($status_string)) {

//$this-redirect(array('action'='index'));
$this-Session-
setFlash(__('The Tweet has been sent', true));

} else {
$this-Session-setFlash(__('The Tweet 
could not be sent. Please,
try again.', true));
}
}



}



Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: _controller convention

2010-04-21 Thread Bryan Lim
ok.. thank you! :)

On Apr 21, 11:29 am, Miles J mileswjohn...@gmail.com wrote:
 There is no real reason. Just makes it easier to differentiate files
 that are open in your editor.

 On Apr 20, 8:14 pm, Bryan Lim ytbr...@gmail.com wrote:



  But don't the model and view need a _model or _view then?

  what is the rationale behind having a _controller?

  Thanks!
  Bryan

  On Apr 20, 10:57 pm, cricket zijn.digi...@gmail.com wrote:

   On Apr 20, 1:21 am, Bryan Lim ytbr...@gmail.com wrote:

Hi all,

according to the convention

why is only controller named by _controller ? while model and view
aren't following..

   I think it's more an object-oriented convention than specific to Cake.
   The class names need to be unique.

   Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers 
   with their CakePHP related questions.

   You received this message because you are subscribed to the Google Groups 
   CakePHP group.To post to this group, send 
   emailtocake-...@googlegroups.com
   To unsubscribe from this group, send email 
   tocake-php+unsubscr...@googlegroups.comfor more options, visit this group 
   athttp://groups.google.com/group/cake-php?hl=en

  Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
  with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups 
  CakePHP group. To post to this group, send email 
  tocake-...@googlegroups.com
  To unsubscribe from this group, send email 
  tocake-php+unsubscr...@googlegroups.comfor more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups 
 CakePHP group.To post to this group, send email tocake-...@googlegroups.com
 To unsubscribe from this group, send email 
 tocake-php+unsubscr...@googlegroups.comfor more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: mac users, which ide are you using to develop cakephp?

2010-04-21 Thread Bryan Lim

skitle , you just made me download coda.

On Apr 21, 1:22 am, skitle lancegerst...@gmail.com wrote:
 Coda. Disclaimer: You will hate every other editor once you use it.

 On Apr 20, 10:24 am, Jamie jamie@gmail.com wrote:



  Textmate. It's worth it.

  On Apr 18, 9:14 pm, Bryan Lim ytbr...@gmail.com wrote:

   Hi all,

   mac users, which ide are you using to develop cakephp? to compile and
   to debug?

   I search the group here and realised this discussion is dated back to
   2009. So, I want to know if there's any changes?

   thanks,
   Bryan

   Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers 
   with their CakePHP related questions.

   You received this message because you are subscribed to the Google Groups 
   CakePHP group.  To post to this group, send email 
   tocake-...@googlegroups.com
   To unsubscribe from this group, send email to 
   cake-php+unsubscr...@googlegroups.comfor more options, visit this group 
   athttp://groups.google.com/group/cake-php?hl=en

  Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
  with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups 
  CakePHP group. To post to this group, send email 
  tocake-...@googlegroups.com
  To unsubscribe from this group, send email 
  tocake-php+unsubscr...@googlegroups.comfor more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups 
 CakePHP group.To post to this group, send email tocake-...@googlegroups.com
 To unsubscribe from this group, send email 
 tocake-php+unsubscr...@googlegroups.comfor more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to output UTF-8 sign?

2010-04-21 Thread John Andersen
The pagination-sort syntax can be seen here:
http://api12.cakephp.org/class/paginator-helper#method-PaginatorHelpersort

which says sort(title, key, options) and it is in the options array
that you put the class definition.
Enjoy,
   John

On Apr 21, 10:03 am, sebb86 kahlc...@googlemail.com wrote:
 Hello and sry that i have to ask again.
 But i dont know, what the correct syntax for the pagination is.
 At the moment i have:
 [code]
 ?php echo $paginator-sort(array('asc' ='id v', 'desc' ='id ^'),
 'id'); ?
 [/code]

 How do i get class definitions inside?

[snip]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: View (form-input) - Disable word wrap?

2010-04-21 Thread John Andersen
I don't use the cake.generic.css file, I use my own definitions, some
as in the example!
Enjoy,
   John

On Apr 21, 9:28 am, sebb86 kahlc...@googlemail.com wrote:
 John

 Thanks a lot for all your help.
 In your example, is the cake.generic.css file the original?

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Ajax Helper not respecting routes

2010-04-21 Thread Bryan Paddock
Hey all,

Weird problem. I have a ajax search form and retrieves submissions and
inserts them into a div.

The ajax is working although the controller does not respect the prefix.

?php
  echo $form-create('Submission');
  echo $form-input('search', array('class' = 'quicksearch'));
  echo $ajax-submit('Submit', array(
'class' = 'quicksearchsubmit',
'url'= '/judge/submissions/search',
'update' = 'submissions-list'));
  echo $form-end();
?

When I submit I get the cake error in the div with the full layout saying
that the search function is not available in the submissions controller.
Nothing about judge_search.

Routes are definitely working as I am logging in and using the routes
properly.

Anyone having this same prob?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: CMS

2010-04-21 Thread Leonid Mamchenkov
Hi,

On Wed, Apr 21, 2010 at 13:16, chandrasekhar reddy chanduc...@gmail.com wrote:
  I need some information Regarding CMS(Content Management System). Is There 
 any CMS was Related to cakephp  (Like joomla,drupal ( for php))

Try Google for CakePHP CMS - there is a whole bunch of links,
articles, and reviews.  For example:

* Wildflower - http://wf.klevo.sk/
* Croogo - http://croogo.org/

--
Leonid Mamchenkov
http://mamchenkov.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


1.3rc4 and saveAll, strange return values

2010-04-21 Thread Martin Westin
I wanted to get some input on the return I get from Model::saveAll().
(I am on 1.3 RC4)

When trying to save multiple records of the same model things did not
save at all at first due to the new validation default. I needed
individual validation so that correct records would save but invalid
ones would be tossed.

So I have added validate true like so:
$this-Modename-saveAll($this-
data['Modename'],array('validate'=true));

Problem is I now expected an array of return values, one for each
record as hinted at (somewhere, can't find it now) but I all I get is
false. Even though 3 out of 4 records are saved. I was under the
impression that saveAll would return an array for these partial
successes. Perhaps not?

With validate set to first I do get an array back... but only an empty
one.

Is this a bug and should have a ticket or is there just some confusion
in the way I have read the docs?

thanks
Martin

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: CMS

2010-04-21 Thread Sitthykun LY
Thank Leonid

On Wed, Apr 21, 2010 at 6:27 PM, Leonid Mamchenkov leo...@mamchenkov.netwrote:

 Hi,

 On Wed, Apr 21, 2010 at 13:16, chandrasekhar reddy chanduc...@gmail.com
 wrote:
   I need some information Regarding CMS(Content Management System). Is
 There any CMS was Related to cakephp  (Like joomla,drupal ( for php))

 Try Google for CakePHP CMS - there is a whole bunch of links,
 articles, and reviews.  For example:

 * Wildflower - http://wf.klevo.sk/
 * Croogo - http://croogo.org/

 --
 Leonid Mamchenkov
 http://mamchenkov.net

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




-- 
Best regards,
Sitthykun LY

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: CMS

2010-04-21 Thread mufti ali
Hope this list will help you

5 CakePHP based Content Managament System
http://blogfreakz.com/cms/cakephp-based-cms/

On Wed, Apr 21, 2010 at 6:42 PM, Sitthykun LY ly.sitthy...@gmail.comwrote:

 Thank Leonid


 On Wed, Apr 21, 2010 at 6:27 PM, Leonid Mamchenkov 
 leo...@mamchenkov.netwrote:

 Hi,

 On Wed, Apr 21, 2010 at 13:16, chandrasekhar reddy chanduc...@gmail.com
 wrote:
   I need some information Regarding CMS(Content Management System). Is
 There any CMS was Related to cakephp  (Like joomla,drupal ( for php))

 Try Google for CakePHP CMS - there is a whole bunch of links,
 articles, and reviews.  For example:

 * Wildflower - http://wf.klevo.sk/
 * Croogo - http://croogo.org/

 --
 Leonid Mamchenkov
 http://mamchenkov.net

 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




 --
 Best regards,
 Sitthykun LY

  Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




-- 
Mufti Ali

http://webdev5.com
http://blogfreakz.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 1.3rc4 and saveAll, strange return values

2010-04-21 Thread Jon Bennett
 I wanted to get some input on the return I get from Model::saveAll().
 (I am on 1.3 RC4)

 When trying to save multiple records of the same model things did not
 save at all at first due to the new validation default. I needed
 individual validation so that correct records would save but invalid
 ones would be tossed.

 So I have added validate true like so:
 $this-Modename-saveAll($this-
data['Modename'],array('validate'=true));

 Problem is I now expected an array of return values, one for each
 record as hinted at (somewhere, can't find it now) but I all I get is
 false. Even though 3 out of 4 records are saved. I was under the
 impression that saveAll would return an array for these partial
 successes. Perhaps not?

If you use INNODB cake should wrap your save in a single transaction,
which means none of the records will be saved, and the invalid fields
highlighted in your form.

When not using transactions, saveall is probably a bad idea as you
say, some things get saved, some things don't.

hth

Jon

-- 
jon bennett - www.jben.net - blog.jben.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Ajax Helper not respecting routes

2010-04-21 Thread genellern
hi
i would do that this way:


echo $ajax-form(null,
'post',array('model'='Submission','action'='search','id'='formEdit','update'
= 'submissions-list'));
echo $form-input('search', array('class' = 'quicksearch'));
echo $form-submit();



     'url'= '/judge/submissions/search',

 ?

 When I submit I get the cake error in the div with the full layout saying
 that the search function is not available in the submissions controller.
 Nothing about judge_search.

 Routes are definitely working as I am logging in and using the routes
 properly.

 Anyone having this same prob?

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: CakePHP Auth Component cannot remember url before authentication

2010-04-21 Thread Prof. No Time
I got it dear. Thanks very much. I opened up the Auth component and
digested it myself (Afterall, its just another component written by a
brother of mine, lol).

I then discovered that the session variable for storing the intended
url is 'Auth.redirect', so I leveraged on it by checking it and
redirecting there if it exists, otherwise, I redirect to my own
default user role page. Its working like breeze!

THANK YOU.

On Apr 19, 12:01 pm, cricket zijn.digi...@gmail.com wrote:
 On Apr 19, 6:19 am, Prof. No Time libertylivingst...@gmail.com
 wrote:

  Thanks for the response Cricket, I have dumped my codes below. Please
  assist me. Regards.

  My AppController::beforeFilter()

  function beforeFilter(){
    $this-Auth-fields = array('username' = 'username', 'password' =
  'passkey');
    $this-Auth-allow($this-allowedActions);

 The above line is unnecessary.

    $this-Auth-authorize = 'controller';
    $this-Auth-loginAction = array('controller' = 'users', 'action'
  = 'login');
    $this-Auth-loginRedirect = array('controller' = 'pages', 'action'
  = 'display', 'home');
    $this-Auth-logoutRedirect = '/';
    $this-Auth-autoRedirect = false;

 The above line tellsAuthnot to call its own redirect() method, even
 though the redirect var is set.



  }

  My UsersController::login()

  if ($this-Auth-user()) {
      if (!empty($this-data)) {
        $this-Session-setFlash('You have been logged in
  successfully');
        $this-_postLoginOperations(); //This method redirects the user
  based on role
        $this-data = array();
      }
      $this-redirect($this-Auth-redirect());

 This is maybe a problem. You're instructingAuthto redirect if
 there's no submitted data. IOW, the first time the login view is
 displayed. That's what it looks like, anyway.

 But I can't say more without knowing what _postLoginOperations() does.

 When you say it doesn't work, do you mean thatAuthis sending you
 somewhere other than pages-display-home? Or that you're seeing an
 endless loop? Something else?

 Believe me--I know thatAuthcan be pretty darned confusing.

 Check out the newCakePHPQuestions sitehttp://cakeqs.organd help others with 
 theirCakePHPrelated questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


saveAll() with $fieldList problem

2010-04-21 Thread marco.rizze...@gmail.com
I want use Model-saveAll() with fieldList to avoid to save some
field
My problem is that I have in the related model two fields with the
same name but one field (of first model (ModelA) ) should be saved and
the other (of second model(ModelB)) shouldn't be save.
How do I set the fieldList in  saveAll to save the field of ModelA and
not save the ifield of ModelB
Many Thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: saveAll() with $fieldList problem

2010-04-21 Thread Jeremy Burns
Prefix all of your fields with the model name (it's good practice everywhere 
really). So ModelA.field_name, ModelB.field_name etc.

Jeremy Burns
jeremybu...@me.com
On 21 Apr 2010, at 14:40, marco.rizze...@gmail.com wrote:

 I want use Model-saveAll() with fieldList to avoid to save some
 field
 My problem is that I have in the related model two fields with the
 same name but one field (of first model (ModelA) ) should be saved and
 the other (of second model(ModelB)) shouldn't be save.
 How do I set the fieldList in  saveAll to save the field of ModelA and
 not save the ifield of ModelB
 Many Thanks
 
 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.
 
 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Is it possible to write common code in one function and i have to call that function when i was required

2010-04-21 Thread LunarDraco
If the code is meant to transform or in some way CRUD or manipulate
data and it needs to be accessible from multiple controllers, I would
push it down to the model that it is associated with. then in your
code you can call the function as $this-SomeModel-myFunction();
Pushing the code to the model will simplify using it from any
Controller, and it simplifies writing test for the function as well.

MVC -- weight the code in the same order heavy (M)odel, medium (V)iew
and light on the (C)ontroller.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Paginate - from paginated list to single paginated item

2010-04-21 Thread Bart
Hi paul,
Thanks for your reply.
I used your approach and it works! Thanks

Now I had the paginator configured in such a way that the order of the
items is done along a custom field 'order' and not by default along
'id'.
And it seems the find('neighbors') does not allow the indication of an
alternative ordering field.
I tested it trying out both
$this-Showcase-find('neighbors', array('field'='id', 'value'=2,
'order'='Showcase.order ASC'));
and
$this-Showcase-find('neighbors', array('field'='id', 'value'=2,
'order'='Showcase.order DESC'));
The outcome did not vary.

Any idea how to solve this?

Cheers
Bart




On Mar 13, 10:20 am, WebbedIT p...@webbedit.co.uk wrote:
 If wanting to show the previous andnextrecords in a dataset whilst
 viewing a particular record the find('neighbours') should do the trick

 http://book.cakephp.org/view/73/Retrieving-Your-Data#find-neighbors-811

 HTH

 Paul

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: is it advisable to use jquery on cakephp?

2010-04-21 Thread jacmoe
If you want to use a helper, powered by jQuery, but behaving like the
helper in Cake 1.2.x, then use this:
http://bakery.cakephp.org/articles/view/ajax-helper-with-jquery

I am using it with CakePHP 1.3.x without problems. :)

I also use jQuery without any helper, and even the new js engine, but
it depends on the task.

On Apr 19, 4:17 pm, Bryan Lim ytbr...@gmail.com wrote:
 question as above.
 I also want to ask if there's an official jquery helper for cakephp?
 The one at the bakery is kinda outdated.

 thanks!
 Bryan

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Checking multiple columns for duplication checking in model

2010-04-21 Thread Swanny
Is there a way in a model to verify that a record does not exist
already that matches a certain criteria. In the database table are
three columns: id, list_id and product_id. I would like to be able to
tell if there already exists a record with the same list_id AND
product_id as the one being added using the form which would then
produce an error as this would be a duplicate.

Example: I try to add a product with product_id 23 and list_id 12 but
the table already contains a record with this information.

Thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: NewBie Help Creating a simple Cake Blog, Return 404 Error

2010-04-21 Thread netpumber
So the debug as you can see is already in 2.
Configure::write('debug', 2);

I delete handmade controllers , models and view and bake them as you
say...with cake bake M/C/V command..

I add then the code and still returns me not found error :S

Whats going on ?

I have to use -app parameter ?

Thanks again for your time :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 'multiple' validation rule

2010-04-21 Thread cricket
On Apr 21, 12:54 am, Jeremy Burns jeremybu...@me.com wrote:
 Might it be something to do with the field name? What happens if you rename 
 it to election_office?

ElectionOffice is the model name.

I got the error msg to show up properly, though. I debugged $form-
validationErrors:

Array
(
[Election] = Array
(
[ElectionOffice] = Please select at least one Office
)

)

So, $form-error('Election.ElectionOffice') does the trick.

But it still won't save if an Office is selected but that validation
rule is present. I can't figure out how to debug what's going on when
that rule is encountered. The data comes in like:

Array
(
[ElectionOffice] = Array
(
[ElectionOffice] = Array
(
[0] = 1
[1] = 2
[2] = 3
[3] = 4
[4] = 5
)
)
[Election] = Array
(
[deadline] = 2010-04-29
)
)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Session startup function

2010-04-21 Thread ZAky
I need to utilize several things in my application when session start.
1. I read the cookie to determine the user selected language.
2. The user selected layout
3. The user theme
I also have a global parameter, the year the user select.

For all these parameters I check if a value exist in the session or in
the cookie if it doesn't exist I apply a default value by reading the
config or a static one.
So in my  beforeRender function I make the same things over and over
for every page

In my app_controller.php

function beforeRender () {
#Set the session app.year
if ($this-Session-check('app.year') == false)
{
#if not set create it with the default  value from core 
config
#Should happend once when the session starts.

$this-Session-write('app.year',Configure::read('app.year'));
}
$this-__initLaguage();

}

function __initLaguage()
{
$lang = $this - Cookie - read ('language');
if(!isset($lang))
{
$lang = 'he_IL';
}
Configure::write('Config.language', $lang);

$dir = $this-Session-read(layoutdir);

Can I do all just once when the session start and not for every page?
Can I do things when session end like the session length or some
preferences the user change?

Another related question.
My Admin can change the application default theme.
Can I change the core.php value I set for the default theme?

Thank you
Can I change the core.php

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 'multiple' validation rule

2010-04-21 Thread John Andersen
I think that Jeremy was on the right track! As the form expects a
field/column, then should the field not be named as ElectionOffice.id,
so that it points to a column in table!?
Maybe give it a try! You actually had the .id attached in your first
post!
Enjoy,
   John

On Apr 21, 8:44 pm, cricket zijn.digi...@gmail.com wrote:
 On Apr 21, 12:54 am, Jeremy Burns jeremybu...@me.com wrote:

  Might it be something to do with the field name? What happens if you rename 
  it to election_office?

 ElectionOffice is the model name.

 I got the error msg to show up properly, though. I debugged $form-

 validationErrors:

 Array
 (
     [Election] = Array
         (
             [ElectionOffice] = Please select at least one Office
         )

 )

 So, $form-error('Election.ElectionOffice') does the trick.

 But it still won't save if an Office is selected but that validation
 rule is present. I can't figure out how to debug what's going on when
 that rule is encountered. The data comes in like:

 Array
 (
     [ElectionOffice] = Array
         (
             [ElectionOffice] = Array
                 (
                     [0] = 1
                     [1] = 2
                     [2] = 3
                     [3] = 4
                     [4] = 5
                 )
         )
     [Election] = Array
         (
             [deadline] = 2010-04-29
         )
 )

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Checking multiple columns for duplication checking in model

2010-04-21 Thread Andy Dirnberger
Here's a stripped down example of how I do it:

app_model.php
class AppModel extends Model {

  ...

  function isUniqueMulti($data, $fields) {
if (!is_array($fields)) {
  $fields = array($fields);
}

foreach ($fields as $key) {
  $tmp[$key] = $this-data[$this-name][$key];
}

return $this-isUnique($tmp, FALSE);
   }
}

some_model.php
class SomeModel extends AppModel {
  var $validate = array(
'field1' = array(
  'rule' = array('isUniqueMulti', array('field1', 'field2')),
  'required' = TRUE,
  'message' = 'Error Message',
),
'field2' = array(
  'rule' = 'notEmpty',
  'required' = TRUE,
  'message' = 'Error Message',
),
  );
}

On Apr 21, 8:40 am, Swanny stuarts...@gmail.com wrote:
 Is there a way in a model to verify that a record does not exist
 already that matches a certain criteria. In the database table are
 three columns: id, list_id and product_id. I would like to be able to
 tell if there already exists a record with the same list_id AND
 product_id as the one being added using the form which would then
 produce an error as this would be a duplicate.

 Example: I try to add a product with product_id 23 and list_id 12 but
 the table already contains a record with this information.

 Thanks

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 'multiple' validation rule

2010-04-21 Thread cricket
On Apr 21, 1:56 pm, John Andersen j.andersen...@gmail.com wrote:
 I think that Jeremy was on the right track! As the form expects a
 field/column, then should the field not be named as ElectionOffice.id,
 so that it points to a column in table!?
 Maybe give it a try! You actually had the .id attached in your first
 post!

When I do $form-select('ElectionOffice.id', ...) validation fails. If
I then name the validation rule ''ElectionOffice.id' it also fails.
I've also tried 'Election.ElectionOffice.id' and
'ElectionOffice.ElectionOffice.id'.

Gotta love poorly documented features! I guess I'll have to stick with
doing it manually.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: NewBie Help Creating a simple Cake Blog, Return 404 Error

2010-04-21 Thread Sam Sherlock
does it return a cake error 404 or an apache gen error 404?

what code do you add after baking.  Bake should generate all you need to be
able to add, edit,delete and view posts

- S




On 21 April 2010 16:25, netpumber r00f...@gmail.com wrote:

 So the debug as you can see is already in 2.
 Configure::write('debug', 2);

 I delete handmade controllers , models and view and bake them as you
 say...with cake bake M/C/V command..

 I add then the code and still returns me not found error :S

 Whats going on ?

 I have to use -app parameter ?

 Thanks again for your time :)

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


CakePHP + admin routes + .htaccess + production mode

2010-04-21 Thread WebbedIT
The link below describes perfectly the problem I am facing when trying
to get my password protected AwStats playing nicely with CakePHP.

http://stackoverflow.com/questions/1607422/cakephp-admin-routes-htaccess-production-mode/2686360#2686360

With debug set to 1, the HTTP Auth login appears and I can login fine,
but with debug set to 0 I get an Error 401 without it even presenting
the login box.

Now in that post, no-one answered the problem as he was wanting to use
HTTP Auth instead of Cake's Auth component, but in my case I do need
to resolve this issue so would be glad of some ideas on what Cake is
doing different with the request when debug is set to 0 and how I can
get around it.

Thanks,

Paul.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 'multiple' validation rule

2010-04-21 Thread WebbedIT
I have posted and taken part in multiple threads involving the
'multiple' rule and eventually applied my own core hack to get it
working.  Others have came up with alternatives that massage the data
array so save and validation works, I think there's even something in
the bakery about it.

http://groups.google.com/group/cake-php/browse_thread/thread/3390943040e2ded9

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

http://groups.google.com/group/cake-php/browse_thread/thread/2191de252d65beae

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

http://bakery.cakephp.org/articles/view/quick-fix-for-habtm-validation

Maybe this time someone from the dev team will chime in with an answer
as to why this does not work when using the conventions?

Paul.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: CakePHP + .htaccess + production mode

2010-04-21 Thread WebbedIT
Edit: removed the bit about admin routes as that is not part of my
issue

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: NewBie Help Creating a simple Cake Blog, Return 404 Error

2010-04-21 Thread netpumber
It returns apache not found error.

So my web root dir is /var/www

then in it i bake a blog so i have /var/www/blog directory
now..where is the root dir for my cake php project.

Then i bake Controller / Model / View

Here are the codes :

Model:  (Noting added)

[code]

?php
class Post extends AppModel {

var $name = 'Post';

}
?

[/code]

Controller:
Here i add this $this-set('posts', $this-Post-find('all'));
[code]

?php
class PostsController extends AppController {

var $name = 'Posts';
var $helpers = array('Html', 'Form', '');

function index() {
$this-set('posts', $this-Post-find('all'));
---
$this-Post-recursive = 0;
$this-set('posts', $this-paginate());
}

function view($id = null) {
if (!$id) {
$this-flash(__('Invalid Post', true),
array('action' = 'index'));
}
$this-set('post', $this-Post-read(null, $id));
}

function add() {
if (!empty($this-data)) {
$this-Post-create();
if ($this-Post-save($this-data)) {
$this-flash(__('Post saved.', true),
array('action' = 'index'));
} else {
}
}
}

function edit($id = null) {
if (!$id  empty($this-data)) {
$this-flash(__('Invalid Post', true),
array('action' = 'index'));
}
if (!empty($this-data)) {
if ($this-Post-save($this-data)) {
$this-flash(__('The Post has been
saved.', true), array('action' = 'index'));
} else {
}
}
if (empty($this-data)) {
$this-data = $this-Post-read(null, $id);
}
}
function delete($id = null) {
if (!$id) {
$this-flash(__('Invalid Post', true),
array('action' = 'index'));
}
if ($this-Post-del($id)) {
$this-flash(__('Post deleted', true),
array('action' = 'index'));
}
$this-flash(__('The Post could not be deleted.
Please, try again.', true), array('action' = 'index'));
}

}
?
[/code]

View:

[code]

h1Blog posts/h1
table
tr
thId/th
thTitle/th
thCreated/th
/tr

!-- Here is where we loop through our $posts array, printing
out post info --

?php foreach ($posts as $post): ?
tr
td?php echo $post['Post']['id']; ?/td
td
?php echo $html-link($post['Post']['title'],
array('controller' = 'posts', 'action' = 'view', $post['Post']
['id'])); ?
/td
td?php echo $post['Post']['created']; ?/td
/tr
?php endforeach; ?

/table

[/code]

So when i m going to http://mydomain.com/blog/posts

returns to me an 404 not found error..

Thats all .
Hope make it more clearly..now..

Thanks again my friend for your answers..!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: View (form-input) - Disable word wrap?

2010-04-21 Thread sebb86
Okay, thats the reason. I have to much standard definitions in the
cake.generic.css. It would take me to much time to change all this.
But inspite of this, i used some of your definitions! :-)
I'm new to CSS (and also to CakePHP), so some source code was very
usefull for me.

Thanks a lot for all this help and your patiance ;-)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to output UTF-8 sign?

2010-04-21 Thread sebb86
Hello again and thanks.
I got an arrow in my column header. But its every time (asc or desc)
the same arrow, so i think, the paginate source code is still wrong.
My problem is still, that i dont know how to combine two classes in
one paginate function.

[code dont works]
?php echo $paginator-sort('id', 'id', array('class' = 'asc'),
array('class' = 'desc'));  ?
[/code]

[code also dont works]
?php echo $paginator-sort(array('id', 'id'), 'id', array('class' =
'asc', 'class' = 'desc'));  ?
[/code]

Do you have a last hint for me?
Regards.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to output UTF-8 sign?

2010-04-21 Thread sebb86
Hello again and thanks.
I got an arrow in my column header. But its every time (asc or desc)
the same arrow, so i think, the paginate source code is still wrong.
My problem is still, that i dont know how to combine two classes in
one paginate function.

[code dont works]
?php echo $paginator-sort('id', 'id', array('class' = 'asc'),
array('class' = 'desc'));  ?
[/code]

[code also dont works]
?php echo $paginator-sort(array('id', 'id'), 'id', array('class' =
'asc', 'class' = 'desc'));  ?
[/code]

Do you have a last hint for me?
Regards.

//addition:
when i move the mouse over the table cell with paginate, the arrow
disappears. But he should stay visible.
I checked out CSS display and visibility but that dont helps :/

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: NewBie Help Creating a simple Cake Blog, Return 404 Error

2010-04-21 Thread Sam Sherlock
and you have mod rewrite enable in apache - this seems to me that things
prior to cake not functioning ie mod_rewrite

when you have baked and you go to http://mydomain.com is the page displayed
ok - is the css applied - or is this file error 404 too

is http://mydomain.com/css/cake.generic.css 404 also

adding to you root .htaccess  webroot/.htaccess as follows may sort things

rewritebase /
rewritebase /webroot

also does the marker mean that you added / removed a bit - you don't need
the two this-sets(posts,...)

   $this-set('posts', $this-Post-find('all'));
---
   $this-Post-recursive = 0;
   $this-set('posts', $this-paginate());

- S



On 21 April 2010 22:22, netpumber r00f...@gmail.com wrote:

 It returns apache not found error.

 So my web root dir is /var/www

 then in it i bake a blog so i have /var/www/blog directory
 now..where is the root dir for my cake php project.

 Then i bake Controller / Model / View

 Here are the codes :

 Model:  (Noting added)

 [code]

 ?php
 class Post extends AppModel {

var $name = 'Post';

 }
 ?

 [/code]

 Controller:
 Here i add this $this-set('posts', $this-Post-find('all'));
 [code]

 ?php
 class PostsController extends AppController {

var $name = 'Posts';
var $helpers = array('Html', 'Form', '');

function index() {
$this-set('posts', $this-Post-find('all'));
 ---
$this-Post-recursive = 0;
$this-set('posts', $this-paginate());
}

function view($id = null) {
if (!$id) {
$this-flash(__('Invalid Post', true),
 array('action' = 'index'));
}
$this-set('post', $this-Post-read(null, $id));
}

function add() {
if (!empty($this-data)) {
$this-Post-create();
if ($this-Post-save($this-data)) {
$this-flash(__('Post saved.', true),
 array('action' = 'index'));
} else {
}
}
}

function edit($id = null) {
if (!$id  empty($this-data)) {
$this-flash(__('Invalid Post', true),
 array('action' = 'index'));
}
if (!empty($this-data)) {
if ($this-Post-save($this-data)) {
$this-flash(__('The Post has been
 saved.', true), array('action' = 'index'));
} else {
}
}
if (empty($this-data)) {
$this-data = $this-Post-read(null, $id);
}
}
 function delete($id = null) {
if (!$id) {
$this-flash(__('Invalid Post', true),
 array('action' = 'index'));
}
if ($this-Post-del($id)) {
$this-flash(__('Post deleted', true),
 array('action' = 'index'));
}
$this-flash(__('The Post could not be deleted.
 Please, try again.', true), array('action' = 'index'));
}

 }
 ?
 [/code]

 View:

 [code]

 h1Blog posts/h1
 table
tr
thId/th
thTitle/th
thCreated/th
/tr

!-- Here is where we loop through our $posts array, printing
 out post info --

?php foreach ($posts as $post): ?
tr
td?php echo $post['Post']['id']; ?/td
td
?php echo $html-link($post['Post']['title'],
 array('controller' = 'posts', 'action' = 'view', $post['Post']
 ['id'])); ?
/td
td?php echo $post['Post']['created']; ?/td
/tr
?php endforeach; ?

 /table

 [/code]

 So when i m going to http://mydomain.com/blog/posts

 returns to me an 404 not found error..

 Thats all .
 Hope make it more clearly..now..

 Thanks again my friend for your answers..!

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: is it advisable to use jquery on cakephp?

2010-04-21 Thread Sam Sherlock
I use jquery + cake all the time and often feel that they were made for each
other :) no helpers, I feel the same as Miles J

in cake1.3 I plan to carry on as before and make some use of the engines
too.

but just Jacmoe says it depends on the task

- S



On 21 April 2010 16:30, jacmoe jac...@mail.dk wrote:

 If you want to use a helper, powered by jQuery, but behaving like the
 helper in Cake 1.2.x, then use this:
 http://bakery.cakephp.org/articles/view/ajax-helper-with-jquery

 I am using it with CakePHP 1.3.x without problems. :)

 I also use jQuery without any helper, and even the new js engine, but
 it depends on the task.

 On Apr 19, 4:17 pm, Bryan Lim ytbr...@gmail.com wrote:
  question as above.
  I also want to ask if there's an official jquery helper for cakephp?
  The one at the bakery is kinda outdated.
 
  thanks!
  Bryan
 
  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
 with their CakePHP related questions.
 
  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
  cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group athttp://
 groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Multi-level Models in CakePHP

2010-04-21 Thread andy
Ah, that's interesting!
Thanks again for the help.

Andy

On Apr 21, 2:19 am, WebbedIT p...@webbedit.co.uk wrote:
  wouldn't one be able to use $this-Model-unbindModel() to take away any 
  unwanted, extra associations?

 Yes, but that's exactly why Containable was written, it's a
 convenience wrapper that binds/unbinds all the relevant models based
 on the info you supply in the contain array of your find call ... no
 need to do it manually?

 HTH

 Paul

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 'multiple' validation rule

2010-04-21 Thread cricket
On Apr 21, 4:50 pm, WebbedIT p...@webbedit.co.uk wrote:
 I have posted and taken part in multiple threads involving the
 'multiple' rule and eventually applied my own core hack to get it
 working.  Others have came up with alternatives that massage the data
 array so save and validation works, I think there's even something in
 the bakery about it.

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

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

 http://groups.google.com/group/cake-php/browse_thread/thread/2191de25...

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

 http://bakery.cakephp.org/articles/view/quick-fix-for-habtm-validation

 Maybe this time someone from the dev team will chime in with an answer
 as to why this does not work when using the conventions?

Thanks for the links. I read through them all, then implemented Alex's
fix. This works just fine (and I even understand what's going on--
always a bonus).

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


postgres tree behavior

2010-04-21 Thread Chris Turner
Hello -

I'm new to cake, and am attempting to prototype an application for
evaluation,
using postgres as the backend.

I'm trying to create a business products catalog using the 'Tree'
behaviour, and
currently the 'moveup()'/'movedown()' features are not working

(although it appears that setting the parent directly is)

I'm using the cake docs themselves along with this tutorial:

http://bvirtual.nl/2009/11/easy-trees-with-tree-behavior-in.html

(of course I adapted the schema to match the pg standard mapping)

I don't mind debugging this a bit - but I'm not quite sure where to
start -
basically, it seems to me like the 'lft' and 'rght' values are not
being set
properly, which makes the moveup/movedown calls fail, but I'm not
100% sure as I can't find anything suggesting what algorithm these
should be.

I guess my questions are:
- any pointers as to the state of pg w/cake
- anyone looking at this particular problem / usage (Tree+pg)
- any pointers to documenting tree algorithms

I'll likely setup a mysql db to cross-test against.. but thought I'd
ask here
first..

Like the framework (minus this failure :) - so don't mind getting my
hands dirty a bit to
make this work, if need be - am interested in following this app
through to completion
to see how the framework works as a hwole..

Thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Kaching: CakePHP Shopping Cart Framework Plugin

2010-04-21 Thread Mike Friesen
Hi,

Sorry, but I never thought of installing kaching in a subdirectory.  I've
been playing around with it tonight and your right, the css / links don't
work inside a subdirectory.  I'll create a ticket for that and I'll get that
working for the next release.  In the meantime, the only thing I can think
of is if you create a subdomain.

Mike


On Wed, Apr 21, 2010 at 3:43 AM, fabio 3bi...@gmail.com wrote:

 Dear Mike,

 thanks a lot for sharing your good work...

 I'm trying to get Kaching working, but i've encountered an obstacle
 regarding plugin routing... i guess
 I'm trying and trying to solve this but I couldn't solve it yet...
 that's why I'll try to explain it and hope on a little help...

 Basicly I've correctly installed a fresh version of CakePHP 1.3 RC4 in
 a subdirectory kache of my site:

 http://www.example.com/kache

 Then, I've followed all your precious guidelines on
 http://code.google.com/p/kaching-php/wiki/Installation and it seems
 that Kaching works fine underground, except for the routing problem
 i'm going to explain with the following facts:

 - if i point the browser to http://www.example.com/kache/kaching/ i
 get a 403 Forbidden error
 - if i point the browser to http://www.example.com/kache/kaching i get
 a redirect to url http://www.example.com/kache/app/webroot/kaching/
 which ends with a 403 Forbidden error as well
 - i could correctly create an admin user by pointing to url
 http://www.example.com/kache/kaching/users/install (even if css style
 was missing)
 - i can correctly login to the admin interface by pointing to url
 http://www.example.com//kache/kaching/users/login (even if css style
 is missing)
 - looking at html source of the pages i've noticed that all referred
 elements (css stylesheet, images, ... ) are missing the kache part
 in their url, and if i add it by virtually modifying the code with
 FireBug everything renders fine...
 - similarly, all the internal url-links in the pages are missing the
 kache part and pointing to 404 error, but if i add the the kache
 part to url they point fine

 es.
 http://www.example.com/kaching/categories/index -- 404error
 http://www.example.com/kache/kaching/categories/index  -- OK (with no
 css style)

 http://www.example.com/kaching/shoppingcarts/view  -- 404error
 http://www.example.com/kache/kaching/shoppingcarts/view -- OK (with
 no css style)

 ..
 ..

 and so on for all the pages...

 In the end, since i think this is probably a rounting problem, I'm
 trying to modify something in the files:

 app/config/core.php
 app/config/routes.php
 app/plugins/kaching/config/routes.php

 but with no succes til now... :-(

 Actually i'm a web developer not yet 100% skilled in CakePHP and i
 think i'm possibly missing both some basic routing concepts or maybe
 something very stupid (as often happens)...

 Did you maybe recognize where could be the problem looking at my
 description ? Any useful tips ?

 Thanks a lot in advance for a little help ;-)

 Best regards

 Tres

 On 16 Mar, 03:12, Mike mfrie...@gmail.com wrote:
  If your looking for a shoppingcart plugin for CakePHP that is
  distributed under the MIT License, here you go...
 http://code.google.com/p/kaching-php
 
  Kachingis tailored for developers that want full control on building
  their online store.  Kachingprovides the store administration and
  lots of features (see project page).  You build the store's look and
  feel interacting with our controllers.
 
  Hopefully people can find this useful and either contribute features
  back or at least be able to use it as a starting point for their own
  online stores.

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Helpers in controllers

2010-04-21 Thread calvin
I did search... That's how I found this... ah, nevermind.

Anyway, I _know_ how to use helpers in controllers. I wasn't asking
how to do it. I was trying to get people's perspective on the issue
and, specifically, whether the Cake developers really intend on
helpers being used exclusively in views. I mean, why would a core
helper include a method to convert a date into an SQL expression if
it's supposed to be for views only?

I like the inheritance approach, but I'm not sure how that would work
(does PHP support multiple inheritance?). My original thought was that
you could just create a component first, and then the helper can just
be an interface for the component through composite reuse. But this
doesn't actually help me when I want to use Cake's core helpers in my
controllers. And if I'm trying to write functions that can be used in
both controllers and views, then I'd just write them in the bootstrap
or load them from a vendor file.

On Apr 21, 1:30 am, euromark dereurom...@googlemail.com wrote:
 and no
 its not that much of a taboo as long as there arent any corresponding
 components/libs etc

 the cleaner approach would be to write lib classes that get inherited
 from both a component for controllers
 and the helper for views
 but as long as it is not so you have to break with the design a little
 bit in order to avoid code redundance

 just import the helper as mentioned in the link
 for those time functions it is usually not neccessary to do that - a
 simple date(...) call usually does the trick
 but for flash messages with some formatting in it or other similar
 matters i had to use some helpers, too

 and it does only work for helpers that are independent (which dont
 call $this-AnyOtherHelper inside each other)

 On 21 Apr., 10:20, euromark dereurom...@googlemail.com wrote:



  this question has been answered like a million times
  please try to search for it first!
  helper controller in the above search field gets

 http://groups.google.com/group/cake-php/browse_thread/thread/64c8ae45...
  + many others

  On 21 Apr., 07:10, calvin cal...@rottenrecords.com wrote:

   So I just encountered a situation where I'd like to use a helper in my
   controller even though this seems to break with Cake's MVC design.
   Googling the topic turned up a thread in this group in which
   loadHelper() is proposed as a means of doing just that, but it still
   seems to be discouraged.

   What I'm wondering is, if this is discouraged, then why does the Time
   Helper have day/daysAsSql(). I cannot fathom a common scenario where
   you would need to display a date as:

   ($field_name = '2008-01-21 00:00:00') AND ($field_name = '2008-01-21
   23:59:59')

   in a view to justify the inclusion of those two functions in a helper
   rather than a component.

   Is using a helper in a view really so taboo?

   Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers 
   with their CakePHP related questions.

   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
   cake-php+unsubscr...@googlegroups.com For more options, visit this group 
   athttp://groups.google.com/group/cake-php?hl=en

  Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
  with their CakePHP related questions.

  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
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Joining Data for Auth Component to read

2010-04-21 Thread capo64
Well basically I have over a thousand products and I'll be assigning a
price modifier per group (ie Bronze Silver and Gold members have
different prices for their items), so I would think the best way would
be to check the User's Group's price_modifier when the user logs in,
and store it in the session. Then on each of the product pages
multiply the product price by the modifier.

I just can't seem to figure out how to implement the code. I tried in
the user controller:

function login() {
if ($this-Auth-user('id'))
$session-write('Auth.User.Group', 
$this-User-Group-
findById($this-Auth-user('group_id')));
}

But I don't think I fully understand how the login function works.
Please let me know if this is wrong in many ways. I'm brand new to
CakePHP :\

I have an association that User belongsTo Group. There's no way to get
Auth to use this association?
On Apr 21, 1:19 am, thatsgreat2345 thatsgreat2...@gmail.com wrote:
 Auth component only stores values that are in the users table, so you
 can grab the user id using $this-Auth-user('id') and then do a find.
 Or alternatively you can use $this-Auth-login and once if it
 successfully logs in then do a find on the group data and store it in
 the session for later use especially if you are going to be accessing
 it a lot. But if you only need it in one place I'd just recommend
 doing the find when it is needed.

 On Apr 20, 5:52 pm, capo64 globerm1...@gmail.com wrote:

  Hi I have a setup with Users and Groups.

  I've been reading user data using this in my views:
  $session-read('Auth.User.full_name'); ..etc

  Now I need to access information about the group of the user. How can
  I go about doing this?

  Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
  with their CakePHP related questions.

  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
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en