Re: Error Placement / Styles

2010-01-05 Thread John Andersen
Yes you can! In the form field, add the option 'error' = false to disable the automatic error message. Then use the form helpers error method for the field and place it whereever you want. See http://book.cakephp.org/view/721/error Enjoy, John On Jan 5, 9:46 am, Dave make.cake.b...@gmail.com

RE: Error Placement / Styles

2010-01-05 Thread Dave
Thanks John, I did set the 'error' = false so no message shows. But how do I get the error class to end up inside the li I tried an assortment of attemps with li class=?php echo $form-error('User.password', NULL, array()); ? ??? But nothing. Ideas? Thanks, Dave -Original Message-

Re: How do I use the email component?

2010-01-05 Thread Jeremy Burns
Here you go - this covers the basics. Using the component is actually quite simple: http://www.jeremy-burns.co.uk/2009/12/cakephp-sending-email-using-the-email-component/ On Jan 5, 1:47 am, otisjs01 jerem...@jeremiahotis.com wrote: Hello, I am new to CakePHP and trying desperately to learn!

Re: Error Placement / Styles

2010-01-05 Thread Amit Rawat
Try this, li ?php if($form-error('User.password')){? class='error''?php }? /li 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

Re: How can I get an option/select drop down to populate with a table.myfield instead of the table.id (primary key).

2010-01-05 Thread Jeremy Burns
What you have here looks correct, except that your $belongsTo definition in your State model looks wrong. Shouldn't that be a $hasMany definition? That means that an Employee belongs to a State, and a State has many Employees. The drop down is displayed in a view and the contents of the drop down

Re: Error Placement / Styles

2010-01-05 Thread John Andersen
Well, now that I took a better look at your code, I don't understand why you don't use the standard cake form field and error generation, because that should be all you need :) Example HTML from my own code where the field has an error - it is mandatory: [code] print( $form-input(

Re: Secret URLs

2010-01-05 Thread j0n4s.h4rtm...@googlemail.com
Hi again, I am open to learn, so please tell me, whats the benefit of url obscurity if not protecting against CSRF. A large german social network uses that to protect against CSRF - though they do not use UUIDs. Just links like domain.tld/long_random_looking_stuff_here, it works against mining

Re: How can I get an option/select drop down to populate with a table.myfield instead of the table.id (primary key).

2010-01-05 Thread j0n4s.h4rtm...@googlemail.com
This suggestion by Jeremy looks all right: $states = $this-Employee-State-find('list'); $this-set(compact('states')); My hint would be to change your database schema to state: id, name or state: id, title as state: id, state is redundant anyway. The magic that will appear is cake auto detecting

update db insted of insert if entry already exists

2010-01-05 Thread donnerbeil
Hi all, I have a simple rating controller, so users can rate each other. I don't know the reason, but every few days the whole ratings table in the database is empty. All ratings are lost. Here is my ratings controller as I use it. There are no other methods or anything else. I exactly use it

Re: Secret URLs

2010-01-05 Thread tekomp
Maybe this will help: http://bakery.cakephp.org/articles/view/encrypting-urls On Jan 1, 11:54 am, anka andreas.katz...@gmail.com wrote: Hi @all, I have a (almost) simple question! Is it possible to make all cake php REST URLs unreadable? What I mean is, that a given REST URL like .../

Re: How can I get an option/select drop down to populate with a table.myfield instead of the table.id (primary key).

2010-01-05 Thread bernalillo
It's easy, the only thing that you have to do is $data = $this-State-find('all', array('fields' = 'State.id, Provincia.state')); $state_list = Set::combine($data, '{n}.State.id', '{n}.State.state'); $this-set('state_list', $state_list); With this the select will show the state names and in the

Re: Can CakePHP run in a user account?

2010-01-05 Thread Adeola Awoyemi
Hi Fred, From what I understand about XAMPP, the document root is in /Applications/XAMPP/htdocs, so I would put the CakePHP files in there first and try accessing it again. Also make sure that the default Apache is not running or you are serving XAMPP from a different port. HTH, Adeola.

Re: update db insted of insert if entry already exists

2010-01-05 Thread Ian M. Jones
Hi Donnerbeil, The problem is likely down to the fact that you're doing a read of the existing Rating record expecting that to set the id before the save, but you're then passing in a full data set (without and id set) to the save method. Maybe try replacing:

Re: MySQL takeover by Oracle - petition

2010-01-05 Thread jacmoe
Isn't it open source? Not the first time someone made a fork of it - including the original author. :) On Jan 4, 10:31 pm, Juan Luis Baptiste juan.bapti...@gmail.com wrote: On Mon, Jan 4, 2010 at 10:05 AM, hashmich hendrik.schm...@web.de wrote: Oracle is going to take over Sun Microsystems -

Re: MySQL takeover by Oracle - petition

2010-01-05 Thread Dinh
Is it trustworthy? Oracle is not friendly to open source at all. They can kill MySQL just by delaying to fix bugs. MySQL development is rather open. It is quite opposite to Oracle style. I think you are overreacting, have you read Oracle's public position on this ? I think not:

Re: Count column in index view

2010-01-05 Thread Jeremy Burns
One more issue that has deflated my initial euphoria... The results don't paginate. How can I rectify that? On Jan 2, 4:53 am, Jeremy Burns jeremybu...@me.com wrote: A success! Using your self created join code I arrived at this:       $results = $this-LocationType-find(          'all',    

Re: MySQL takeover by Oracle - petition

2010-01-05 Thread Juan Luis Baptiste
On Tue, Jan 5, 2010 at 9:15 AM, Dinh pcd...@gmail.com wrote: Is it trustworthy? Oracle is not friendly to open source at all. They can kill MySQL just by delaying to fix bugs. MySQL development is rather open. It is quite opposite to Oracle style. AFAIK it was one of the conditions imposed by

Re: MySQL takeover by Oracle - petition

2010-01-05 Thread Dinh
Also as I said, MySQL isn't competition to them, both are targeted to different markets. Five years ago, yes. But now, no. I worked both in finance and telecom industry and felt MySQL heat. Just take a look at BI, ERP and CRM world, you will see MySQL there already to some extent. Do you

Re: Can CakePHP run in a user account?

2010-01-05 Thread Kees de Bruin
Yes you can. Just put all inside your public_html directory (assuming that user directories are enabled) or a subdirectory of public_html. It might be that .htaccess files are not handled for user directories. If so, check the file app/config/core.php and enable rewriting by CakePHP. On 4 jan

RE: Error Placement / Styles

2010-01-05 Thread Dave
Hello John, Only because I have my hint class p in there so in my forms there is a little text beside each field. This is all wrapped inside the li Sure I can get the input text error to get an error class to hi-light the text field, but looks rather dumb when the form has : Form li class =

RE: Error Placement / Styles

2010-01-05 Thread Dave
Thanks, This works perfect. li ?php if($form-error('User.password')){? class='error''?php }? /li After re-reading Johns email I think i gave the impression that the hint was the error message. That is where I may have causeed some confusion. The hint is always visible, its not an error

Re: Error Placement / Styles

2010-01-05 Thread John Andersen
Hi Dave, I did understand that your hint was - a hint to the user - but I assumed that you would find out how to include that together with the form field definition :) Using the form helper, I would just add the after option to include something after the entry field. Using your hint code, I

Re: Error Placement / Styles

2010-01-05 Thread John Andersen
CakePHP manual reference is http://book.cakephp.org/view/191/options-before-options-between-options-separator-a Enjoy, John 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

RE: Error Placement / Styles

2010-01-05 Thread Dave
Thanks John, Good looking out! I will add that since its more cake-ish than my current setup with the after method. Thanks again for your time and sorry for the confusion :) Dave -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of John

Re: How can I get an option/select drop down to populate with a table.myfield instead of the table.id (primary key).

2010-01-05 Thread websurfshop
I know this is a really green question, but how does the '{n}.State.id' section of your code work. I tried to look in my php manual but was at a loss of where to find information on this data construct/Placeholder/Whatever{n} is??? I have been at a loss as to how to navigate the complex arrays

Re: MySQL takeover by Oracle - petition

2010-01-05 Thread LunarDraco
Isn't it nice to have a descent data layer like we do in cake. Granted it might be a few days work to switch from MySQL to something like PostgreSQL for a decent sized project. But you probably have a few years before we ever get to that point where we are forced to do so. Don't sweat the small

Re: Can CakePHP run in a user account?

2010-01-05 Thread Fred Riley
Thanks for the reply, Kees. On Jan 5, 4:23 pm, Kees de Bruin halfje.br...@gmail.com wrote: Yes you can. Just put all inside your public_html directory (assuming that user directories are enabled) or a subdirectory of public_html. Ok, that's useful to know. My immediate 'issue' is on

Re: Can CakePHP run in a user account?

2010-01-05 Thread Kees de Bruin
Fred, As I wrote in my reply you have to make a small change in app/config/core.php where you have to uncomment line 59 and remove the .htaccess files that are listed just before that line. All URLs should now be something like ../cake/index.php/page instead of ../cake/page Check out the new

weird unserialize issue in 1.3 alpha

2010-01-05 Thread Parris
Notice: unserialize() [function.unserialize]: Error at offset 6 of 1051 bytes in C:\xampp\htdocs\projects\courses\cake\libs\cache \file.php on line 189 anyone seen that before? I have 5 similar warnings all because the same line. I am on a windows machine running xampp. when i click notice the

Re: CakeFest IV - America - Help us pick a location!

2010-01-05 Thread Parris
San Jose!! it is silicon valley and I don't need to travel hahaha. San Francisco would work better probably though! :) On Jan 4, 9:47 am, drpark webmas...@attractionland.com wrote: Hi all! Miami, Orlando, Wilmington NC, Las Vegas, Chicago, Seattle for the USA in order of preference Cancun for

Re: Can CakePHP run in a user account?

2010-01-05 Thread Fred Riley
Sorry, Kees, I saw the second line in your reply but as you preceded it with It might be that .htaccess files are not handled for user directories I presumed that it didn't apply in my case, because .htaccess files plainly are handled in XAMPP. My mistake, and thanks for the second reply. Ok,

Re: Can CakePHP run in a user account?

2010-01-05 Thread Marcelo Andrade
On Tue, Jan 5, 2010 at 5:59 PM, Fred Riley fred.ri...@gmail.com wrote: (..) I can't be the first person to have come across this issue. Is there not a FAQ somewhere? Just include the directive RewriteBase /~theusername at the beginning of your .htaccess files. Best regards. -- MARCELO F

Multimodel validate

2010-01-05 Thread kicaj
Hi, I create form for example with two fields: Client.name, User.email. I send this form to Client model and validate 'name' field. But how I can validate field 'email'? Thanks! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You

Validate fields

2010-01-05 Thread kicaj
How validate field only we entered some value into input? For example: I have form with fields: username, password and email I set 'value'='' in edit template for password input field When I edit this fields, I want update filed password only when I wrote some new password, but when I lost empty

Re: Capture views output into a file?

2010-01-05 Thread archF6
Hi Nancy: Matt Curry wrote an HTML cacher helper that writes the entire view to a file and saves it in the webroot. Check out his helper code -- it seems to be doing exactly what you're after; writing the view to an HTML file. http://github.com/mcurry/html_cache

Make objects from model data

2010-01-05 Thread frmdstryr
When I was learning php classes we made a model object for each type of data we had. Each model would have crud from another class and then model specific functions attributes. For example i would have: class Person extends Crud { var $first_name; var $last_name; static function

Re: Validate fields

2010-01-05 Thread frmdstryr
you set the validation rules in the Model of whatever your using (i'm guessing users model) /app/models/user.php search for cakephp validation in google and look in the cakephp manual, it should be what you need. On Jan 5, 6:53 pm, kicaj ki...@kdev.pl wrote: How validate field only we entered