User has both published Items and visited Items?

2011-12-06 Thread Todong
Users can create Items, once the Item is created, the Item belongsTo User, and the User hasMany Item. class User extends AppModel{ public $hasMany = 'Item'; } class Item extends AppModel{ public $belongsTo = 'User'; } class ItemsController extends AppController{ function add(){ ...(post f

Re: ACL + Auth = Headache

2011-12-06 Thread José Lorenzo
Yes, it works because you have disabled the ACL :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send em

l18n in cake 1.3

2011-12-06 Thread Dominik Gajewski
Hi I would like to ask how to set default language using l18n? -- Regards Dominik -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To uns

Re: Cake PHP 2.0.4 - "Cake is NOT able to connect to the database."

2011-12-06 Thread Brent
I found the problem by running this script with the command line php: 'SET NAMES utf8', ); $dbh = new PDO($dsn, $username, $password, $options) or die(mysql_error);; echo "\nConnected to Database\n"; ?> Even though I specified "pdo_mysql.default_socket = /var/tmp/mysql.soc

Cake 2.0 documentation

2011-12-06 Thread aries
Hi, I'm not sure if this is the right place to post my comments, but I'm unable to find a more appropriate venue. Feel free to redirect me. Unlike previous versions, the 2.0 documentation lacks heading links within the TOC. It used to be that when viewing a particular topic you could access subto

Re: Trying to reduce arrays

2011-12-06 Thread Miles J
What euromark said, just do your own forloop and append them to a new array. On Dec 6, 1:58 pm, euromark wrote: > you can always use foreach() ;) > the set:: methods wont use anything else, either (internally) > > so its also the quickest way of doing it. > > On 6 Dez., 22:41, McScreech wrote: >

Cake PHP 2.0.4 - "Cake is NOT able to connect to the database."

2011-12-06 Thread Brent
Hello, I unpacked a fresh CakePHP 2.0.4 archive on a unix server running apache & mysql. The default index page says that everything is working except that it is not able to connect to the database. I can connect to the database with the command line mysql client using the same credentials that

Re: Trying to reduce arrays

2011-12-06 Thread euromark
you can always use foreach() ;) the set:: methods wont use anything else, either (internally) so its also the quickest way of doing it. On 6 Dez., 22:41, McScreech wrote: > I am completely stumped. I have tried combinations of Set::extract, > Set::classicExtract, Set::combine, and Set::flatten

Trying to reduce arrays

2011-12-06 Thread McScreech
I am completely stumped. I have tried combinations of Set::extract, Set::classicExtract, Set::combine, and Set::flatten to get the results I show below. Perhaps this is a straight php question rather than cakePHP? 1) How do I obtain the results demonstrated? 2) How do I extract the key _names_ fro

Re: Edit an object without creating it

2011-12-06 Thread Matteo Landi
On Tue, Dec 6, 2011 at 8:48 PM, phpMagpie wrote: > You gave no indication this was to be a REST enabled application and as 99% > of apps are not REST then the replies were valid. I gave no indication because the problem I mentioned apply on both REST and not-REST applications. Imagine you are cr

Re: How To Encrypt Code Cake PHP

2011-12-06 Thread phpMagpie
Search this group and the answers you will find: https://groups.google.com/forum/#!searchin/cake-php/encrypt/cake-php/Ncw6fbTLRmc/Z0QrvhMXOb0J -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and

Re: How Can I do custom pagination in Cake PHP ?

2011-12-06 Thread phpMagpie
as euromark says without more information all we can say is, read the book: http://book.cakephp.org/view/1237/Custom-Query-Pagination HTH, Paul. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org a

Re: Edit an object without creating it

2011-12-06 Thread phpMagpie
You gave no indication this was to be a REST enabled application and as 99% of apps are not REST then the replies were valid. Even then, the REST interface would surely not allow for manual input of Post IDs, this just smacks of allowing people to edit any Post in your database. You would not

Re: ACL + Auth = Headache

2011-12-06 Thread RhythmicDevil
Ok so it seems that this might be the culprit: $this->Auth->authorize = 'actions'; If I comment out that line I dont get the redirect loop. On Dec 6, 11:21 am, RhythmicDevil wrote: > I followed the instructions > here:http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application > to

Re: Dropdown list is empty

2011-12-06 Thread Daniel
On Dec 6, 3:46 pm, euromark wrote: ... > 'options'=>$recipients That did the trick, thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questio

Rackspace CloudFiles

2011-12-06 Thread gmwebs
I was wondering if any of you have worked with CloudFiles in any of your CakePHP projects? I need to use it and am rather hoping someone has a datasource or plugin they could share to show how the API calls should be implemented. -- Our newest site for the community: CakePHP Video Tutorials http

Re: Assistance with Blog Tutorial

2011-12-06 Thread Jeremy Burns | Class Outfit
Your code looks a bit non-standard. What's ItemKey1? And field name are normally lower camel case. Try this (assuming you primary key on the items table is 'id' and your description field is 'item_description'): public function view($id = null) { $this->set( 'item',

Re: Edit an object without creating it

2011-12-06 Thread Matteo Landi
On Mon, Dec 5, 2011 at 1:54 PM, phpMagpie wrote: > You should never get to the point of editing a record's data before first > displaying a form for that record.  It's at this point you should check if a > record with the given ID exists and act accordingly. I don't agree with you. You can't make

Re: Typo on HttpSocket class?

2011-12-06 Thread Lucho Molina
OK -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For

ACL + Auth = Headache

2011-12-06 Thread RhythmicDevil
I followed the instructions here: http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application to learn how to setup ACL and Auth. My two test attempts went smoothly and worked as expected. However, now that I am trying it for real its failing. I get stuck in this redirect loop and I dont u

Re: How Can I do custom pagination in Cake PHP ?

2011-12-06 Thread euromark
what do mean by that? without more specifics and some code you already tried out nobody will be able to help you I'm afraid On 6 Dez., 07:55, Sandip Ghosh wrote: > How Can I do custom pagination in Cake PHP ? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org

Re: Edit an object without creating it

2011-12-06 Thread Gaetano Catalli
I think this approach is quite unsafe. You can't blindly trust in the client-side. cheers, Gaetano. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related q

How Can I do custom pagination in Cake PHP ?

2011-12-06 Thread Sandip Ghosh
How Can I do custom pagination in Cake PHP ? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to

How To Encrypt Code Cake PHP

2011-12-06 Thread Barry
Dear ALL Milis Team Help Me, How To Encrypt Code Cake PHP ? Thanks' Barry -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscr

Assistance with Blog Tutorial

2011-12-06 Thread davfergus
Good evening, Rookie developer, in MVC for 6 months, CakePHP for about 1. My current tests with Cake can be seen at: http://174.129.130.149/items I am experiencing an issue on the drill down. I paste everything into a text doc so I could do a line by line but the issue is eluding me. I can suc

Need to Get Started: Please Help! (image upload - delete record)

2011-12-06 Thread iamarto
Dears, When I decided to use CakePHP, the 2.0 version was just out and I was stuck to it in order to avoid migration in the future. So the thing is all the tutorials on Google are of Cake 1.3 and 2.0 was hell of a change even in naming conventions. I am currently stuck in 2 things: 1. Delete po

Re: Typo on HttpSocket class?

2011-12-06 Thread AD7six
On 6 Dec, 15:54, Lucho Molina wrote: > This group seems dead. By what metric > > But anyways, I also posted this on > StackOverflowas > well, apparently I found a bug and it was reported > here:http://cakephp.lighthous

Re: Dropdown list is empty

2011-12-06 Thread euromark
automagic only works with the $variableName being the same than field name (nothing to do with foreignKeys) $recipients means that the field should be "recipient" or recipient_id" or "recipients" so in your case try $toUsers or simply set it manually using 'options'=>$recipients On 6 Dez., 16:4

Dropdown list is empty

2011-12-06 Thread Daniel
I have an email add view with a dropdown list for a field called to_user_id (relating to the users table). The problem is that the dropdown list is empty. Here is code from the controller: $recipients = $this->Email->Recipient->find('list'); $this->set(compact('recipients')); ...and in the add.

Re: Cake 2.0 Virtual Fields

2011-12-06 Thread aries
Hey that works too, and is more elegant. Thanks for the suggestion! On Dec 5, 4:52 pm, euromark wrote: > ah thats what you mean > did you try setting $displayField of that model to "name"? > that should also work > > On 5 Dez., 19:04, aries wrote: > > > > > > > > > Solution: > > > In the Region

Re: Typo on HttpSocket class?

2011-12-06 Thread Lucho Molina
This group seems dead. But anyways, I also posted this on StackOverflowas well, apparently I found a bug and it was reported here: http://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/2345-typo-in-httpsock

Re: Shared code for Models but not in AppModel

2011-12-06 Thread RhythmicDevil
Ok so I tried extending the AppModel class to a third level sub class but Cake fails to find it. Perhaps you can clue me in to where I am going wrong. I have the following file structure: Models/ AppModel GtiApi Solidcore Here are what the class files contain: class AppModel extend

Re: Prefix routing and urls

2011-12-06 Thread euromark
Well, after reading that I just HAD to confirm my previous assumption. As I suspected, Cake2 behaves correctly Only the first links get treated as an admin link so to speak Not sure why 1.3 still allowed sth that strange But there is a funny thing with mixing the prefixes: Html->link('Foo', array(

Re: cakephp revisionable behavior

2011-12-06 Thread euromark
>From a glance I see only 2 code flaws: "private" declarations shouldnt be used inside a framework without very good reason to do so (use "protected" instead) ->Save should probably be ->save and it would probably be a good idea to make a test case for it. especially since revisions and everything

Re: onClick show Posts from yesterday.

2011-12-06 Thread phpMagpie
So which of those two steps are you struggling with? Creating a link with an image is not difficult (either wrap an image in an a tag or preferrably use CSS image replacement). The only slightly difficult part in the controller/action is working out a date for yesterday and Dave Milson gave you

Re: Validation rules - what a nightmare...

2011-12-06 Thread Jeremy Burns | Class Outfit
Most developers understand that a user might enter a password incorrectly, so the wrong value is saved and he can't log back in; so they ask them to confirm the password (which is pretty much common practice). The validation is done on the pre-hashed versions so all validation rules run, and is

Re: Validation rules - what a nightmare...

2011-12-06 Thread heohni
Hi! I do not work with confirm password fields. Just on a simple save routine, when I want to register a user, I need to check the password fields that's a) not empty and b) within a between range I can't belive that other programmers work different? How do they validate a user register form? Or