Re: Data validation doesn't work

2009-01-07 Thread gearvOsh
See what happens when you remove these "required" => true,"allowEmpty"=>false. --~--~-~--~~~---~--~~ 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 unsubsc

Re: Containable on deep pagination records

2009-01-07 Thread gearvOsh
Hmmm it seems once I moved my custom pagination method, it worked... but now im getting 55+ queries. They all look like this, anyway to shorten it? Its double querying the User/Member data. 2 SELECT COUNT(*) AS `count` FROM `friends` AS `Friend` LEFT JOIN `users` AS `User` ON (`Friend`.`use

Containable on deep pagination records

2009-01-07 Thread gearvOsh
So I have this pagination setup using containable, but the contain isn't working, suggestions? var $paginate = array( 'Friend' => array( 'limit' => 10, 'order' => array('Friend.requestTime' => 'ASC'), 'recursive' => 2, 'contain' => array( 'Member',

Re: Fatal error: Call to a member function findByFromApplication() on a non-object in

2009-01-07 Thread gearvOsh
If it is within the Billings model itself, it is $this->. But if its used in a controller, it is $this->Billings->. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email t

Re: how to distinguish param and action in cakephp's URL

2009-01-07 Thread gearvOsh
I dont think there is a cake setting, just do this during signup. $restricted = array('users','pages','controllername'); if (in_array($usernameVar, $restricted)) { // do not allow registration } --~--~-~--~~~---~--~~ You received this message because you are subsc

Re: how to distinguish param and action in cakephp's URL

2009-01-07 Thread gearvOsh
@Rimeo - You need a restricted names list that users cant use as their username, else you will have conflicts. Its best to do /user/username --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to

Re: Solution for "who is online"

2009-01-07 Thread gearvOsh
It would be best to do a custom whos online using a MEMORY table. Then create a model for WhosOnline or something. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to

Re: Help requested for a "complex" find

2009-01-07 Thread gearvOsh
Can you paste the query you get with this, would be easier to help: return $this->find ('list', array( 'fields' => array ('Alert.message'), 'conditions' => array( 'Alert.alert_subject_id' => strtoupper ($subject), 'AND' => array( 'OR' => array(

Re: urgent help

2009-01-07 Thread gearvOsh
Are you using Auth or ACL? --~--~-~--~~~---~--~~ 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+unsubs

Re: How to upgrade to a new release?

2009-01-07 Thread gearvOsh
You usually can do a compare in SVN. On Jan 7, 8:52 am, Brenda wrote: > Oh my, now I'll really look stupid, but how do I 'run it against the > latest svn'? > > ...Brenda --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

Re: Auth or Program First?

2009-01-07 Thread gearvOsh
It doesnt matter when you use it. But it would be good to do it first if you are actually testing users. http://www.milesj.me/blog/read/5/using-cakephps-auth-component/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Help requested for a "complex" find

2009-01-07 Thread gearvOsh
Here you go: return $this->find ( 'list', array ( 'fields' => array ( 'Alert.message' ), 'conditions' => array ( 'Alert.alert_subject_id' => strtoupper ( $subject ), 'OR' => array( array( 'Alert.start_date

Re: Data validation doesn't work

2009-01-07 Thread gearvOsh
Heres an article I wrote on displaying for errors an alternative way, hopefully it helps. http://www.milesj.me/blog/read/10/displaying-form-errors-as-a-list-in-cakephp/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: How to upgrade to a new release?

2009-01-06 Thread gearvOsh
Yeah you basically just copy'n'paste the new folders/files and overwrite the old ones. But any custom changes you made will be overwritten. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to

Re: Paginate using multiple tables/associations

2009-01-06 Thread gearvOsh
What about using containable to filter the results? --~--~-~--~~~---~--~~ 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

Re: Call static function in bootstrap.php

2009-01-06 Thread gearvOsh
It will work fine in your AppController beforeFilter(). --~--~-~--~~~---~--~~ 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, s

Using the named parameters

2009-01-05 Thread gearvOsh
Is this the only way to access named parameters without throwing a notice? $var = (isset($this->params['named']['var'])) ? $this->params['named'] ['var'] : ''; Is there some sort of function to get named params that im overlooking? --~--~-~--~~~---~--~~ You receiv

Re: Auth Login Component not working :(

2009-01-05 Thread gearvOsh
Leave your login() action empty. CakePHP automatically does all the login magic. http://www.milesj.me/blog/read/5/using-cakephps-auth-component/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To pos

Benefits for $html->link

2009-01-05 Thread gearvOsh
Are there any benefits, or behind the scenes magic for doing this: $html->link('Link', array('controller' => 'users', 'action' => 'login', 'var')); Compared to: $html->link('Link', '/users/login/var/'); This also applies to anywhere else you build urls. --~--~-~--~~~---

Re: HABTM naming convention messed up?

2009-01-04 Thread gearvOsh
This is my team model. Once I change TeamUser to TeamsUser it works correctly, but that shouldnt be. Based on the docs and naming convention it should be TeamUser. class Team extends AppModel { /** * Teams belong to a country, state */ var $belongsTo = array('Co

Re: HABTM and associations and loading

2009-01-04 Thread gearvOsh
This happens to me when I place a HABTM on another HABTM, I have found no solution to this except to just remove that relation. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, s

HABTM naming convention messed up?

2009-01-04 Thread gearvOsh
Ok I have a users and teams system. Users are part of a team. Here is the naming conventions: Model: Team, User DB: teams, users HABTM: teams_users (TeamUser model) But when I set my HABTM relationships I get errors because it says that the model TeamsUser does not exist. Shouldnt it be TeamUser

Re: New Install Does Not Show Graphics

2009-01-04 Thread gearvOsh
Is this a localhost or webserver? Make sure mod_rewrite is enabled. --~--~-~--~~~---~--~~ 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

Re: HABTM retrieving help

2009-01-04 Thread gearvOsh
s.http://book.cakephp.org/view/164/pagination > > On Jan 3, 10:30 pm, gearvOsh wrote: > > > Heres my tables and relations: > > > Team > > Team->belongsTo: Country, State > > Team->hasAndBelongsToMany: User (the players on a team, table = > > teams_play

Re: Auth Broken.

2009-01-04 Thread gearvOsh
Firstly use PHP 5. Secondly remove $this->Auth->allow('*'). Why are you even using the Auth component if your allowing all pages to be viewable? Perhaps place this in each controller separately. And thirdly, I thought isAuthorized is called after you are logged in. Someone correct me if im wrong

HABTM retrieving help

2009-01-03 Thread gearvOsh
Heres my tables and relations: Team Team->belongsTo: Country, State Team->hasAndBelongsToMany: User (the players on a team, table = teams_players) Team: CREATE TABLE IF NOT EXISTS `teams` ( `id` int(10) NOT NULL auto_increment, `status` enum('approved','pending') NOT NULL default 'pending',

Re: API

2009-01-03 Thread gearvOsh
I usually open the files myself instead of using the API online. I usually have to go through the methods themselves to find out the options. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to

Re: new benchmarks of PHP frameworks

2009-01-02 Thread gearvOsh
These benchmarks dont mean anything. Do a benchmark using a full fledged system (perhaps a whole social community) and see how the work. Simply hello world pages are nothing because no frameworks are used for that. --~--~-~--~~~---~--~~ You received this message be

Re: Reverse relations?

2008-12-31 Thread gearvOsh
I could of sworn I tried that and it didn't work, I must have changed the foreign_key. Anyways that worked. Yeah I was also thinking in my system... is that a user is top level and he has many different parts. A user is not necessarily part of a country, but I guess ill have to do it that way. --

Reverse relations?

2008-12-31 Thread gearvOsh
I know how to do relations for foreign keys, but I cannot figure out how to do this. In my users table, I have a column called state_id and country_id. I tried a hasOne country but that does not work. It looks for a user_id on the Country table that matches the user id, I need it the other way ar

Re: show / hide with ajax

2008-12-30 Thread gearvOsh
You mean an accordion? http://docs.jquery.com/UI/Accordion --~--~-~--~~~---~--~~ 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 grou

Re: Problem with auth component

2008-12-30 Thread gearvOsh
What does your AppController beforeFilter() look like? http://www.milesj.me/blog/read/5/using-cakephps-auth-component/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send emai

Re: buttons in cakephp

2008-12-30 Thread gearvOsh
http://groups.google.com/group/cake-php/browse_thread/thread/48835c8925d3ca7a# You already asked this. There is a search function. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this grou

Re: findCount different then find('count')

2008-12-30 Thread gearvOsh
k > > On Dec 30, 6:45 am, jason m wrote: > > > i think it should be > > > return $this->find('count', array('conditions'=>$conditions)); > > > On Dec 30, 2:59 pm, gearvOsh wrote: > > > > All I did was this: >

Re: How to change data of dropdown box when value of other dropdown box changes

2008-12-30 Thread gearvOsh
Ok you keep asking like 10 questions a day here. 1 - Read the CakePHP manual 2 - What you want to do is JSON/Javascript 3 - Perhaps actually learn PHP or Cake --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP"

Re: findCount different then find('count')

2008-12-29 Thread gearvOsh
All I did was this: return $this->find('count', $conditions); return $this->findCount($conditions); $conditions = array('OR' => array( 'Friend.user_id'=> $user_id, 'Friend.friend_id' => $user_id )); --~--~-~--~~~---~--~~ You received this message b

findCount different then find('count')

2008-12-29 Thread gearvOsh
So I noticed when I used find('count') that the query is wrong: SELECT COUNT(*) AS `count` FROM `friends` AS `Friend` LEFT JOIN `users` AS `User` ON (`Friend`.`user_id` = `User`.`id`) WHERE 1 = 1 But when I use findCount the query and results are correct: SELECT COUNT(*) AS `count` FROM `friend

Re: Doing pagination without paginate()

2008-12-29 Thread gearvOsh
Ive been messing around with it a bit and got this, is this the right way to do things? class DashboardController extends AppController { var $uses = array('Friend'); // Pagination var $paginate = array( 'Friend' => array( 'limit' =

Doing pagination without paginate()

2008-12-29 Thread gearvOsh
Im having problems getting pagination working. I have complex custom queries and I just cant get it working correctly. Ive tried building a custom paginate() method within the model that does additional filtering, but then I also feel limited using the $paginate var in the controller. Anyone have

Re: Data validation doesn't work

2008-12-29 Thread gearvOsh
You either need to have: required = true Or use the notEmpty rule. http://book.cakephp.org/view/127/One-Rule-Per-Field http://book.cakephp.org/view/740/notEmpty --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake

Re: Auth Only Showing Logged in on Users Controller

2008-12-29 Thread gearvOsh
Can I see your AppController or another Controller besides User? --~--~-~--~~~---~--~~ 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

Re: How to make buttons in cakephp

2008-12-29 Thread gearvOsh
You dont have to build your views with cake code only: Name Also there is no in cake. --~--~-~--~~~---~--~~ 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

Re: Newby: "Undefined index" error

2008-12-28 Thread gearvOsh
You need to be using the User model. Make sure this is in your controller: $uses = array('User'); Perhaps look at these two links also: http://book.cakephp.org/view/171/Access-Control-Lists http://book.cakephp.org/view/172/Authentication --~--~-~--~~~---~--~~ You

Re: HTML 4 specific CakePHP?

2008-12-28 Thread gearvOsh
I have not found any option or setting for using HTML or XHTML. All I have seen is that you can set the Doctype, but even if you set the Doctype as HTML, all the tags are in XHTML. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

Re: How would I write this query

2008-12-27 Thread gearvOsh
This is what I came up with, I dont know if theres another solution. Also im completely lost how to paginate this. function getMyFriends($user_id, $status = 'approved', $limit = 5) { $friends = $this->find('all', array( 'fields' => array('Friend.*')

Re: How would I write this query

2008-12-27 Thread gearvOsh
I got something working on this but I ran into a problem. When joining the user table to the friend data, I dont know if its the friend_id or the user_id. So I will have to do some filtering and extra queries after i grab all friends. --~--~-~--~~~---~--~~ You recei

Re: How would I write this query

2008-12-27 Thread gearvOsh
Snippets of the code: CREATE TABLE IF NOT EXISTS `friends` ( `user_id` int(10) unsigned NOT NULL, `friend_id` int(10) unsigned NOT NULL, `status` enum('approved','pending') NOT NULL default 'pending', `requestTime` int(10) NOT NULL, KEY `user_id` (`user_id`), KEY `friend_id` (`friend_

How would I write this query

2008-12-27 Thread gearvOsh
Im a bit new to the model system, trying to understand how I would do a query like so. SELECT Friend.*, User.username, User.avatar, User.handler FROM friends AS Friend, users AS User WHERE Friend.status = 'approved' AND ((user_id = ':user_id') OR (friend_id = ':user_id')) AND User.id = Friend.use

Re: HTML 4 specific CakePHP?

2008-12-27 Thread gearvOsh
@Arthur Pemberton - Yeah but then if I set my Doctype as HTML 4 im riddled with markup errors which isnt good for me or the client. @Marcelo Andrade - Yeah thats what I was hoping was in the system, but I guess not. Ill see if I can extend it in some way. --~--~-~--~~~

Re: HTML 4 specific CakePHP?

2008-12-27 Thread gearvOsh
No thats the thing, XHTML is not supported. You would need to put the content-type as application/xhtml+xml which in most cases breaks the layout and always breaks IE. Everyone usually puts it as text/html which then renders the browser as regular HTML and NOT XHTML. Im not telling you XHTML is b

Re: I'm not sure how to write this query...

2008-12-26 Thread gearvOsh
How is your database setup? Are tags a column in the blog table or is it its own table? --~--~-~--~~~---~--~~ 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 T

Re: HTML 4 specific CakePHP?

2008-12-26 Thread gearvOsh
Most browsers dont support XHTML and most people dont even write XHTML correctly. If this is your site(http://www.pembo13.com/), your DTD is XHTML but its being parsed as HTML. So basically thats kaput, did you read the article I posted earlier? @Graham Weldon - Seems like a lot of work to overwr

Re: HTML 4 specific CakePHP?

2008-12-26 Thread gearvOsh
Please explain your cleanliness? HTML 4 can do everything XHTML can except self closing tags />. Also your XHTML is being parsed as HTML and removed, so whats your point? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

HTML 4 specific CakePHP?

2008-12-26 Thread gearvOsh
Honestly I really dislike the "xhtml" type of tags in CakePHP. There are no reasons for that, I think it would be a better idea to make it html 4 strict. Heres an article on why xhtml is retarded. http://www.webdevout.net/articles/beware-of-xhtml --~--~-~--~~~---~--~-

Re: Upgrade to 1.2 RC4 or 1.2 Final , get a "Internal Server Error"

2008-12-26 Thread gearvOsh
Your filename should be xxx_controller.php (no capital). If you were just typing it that way. Also why are you changing the controller before submit? This makes no sense. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

Re: the Gift of 1.2 Final

2008-12-26 Thread gearvOsh
Ive only been used cake a couple of weeks but have been watching it for years. Ive got to say I love it the most out of the others ive tried, keep up the good work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cak

Re: setlocale

2008-12-23 Thread gearvOsh
Is there a reason why this has not been implemented in the l10n? Im a but curious :p --~--~-~--~~~---~--~~ 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 u

Re: Can someone explain why this happens

2008-12-22 Thread gearvOsh
Ah I came to that assumption last time, but then I had random instances where the hash wasnt being used as the id so I got confused. Anyway, would I just leave it? Or put an ($id = null, $hash = '')? --~--~-~--~~~---~--~~ You received this message because you are s

Re: Using dynamic values in model validation

2008-12-22 Thread gearvOsh
No not that. In the models beforeValidate() is it possible for me to do like $controller->params? UsersController -> User Model So in User::beforeValidate() can I get UsersControllers params, is basically what im asking? --~--~-~--~~~---~--~~ You received this mes

Re: Setting "Required" Validation in a Model

2008-12-22 Thread gearvOsh
I never use allowEmpty or required = true. Simply use the rule "notEmpty" which means the field cannot be empty, thus required. And if a field doesnt have that rule, its not required, it works perfectly for me. --~--~-~--~~~---~--~~ You received this message because

Re: Using dynamic values in model validation

2008-12-22 Thread gearvOsh
Thanks, also is there a way I can get the parent controller data as well? --~--~-~--~~~---~--~~ 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

Using dynamic values in model validation

2008-12-21 Thread gearvOsh
Is there a way to use dynamic variables within the Model validation, an example below. 'between' => array( 'rule' => array('between', $passMin, $passMax), 'message' => 'Password must be between '. $passMin .' and '. $passMax ) I have an array of config settings that I would like

Can someone explain why this happens

2008-12-21 Thread gearvOsh
So I have an action that verifies an email address after a successful signup. It uses a hash that was given in the email sent out. function verify($hash = '') { } This is my test hash and the url becomes: /users/verify/ eac20adf536b50f9fc0be58550fde763 When I go to that page, and even without s

Disabling Auths auto-hashing

2008-12-21 Thread gearvOsh
Is there a setting to disable the AuthComponent from automatically hashing the password index, without having to edit the core files? It really annoys me. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" grou

Re: exclude form helper markup?

2008-12-21 Thread gearvOsh
@Adam - Theres nothing wrong with it, but when you have fancy forms and pre-cssed systems, cakes markup just gets in the way/breaks things. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to t

Re: exclude form helper markup?

2008-12-21 Thread gearvOsh
Yes I really dislike that also, you have to do this everytime. input('email', array('div' => false, 'label' => false)); ?> Div removes the surrounding div, and label removes the label. Then you can create the label manually: label('email', 'Email:', array('class' => 'label')); ?> --~--~---

Re: Validate in 1.2RC4

2008-12-19 Thread gearvOsh
Dont you need to call this? if ($this->Task->validates()) { // if no errors, do something } --~--~-~--~~~---~--~~ 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.

Re: how to set session when Auth component is used in login page

2008-12-19 Thread gearvOsh
Its automatic in the Auth component, just do this. if ($this->Auth->user()) { // they are logged in } If user() is null, that means they are not logged in. Hope that helps. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Re: Updating a single database rows field

2008-12-19 Thread gearvOsh
So really weird. This was my previous action in the controller. function verify($hash = NULL) { } That would fail the saveField(), and the saveField would try to do an insert. It would also grab the wrong id for the User model. But once I changed it to the following it works fine. function veri

Re: Updating a single database rows field

2008-12-18 Thread gearvOsh
I even moved all the code into the Model, did what you said, and its still doing an insert instead of an update. Heres the method I call in the controller: function verifyEmailExpiration($username, $password, $hash, $expHours) { $userObj = $this->find('first', array( 'cond

Re: Updating a single database rows field

2008-12-18 Thread gearvOsh
Like I said, I dont want to Import the locale in every model method. Also saveField fails at this point: if (!empty($this->id)) { if (!$db->update($this, $fields, $values)) { $success = false; } } Because of this, When I know for sure the row exists. if (!$this-

Re: Updating a single database rows field

2008-12-18 Thread gearvOsh
Also I wish to not import and initiate a locale class in the model everytime I need it, which would be most of the time. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send ema

Re: Updating a single database rows field

2008-12-18 Thread gearvOsh
I cant use i18n/l10n in models now can I. Please show me how I would add errors to the $this->validationErrors array with a locale. If something works, who cares where it belongs. @grigri - I did updateAll, I just dislike how it doesnt escape and quote the data. --~--~-~--~~--

Re: Updating a single database rows field

2008-12-17 Thread gearvOsh
I still have yet to find a straight forward way to do this, so ill simply do something like this: function update($user_id, $fields) { if (is_array($fields)) { App::import('Sanitize'); Sanitize::clean($fields); $cleanFields = array();

Re: Updating a single database rows field

2008-12-17 Thread gearvOsh
Oh but the extra code is for extra form validation on my end. Using invalidate() adds errors to the array that I can then loop through and display in the view (I dislike having the error show up after the input). On Dec 17, 3:24 am, AD7six wrote: > On Dec 17, 9:56 am, gearvOsh wr

Re: AuthComponent Error... Wrong Password all the Time

2008-12-17 Thread gearvOsh
Try this: http://www.milesj.me/blog/read/debugging-cakephp-auth/ Or it could also be your password column in your database is at like 30 varchar... you would at least need 50+ if your hashing passwords. Its possible some of the hashed password got cut off. On Dec 17, 11:29 am, Christian wrote:

Re: Overkill for a starter project?

2008-12-17 Thread gearvOsh
Honestly things like that I would just manually code or even use Wordpress just because its so simple. You could use CakePHP simply for the practice and automation, but there are no downsides using Cake. Perhaps just a ton of files the client wouldn't understand what they're for. --~--~-~-

Re: Updating a single database rows field

2008-12-17 Thread gearvOsh
I was only doing what the other guy suggested, I usually do not have the create() method. --~--~-~--~~~---~--~~ 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

Re: Updating a single database rows field

2008-12-17 Thread gearvOsh
Nope, still doesn't work. This seems like a lot of hassle/steps in between just to do something simple like update. Heres a snippet of my code: if ($this->User->validates()) { $userObj = $this->User->find('first', array( 'conditions' => array( 'User.username' => $this->da

Re: Updating a single database rows field

2008-12-17 Thread gearvOsh
Tried it again that way and heres the error: Warning (512): SQL Error: 1062: Duplicate entry '' for key 2 [CORE\cake \libs\model\datasources\dbo_source.php, line 521] Query: INSERT INTO `users` (`status`) VALUES ('inactive') It keeps inserting, even if I set the id. --~--~-~--~~-

Re: Updating a single database rows field

2008-12-17 Thread gearvOsh
Ive done that also, it still inserted a new row. --~--~-~--~~~---~--~~ 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 ema

Updating a single database rows field

2008-12-17 Thread gearvOsh
Ok, I may be stupid... but how would I update a single field on a single row. Something like the following without having to write a custom query. UPDATE users SET status = 'active' WHERE id = 1 Ive tried doing saveField() but that inserts a new row. Ive also tried using updateAll() but that do

Re: $validate an array

2008-12-15 Thread gearvOsh
Perhaps do something like this if ($this->RequestHandler->isPost()) { $cleanData = array(); foreach ($this->data as $field => $data) { // Rebuild the cleanData array based on your structure for the database } $this->data = NULL; $this->data

Re: $validate an array

2008-12-14 Thread gearvOsh
Why/How is it a multidimensional array? If you use the FormHelper it builds it into a nicely formatted array in $this->data['ModelName']; --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to thi

Re: Changing the Auth User Model

2008-12-14 Thread gearvOsh
Have you tried placing the Auth information in AppControllers beforeFilter()? Try that and see what happens... and if that doesnt help, look in the Auth Component manually. On Dec 14, 11:59 am, DavidH wrote: > Please note that since the above post I've corrected the model name to > Twitcher as o

Re: Database design . Beginner having trouble.

2008-12-13 Thread gearvOsh
If I believe what you are saying, something like this would work (not sure what fields you need): // all the tenants tenants - id - name // all the expenses expenses - id - cost // relating a tenant to an expense = multiple tenants possible on an expense tenantExpenseRelation - id - tenant_id -

$form->input with onkeyup, onfocus, etc

2008-12-12 Thread gearvOsh
So I have input fields that need javascript events for onfocus and onkeyup.. here is my code: input('username', array('onkeyup' => "populateUrl ('username', 'usernameUrl');", 'onfocus'=> "showSignupHelp ('username');")); ?> That works, BUT when you look at the source it looks like the fo

Re: Prevent redirect in Auth

2008-12-12 Thread gearvOsh
It seems you will have to remove/comment out that part that redirects in the auth component manually. On Dec 12, 4:41 am, Dav wrote: > Tried that earlier, still redirects to "users/login". > > I have this in my controller > function beforeFilter() { >     $this->Auth->autoRedirect = false; > > }

Re: Debugging Auth: getting the name of teh action I get kicked

2008-12-12 Thread gearvOsh
Or check the $this->params, I believe its $this->params['action']; On Dec 12, 7:06 am, Daniel Hofstetter wrote: > Hi Anja, > > > I get kicked out of some actions in some controllers. I have alread > > placed > > function beforeFilter() > >     { > >         parent::beforeFilter(); > >          

Re: Is CakePHP 1.2 fully backwards compatible with 1.1.16?

2008-12-12 Thread gearvOsh
Also, correct me if im mistaken. Instead of loadModel('ModelName') and other variations, its now App::import('Model', 'ModelName'); On Dec 12, 10:21 am, aranworld wrote: > The following are the main things I came across during a recent > upgrade: > > -- all the html helper functions related to

Re: $form->input() helper question

2008-12-11 Thread gearvOsh
Yes most likely, but in my own apps I just write the div manually and only use $html for forms/links and images. On Dec 11, 1:53 pm, maytawn wrote: > gearvOsh - > > Yeah, your're right.  I don't know what I was thinking... but is does > bring up a related question.  If I

Re: Prevent redirect in Auth

2008-12-11 Thread gearvOsh
Perhaps look at this: http://book.cakephp.org/view/395/autoRedirect If that doesnt work, you may have to edit the core files manually. On Dec 11, 9:40 am, Dav wrote: > Hi, > > I want to use the Auth component but I don't want it to send out the > location: header. > (I'm not using ajax) > > I j

Re: Finding Auth'd users Username

2008-12-11 Thread gearvOsh
If your logged in its: $this->Auth->user('username'); Or you can assign a user variable to the view: $this->set('user', $this->Auth->user()); echo $user['username']; Hope that helps. On Dec 11, 11:10 am, "bioselem...@gmail.com" wrote: > I've been wacking my head on the wall for the past few

Re: Newbie question on form validating

2008-12-11 Thread gearvOsh
Yes, I was about to to point out that it might be because your model file name is capitalized. On Dec 11, 4:57 am, AJV wrote: > :D > > Well I guess I just confirmed my newbie status, I had written the > names of the model files Capitalized. I noticed that small letters > work much better :D > >

Re: Newbie question on form validating

2008-12-11 Thread gearvOsh
I just finished doing this today, these two links should help: http://book.cakephp.org/view/125/Data-Validation http://groups.google.com/group/cake-php/browse_thread/thread/d5e98df32a08c5cd# --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Getting an array of errors during validation

2008-12-11 Thread gearvOsh
Oh and also stupid me, its basically in the manual: http://book.cakephp.org/view/410/Validating-Data-from-the-Controller My way doesnt require you to set the data to the view though, but either way works. --~--~-~--~~~---~--~~ You received this message because you

Re: Getting an array of errors during validation

2008-12-11 Thread gearvOsh
I figured it out. $validationErrors contains the array, I simply set it in the view. // login.ctp element('errors', array('errors' => $form- >validationErrors['User'])); ?> // elements/errors.ctp $error) { ?> But

Re: Getting an array of errors during validation

2008-12-11 Thread gearvOsh
Ok ill take a look at that. Hopefully I can do something to get an array so I can do a simple loop. On Dec 11, 12:27 am, Marcus <[EMAIL PROTECTED]> wrote: > On Dec 11, 9:14 am, gearvOsh <[EMAIL PROTECTED]> wrote: > > > So I understand the Model validation using $va

Getting an array of errors during validation

2008-12-11 Thread gearvOsh
So I understand the Model validation using $validate. I applied snooks multiple validations using http://snook.ca/archives/cakephp/multiple_validation_sets_cakephp/, all that works perfectly. I do however dislike it when a field errors, the error message is shown after the input. Id rather a lis

Re: $form->input() helper question

2008-12-10 Thread gearvOsh
You mean like this? Label ? Thats incorrect syntax. On Dec 10, 8:59 pm, maytawn <[EMAIL PROTECTED]> wrote: > gearvOsh: > > I like your idea... it sems simple, but how do I call the $form->label > () method so that the $form->input() method is wrapped inside? >

  1   2   >