Questions about forms / validation

2009-01-14 Thread Miles J
So Im working on this area where users can edit their profile, etc. All the validation works, its just on the email field it always errors because I am using the isUnique rule. It keeps erroring because the email in the input is THEIR email, and it does exist in the database. So it keeps throwing

Re: How to load HABTM Joining model in a plugin?

2009-01-14 Thread Martin Westin
Sure. This is from the NewsMessage side of things var $hasAndBelongsToMany = array( 'NewsSubscriber' => array( 'className' => 'News.NewsSubscriber', 'joinTable' => 'news_messages_news_subscribers', 'with' => 'News.NewsMessagesNe

Bakery Article Comment Notification broken

2009-01-14 Thread majna
I cant open mail notification in gmail. content type is multipart/alternative, message is attached as unknown file. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to

Re: Simple validation, required=true does not work or has preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash

2009-01-14 Thread phpcurious
Louie, I read it somewhere in some people's blog, that the 'required' validation rule doesn't really mean the field being required. Even I don't get much the idea of it. But You might consider checking up "notEmpty" instead if you want the field not to be empty. On Jan 15, 1:52 pm, "Louie Miran

Re: Writing to a database from a view

2009-01-14 Thread Jon Bennett
Hi xybersoftware, > My form does not have any editable fields... > I only want to change certain fields of the records that are shown in > the view if a user checks a check box and clicks submit... > If the user checks the box then I want to mark all the records that > are shown with todays

Re: Separate message for Auth and ACL

2009-01-14 Thread aranworld
Off the top of my head, I would think you could add some logic to your app_controller beforeFilter() in which you check for the existence of the Auth session information. If it doesn't exist, then trigger your redirection to the login page. Otherwise, just let the automatic error get displayed.

Simple validation, required=true does not work or has preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash

2009-01-14 Thread Louie Miranda
Guys, is there a new way of doing a simple this field is required? true or false? The code example and my code below, does not work. My code: var $validate = array( >'officer'=>array('required'=>true) > ); > I am using CakePHP (Stable/Latest release). I get an error of... > preg_match() [f

Separate message for Auth and ACL

2009-01-14 Thread jst4fun
Hi, I had already asked this question in the IRC but I was told that it is not possible. I am just trying out my luck here in the group. The issue for me is that I want to provide separate messages for Auth component session timeout error and ACL permission denied error. Currently ACL uses the $th

Re: Two alphaNumeric validation on model, but I get a preg_match error on line 187, [CORE/cake/libs/validation.php]

2009-01-14 Thread Bernardo Vieira
I stumbled upon this error once as well. As it turns out, some versions of php - most notably the stock centos php package - are compiled without the -enable-unicode-properties. Since the alphaNumeric rule uses preg_match with the /u you get this error. You have two options, either recompile p

CakePHP and Microsoft CRM

2009-01-14 Thread AussieFreelancer
Hi all, on a couple of occasions, clients have requested the integration of their website with Microsoft CRM. It seems to me that MS CRM is actually very closed and secure code, so 'hooking' into it, is not too easy, but I can't seem to find any information on the internet with regards to integrat

Re: Two alphaNumeric validation on model, but I get a preg_match error on line 187, [CORE/cake/libs/validation.php]

2009-01-14 Thread Louie Miranda
Hi Gwoo, Thanks a lot. I did not knew about that, I think I did not also see that on the manual or it is just me. Anyway, it was solved. -- Louie Miranda (lmira...@gmail.com) http://www.louiemiranda.net Security Is A Series Of Well-Defined Steps chmod -R 0 / ; and smile :) On Thu, Jan 15, 2009

RE: Compliance of HTML output

2009-01-14 Thread Steven Wright
Thanks Miles. -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of Miles J Sent: Wednesday, January 14, 2009 11:09 PM To: CakePHP Subject: Re: Compliance of HTML output No it is not, but it doesnt hurt the code. $form->input is a global

Re: Pulling dynamic content with cake 1.2 final

2009-01-14 Thread Miles J
Your previous code is extremely unsecure and uses bad logic. If your views name is sitemap.ctp within /views/pages/, the url would be /pages/sitemap/. If you want it to just be /sitemap, you would have to do some routing. Router::connect('/sitemap', array('controller' => 'pages', 'action' => '

Re: Compliance of HTML output

2009-01-14 Thread Miles J
No it is not, but it doesnt hurt the code. $form->input is a global function, so anything in options would be added. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send emai

Re: Updating AROS for USER when changing the User Group.

2009-01-14 Thread sijo jose
Thanks Alexandru... Regards Sijo Jose C On Wed, Jan 14, 2009 at 9:22 PM, Alexandru Ciobanu wrote: > > sijo jose wrote: > > Hi all, > > > > I have been stuck at two places. > > > > 1. This is regarding User and his corresponding. > > Actually I have a User who is assigned a Group 'xx' while h

Security.level with Blackberry over SSL

2009-01-14 Thread Elmo
I am having a problem. While developing I keep my Security.level to low while also using SSL. When I am ready to stage my site for testing, I have the production setting which is Security.level on high and SSL. The entire site is locked down (you need to login to access the site). My problem is th

Compliance of HTML output

2009-01-14 Thread rhythmicde...@gmail.com
I have this statement in my view: echo $form->input('Recipe.description', array('rows' => '3')); that outputs this: test I dont think that 'maxlength' is a valid attribute of a textarea. Can anyone chime in on that? Thanks Steve --~--~-~--~~~---~--~~ You recei

Pulling dynamic content with cake 1.2 final

2009-01-14 Thread Bankai
I am trying to figured out how to pull content dynamically using cake 1.2. I have my content files in the views/pages directory. All of them with .ctp extension. I did it on php with the following code: >From the URL I would type something like: www.domain.com/?pg=contact How can I accomplis

Re: Two alphaNumeric validation on model, but I get a preg_match error on line 187, [CORE/cake/libs/validation.php]

2009-01-14 Thread Gwoo
try a different key name. 'alpha_numeric'=>array( > 'rule'=>'alphaNumeric', --~--~-~--~~~---~--~~ 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: Writing to a database from a view

2009-01-14 Thread Miles J
submit('Submit!'); ?> Like any other form? Just create a search button and then when you press it, any form data is passed to $this->data in the controller. Try testing it and debugging the data by debug($this->data); Make sure your checkboxes are built using $form. --~--~-~--~~

Re: multiple httpd.conf files

2009-01-14 Thread Bob Albert
It looks like your httpd.conf file is correct. You just want the AllowOverride set to All. I had a very similar problem with my Mac. I'm using MAMP install, but i think your problem could be the .htaccess file. In the 1.2 generic folder that you use as the basis of your app has a .htaccess

Re: Two alphaNumeric validation on model, but I get a preg_match error on line 187, [CORE/cake/libs/validation.php]

2009-01-14 Thread Louie Miranda
Anyone? :( -- Louie Miranda (lmira...@gmail.com) http://www.louiemiranda.net Security Is A Series Of Well-Defined Steps chmod -R 0 / ; and smile :) On Wed, Jan 14, 2009 at 1:34 PM, Louie Miranda wrote: > Hello, > > I tried two alphaNumeric validation, but I get a preg_match error. > > >> *War

Re: multiple httpd.conf files

2009-01-14 Thread Webweave
Looks like you are running on Mac. If you're using the built in web server, then it is located at / private/etc/apache2/httpd.conf The 'which' command doesn't find files, it just tells you where the executable is in your path. On Jan 13, 3:54 pm, neridaj wrote: > Hello, > > I just installed

Re: Writing to a database from a view

2009-01-14 Thread xybersoftw...@gmail.com
My form does not have any editable fields... I only want to change certain fields of the records that are shown in the view if a user checks a check box and clicks submit... If the user checks the box then I want to mark all the records that are shown with todays date... I guess the question now i

Re: Writing to a database from a view

2009-01-14 Thread Webweave
You will find the data you need in $this->data after the form has submitted (assuming your form is built correctly and posting to the right action). On Jan 14, 1:39 pm, "xybersoftw...@gmail.com" wrote: > Ok got it to write to the database from the controller by hard coding: > $this->Subscription

Re: newer in cakephp

2009-01-14 Thread Miles J
Enjoy! http://book.cakephp.org/ I read the whole book in 2 days, its not that hard. --~--~-~--~~~---~--~~ 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

Re: How to load HABTM Joining model in a plugin?

2009-01-14 Thread Webweave
Can you post your HABTM from your models ? It looks like you have the model file in the right place, so my guess is that the problem is in there. On Jan 14, 4:59 am, Martin Westin wrote: > Hi everyone, > > This is the first time I have tried to make a real model for a joining > table and I got

Re: Bake scripts without shell access

2009-01-14 Thread Webweave
What I do is to do the bake locally (on my Mac or PC) and then upload it to the server. Normally then all you need to do is modify your config files and .htaccess to be correct for the server you are hosting on. On Jan 14, 11:06 am, Bob Albert wrote: > I'm new to this group and CakePHP so pleas

Re: Writing to a database from a view

2009-01-14 Thread Webweave
I would suggest you run through baking a small app to see how the MVC bits fit together (http://book.cakephp.org/view/113/Code-Generation- with-Bake) The Model is where your data and business logic goes. The Controller handles getting the data from the Model and preparing it for the View. The Vie

Re: Writing to a database from a view

2009-01-14 Thread xybersoftw...@gmail.com
Ok got it to write to the database from the controller by hard coding: $this->Subscription->saveField('month1_mailinginfo_sent', date('Y-m- d')); But it added a new blank record with the month filled in...not really what I wanted but a baby step forward... How do I post from the php code of the vi

Re: newer in cakephp

2009-01-14 Thread sergnome
Hello, I am new to CakePHP too. And you are new in PHP too? --~--~-~--~~~---~--~~ 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 g

mod_rewrite problems

2009-01-14 Thread neridaj
Hello, I've edited my httpd.conf file as instructed and can't get mod_rewrite working. Any suggestions? /etc/httpd/httpd.conf: LoadModule rewrite_module libexec/httpd/mod_rewrite.so DocumentRoot "/Library/WebServer/Documents" # # This may also be "None", "All", or any combination of "In

RE: Automagic Form Fields

2009-01-14 Thread Steven Wright
Ha! That was it. Man thanks. I have a secondary method that populated using list. -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of Miles J Sent: Wednesday, January 14, 2009 3:38 PM To: CakePHP Subject: Re: Automagic Form Fields How i

Re: Writing to a database from a view

2009-01-14 Thread Miles J
Are you POSTing the data (checked checkboxes) to anywhere? If so loop the $this->data array in the controller. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake

Re: Writing to a database from a view

2009-01-14 Thread xybersoftw...@gmail.com
Do it in the controller? I guess that is where I am not understanding... How do I get my data from the php code in the thtml file into the controller? An array_push? Do I use the save or savefields? Do I need to pass the record id or index to the controller? Does my thtml view php interate through

Re: Automagic Form Fields

2009-01-14 Thread Miles J
How is the data prepopulating the input? Are you calling a find() or setting the data? --~--~-~--~~~---~--~~ 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

Re: Automagic Form Fields

2009-01-14 Thread rhythmicde...@gmail.com
In addition here is the debug output from the controller. This is from the _schema array as you can see its of type string. [ingredient] => Array ( [type] => string

Automagic Form Fields

2009-01-14 Thread rhythmicde...@gmail.com
I am confused. I have changed the column type of a field in my table to be a varchar from a foreign key ID field. I used to use it to generate a select list in my form for ingredient. However I have changed the design and now I want to store the ingredient as a varchar. For some reason the field

Re: Javascript funktion call from html -> link

2009-01-14 Thread nomex
thanx for your help! On 14 Jan., 20:46, Kyle Decot wrote: > I fixed the problem by changing your double quotes around the word > "test" to be single quotes. Your code should look like: > > link($article['article']['name'], '/articles/view/'. > $article['article']['id'], array('onmouseover' => 'a

Re: Tabs in Layout... Help Please.

2009-01-14 Thread Kappa
Why not using "for_layout" variables? Just set into your controller action a "selectedtab_for_layout" variable and inside the layout (yes i said layout, not view) you can access it. On Jan 14, 5:42 pm, teknoid wrote: > If I understand this right, you are looking to set an "active" tab, > based

Re: "Nr. Affected Errors" Message after installing Cakephp

2009-01-14 Thread dipeshsoftw...@gmail.com
Thanks. I have set it to 1 as mentioned in the comments there and that message is gone. Thanks once again. On Jan 14, 11:13 am, Henrique Machado wrote: > set debug = 0 at core.php > > 2009/1/14 dipeshsoftw...@gmail.com > > > > > Hi, > > > I am new to cakephp work and after installing cakephp I

Re: Javascript funktion call from html -> link

2009-01-14 Thread Kyle Decot
I fixed the problem by changing your double quotes around the word "test" to be single quotes. Your code should look like: link($article['article']['name'], '/articles/view/'. $article['article']['id'], array('onmouseover' => 'alert(\'test \';)')); ?> On Jan 14, 2:40 pm, nomex wrote: > Hey, may

Javascript funktion call from html -> link

2009-01-14 Thread nomex
Hey, maybe a stupid question, but i'm stuck. i want to create a link with this output: a onmouseout="mymouseout()" onmouseover="mymouseover(0)" href="...">Marker One i tried this with this: link($article['article']['name'], '/articles/view/'. $article['article']['id'], array('onmouseover' => '

When I create a pdf it is not flushing the buffer

2009-01-14 Thread BrianRehg
I use fpdf to create a pdf and it works perfect. The problem is - after the pdf has been downloaded the next page that I go to loads the contents of the pdf at the top of the page. I have tried using flush() and a redirect after the download but nothing seems to work. Any ideas? Brian --~--~--

Re: "Nr. Affected Errors" Message after installing Cakephp

2009-01-14 Thread Henrique Machado
set debug = 0 at core.php 2009/1/14 dipeshsoftw...@gmail.com > > Hi, > > I am new to cakephp work and after installing cakephp I do get a > message > > Nr. ...Affected Errors > > for all my request. > > How can i disable/comment this message? > > Thanks! > > > > --~--~-~--~~

Bake scripts without shell access

2009-01-14 Thread Bob Albert
I'm new to this group and CakePHP so please excuse these questions if they've been covered on the list. I have been working through David Golding's "Beginning CakePHP" book from Apress. I just got through the chapter were he describes the Bake scripts. My question is how others use this in

Re: Writing to a database from a view

2009-01-14 Thread Miles J
Do it in the controller. On Jan 14, 10:39 am, "xybersoftw...@gmail.com" wrote: > I have a cake view called process_members.thtml. > In the view I have setup some filtering and check boxes. If one of the > check boxes is marked I want to write the current date to a field in > the database. > > So

Writing to a database from a view

2009-01-14 Thread xybersoftw...@gmail.com
I have a cake view called process_members.thtml. In the view I have setup some filtering and check boxes. If one of the check boxes is marked I want to write the current date to a field in the database. So I start Iterating through the database looking at records and so I may be writing to more t

Re: How does Cake populate $this->data with a submitted form's $_POST variables?

2009-01-14 Thread WebbedIT
Martin, you were spot on! For my submit buttons I was adding a method: 'post' parameter and for all other links I wasn't. Turns out that ModalBox will carry apply GET as default (if no method parameter specified) but once you do specify a method it will continue to use it. Now that I added meth

Re: New Install Does Not Show Graphics

2009-01-14 Thread reidster
Thank you! That resolved the problem. I can now see the CakePHP main page with graphics and I do not need to manually navigate to index.php. Many thanks for your assistance. -Reid On Jan 14, 10:53 am, Unbenannt wrote: > You will probably have to add index.php to your DirectoryIndex > configur

Re: passing parameters with /

2009-01-14 Thread Mario Cesar
tks all for tips!!! On Wed, Jan 14, 2009 at 3:30 PM, Marcelo Andrade wrote: > On Wed, Jan 14, 2009 at 9:00 AM, Mario Cesar wrote: > > > > hi!! > > I need pass paramters like 2008/1 2008/2 > > but the cake only read 2008 > > how can I pass parameters like that? > > Can't you consider two paramete

Re: passing parameters with /

2009-01-14 Thread Marcelo Andrade
On Wed, Jan 14, 2009 at 9:00 AM, Mario Cesar wrote: > > hi!! > I need pass paramters like 2008/1 2008/2 > but the cake only read 2008 > how can I pass parameters like that? Can't you consider two parameters (2008 and 1) and mount the data you need into the controller? Best regards. -- MARCELO D

Re: passing parameters with /

2009-01-14 Thread brian
What does your route for this action look like? On Wed, Jan 14, 2009 at 7:00 AM, Mario Cesar wrote: > > hi!! > I need pass paramters like 2008/1 2008/2 > but the cake only read 2008 > how can I pass parameters like that? > tks > > > > --~--~-~--~~~---~--~~ You re

Re: parameters with /

2009-01-14 Thread Martin Westin
Simple answer is that you can't pass a parameter containing / Cake will interpret the / as a separator and make two parameters, 2008 and 2 in your case. You can either reassemble your parameters in the controller by parsing through the params array (see teknoid's reply). Or you can choose to use

Re: swiftmailer wont send

2009-01-14 Thread ksalling
That is not it... I sat here one evening while working on this problem and my reply wasnt posted in 4 hours. I went to the google help which claimed the post should be instant so I went through the troubleshooting (clearing cache etc) nothing worked. It eventually posted all of them the next day a

Re: Validate date from model

2009-01-14 Thread fly2279
I'm also new to cake and I just accomplished this myself a few days ago. I only do the start before end validation and not end after start. I don't know if that's a good way to do it or not. In the startBeforeEnd validation you specify which field you want to compare the 'start' field to, in my ca

Where to validate multiple fields?

2009-01-14 Thread fly2279
I am creating an app that's similar to a punch clock in the way that it functions. The user enters a start and stop datetime and I need to do some validations. I need to check that there is not a previously entered "time block" in the database that conflicts with the data being entered. No two tim

Re: Validate date from model

2009-01-14 Thread teknoid
You'll need to write a custom function to compare two dates. How to do that is explained in the manual. As far the actual function, there are tons of examples if you search for something like "php date compare" on google. On Jan 14, 3:56 am, Mike wrote: > Hi everyone, > > I'm a new user of CakeP

Re: Tabs in Layout... Help Please.

2009-01-14 Thread teknoid
If I understand this right, you are looking to set an "active" tab, based on the view you are currently in... It can be done easily from the view itself, i.e. in view_one.ctp: $this->set('tabOne', true); (which is now going to be available in your layout). Therefore, in the layout you could do:

Re: parameters with /

2009-01-14 Thread teknoid
Any params can be passed like: /controller/action/param1/param2/param3 Or as named params: /controller/action/name:bob/city:paris/ account:active to see the params in your controller pr($this->params) p.s. It is almost always a bad idea to use requestAction() ;) On Jan 14, 9:55 am, Mario Cesar

Re: Tabs in Layout... Help Please.

2009-01-14 Thread nurvzy
A That's mighty clever too Martin, thanks for sharing. I have a static menu but I like the idea of not having to pass anything to the view and the layout figuring out where it is on its own. My problem is I'm using the same pages controller to display 3 of my 6 tabs with static content, so t

parameters with /

2009-01-14 Thread Mario Cesar
hi! i have parameters with / ex '2008/2,' '2008/1' but the cake read only 2008 how can i pass the /??? i'm using $turma = 'qqq/w'; $this->requestAction("/turmasDisciplinasHorarios/getDisciplinaTurma/ $turma/$filial/$disciplina"); someone can help me? --~--~-~--~~~---

Re: New Install Does Not Show Graphics

2009-01-14 Thread Unbenannt
You will probably have to add index.php to your DirectoryIndex configuration in httpd.conf. It will look something like the following DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml On Jan 14, 1:51 am, reidster wrote: >  I wa

passing parameters with /

2009-01-14 Thread Mario Cesar
hi!! I need pass paramters like 2008/1 2008/2 but the cake only read 2008 how can I pass parameters like that? tks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to

"Nr. Affected Errors" Message after installing Cakephp

2009-01-14 Thread dipeshsoftw...@gmail.com
Hi, I am new to cakephp work and after installing cakephp I do get a message Nr. ...Affected Errors for all my request. How can i disable/comment this message? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Validate date from model

2009-01-14 Thread Mike
Hi everyone, I'm a new user of CakePHP, I tried to do a validation and comparison between 2 dates, a start date and a end date, for calendar events purpose. I want to know how can I do to implement the validation between these 2 dates information just to validate that the end date must be greate

newer in cakephp

2009-01-14 Thread falcons
hello dear all i am going to start cake php ... any one give me any idea in detail . --~--~-~--~~~---~--~~ 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

Re: email component

2009-01-14 Thread bycho
When running the app in localhost, I use a simple way to see how the emails will look like. Try inserting this line: $this->Email->delivery = ife(Configure::read('debug') ==0,'mail','debug'); And after the send() call, include this line: $this->Session->setFlash(ife(Configure::read('debug')==0

Re: Liquidweb + Cakephp + cPanel problem

2009-01-14 Thread skitle
I also have a VPS with liquidweb and run numerous cakephp apps. I haven't had any of the issues you have described. I'm not going to be incredibly helpful, as I am not sure what you issue is, but my guess would be the location of the app, or a cookie naming issue?..dunno. sorry. Just wanted to let

Calendar Helper

2009-01-14 Thread Mike
Hi everyone, I was wondering if there is a good up to date calendar helper that I can use to integrate to my intranet application ? Thanks for help --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. T

"select from" error

2009-01-14 Thread Signified
Dear group Whenever I save data with the string "select from" in it anywhere, I get a 403 forbidden error. This only occurs on the remote host (linux), not on localhost (windows). My client tried to enter text like "select from the following list of ...". Strangely enough, I can enter "delete f

Re: swiftmailer wont send

2009-01-14 Thread Smelly_Eddie
WOW Knock it off. Posting duplicate threads and repeated messages will not get you help any faster. On Jan 13, 3:22 am, ksalling wrote: > I am using this: > > $this->Swiftmailer->smtpType = 'tls'; > $this->Swiftmailer->smtpHost = 'smtp.gmail.com'; > $this->Swiftmailer->smtpPort = 465; > $

Re: quick table functions

2009-01-14 Thread Smelly_Eddie
I think in the same amount of time you could have searched the cake manual on any one of those keywords and found your answer. Don't be lazy. On Jan 13, 7:38 am, forrestgump wrote: > Hey, > Does anyone know how to sort a table based on any collumn a user has > selected and also paginate that ta

Re: Updating AROS for USER when changing the User Group.

2009-01-14 Thread Alexandru Ciobanu
sijo jose wrote: > Hi all, > > I have been stuck at two places. > > 1. This is regarding User and his corresponding. > Actually I have a User who is assigned a Group 'xx' while he is > created. But at a later stage I would like to regroup him to a Group > 'yy'. Simply changing the User group

Re: How does Cake populate $this->data with a submitted form's $_POST variables?

2009-01-14 Thread Martin Westin
In that case it sounds to me like the problem might be in the javascript, not on the server-side. It is at least not a general bug in CakePHP (for example I have several forms submitted over and over via ajax working fine). Are you sure that when you go from "index" to "add" in your modal that it

Re: How does Cake populate $this->data with a submitted form's $_POST variables?

2009-01-14 Thread WebbedIT
Arggh ... same problem when using redirect! 1. Open my modal window which runs 'index' action 2. Click on 'Add' link which runs 'add' action and displays the form 3. Fill in and submit the form which runs 'add' action, saves the data and redirects to 'index' action 4. Click on 'Add' link which

Re: How does Cake populate $this->data with a submitted form's $_POST variables?

2009-01-14 Thread WebbedIT
Arggh ... same problem when using redirect! 1. Open my modal window which runs 'index' action 2. Click on 'Add' link which runs 'add' action and displays the form 3. Fill in and submit the form which runs 'add' action, saves the data and redirects to 'index' action 4. Click on 'Add' link which

Filtering by paths.

2009-01-14 Thread atlantageek
Is there a method to filter access to certain web pages in a cake application using apache. --~--~-~--~~~---~--~~ 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.c

Re: How does Cake populate $this->data with a submitted form's $_POST variables?

2009-01-14 Thread WebbedIT
Martin, Looks like I've been banging my head against a brick wall for nothing! Your advice to simply use redirect(), and my semi belief that I couldn't, made me search the group for 'ajax redirect' and I came across the following post http://groups.google.com/group/cake-php/browse_thread/thread

Re: How does Cake populate $this->data with a submitted form's $_POST variables?

2009-01-14 Thread WebbedIT
Thanks for your reply Martin, but a redirect() would create a new http request (loading a whole new page) rather than an ajax call to update the content within my modal window. On normal pages I do use redirect () after a successful form post, it's just when working with ajax calls that I need to

Where should afterFind be documented?

2009-01-14 Thread Martin Westin
Hi, I have not been able to find a detailed documentation of Model::afterFInd() and I was wondering where such documentation belongs? What's missing? afterFind will get data in a number of ways under when primary is not set. I have hopefully found all variations by now but I can't be 100% sure. D

Re: How does Cake populate $this->data with a submitted form's $_POST variables?

2009-01-14 Thread Martin Westin
As I understand it, setAction() is used specifically to keep any data (you stay in the same request). To redirect to the index action you should try redirect() which creates a whole new request and any data will be "lost" unless it is session data, of-course. Try that, hopefully things should wor

Re: Who uses Cake + jQuery ajax

2009-01-14 Thread Martin Westin
Yes As far I remember the controller sees nothing different from a normal POST. Just do this and you will be golden: if ( $this->RequestHandler->isAjax() ) { // don't render the full layout } On Jan 14, 11:05 am, Miles J wrote: > Thank you, was the perfect answer. > > Also now on the aja

How to load HABTM Joining model in a plugin?

2009-01-14 Thread Martin Westin
Hi everyone, This is the first time I have tried to make a real model for a joining table and I got really stuck on this seemingly simple thing. I just cant get it to work. Does anyone know how this file should be named? I have a HABTM association between two models in a plugin. I have now creat

Re: cakephp shop

2009-01-14 Thread luke BAKING barker
bakesale is great. 1.2 version is more recently developed than 8 months, for sure! Google a bit more. Matti Putkonen is the developer. If you cannot find the SVN release he will put you in the right direction. Luke On Jan 13, 8:30 pm, Miles J wrote: > Building the products and listings should

Re: Problem on save operation

2009-01-14 Thread marco.rizze...@gmail.com
With this the problem seems solved but if I make a pr($this->data); inside beforeSave I get the same wrong behavior and infact then I save the wrong data. On Jan 14, 11:18 am, grigri wrote: > Do you have $cacheQueries set to true in the model? This would cause > this behavior. > > Try adding `va

Re: gzip compression with Cakephp

2009-01-14 Thread the_woodsman
As for testing, download Firebug + Yslow, for Firefox... On Jan 14, 7:50 am, keymaster wrote: > Add this to your appController: > > if (Configure::read('debug') == 0){ >                         @ob_start ('ob_gzhandler'); >                         header('Content-type: text/html; charset: UTF-

How does Cake populate $this->data with a submitted form's $_POST variables?

2009-01-14 Thread WebbedIT
I ask this as I am using multiple Ajax calls, including form submission, in a modal window so I am not reloading the whole page after a form is posted. The problem I face is after I add/edit a record and redisplay the index view (using $this->setAction() to re-route to index action), when I acces

Updating AROS for USER when changing the User Group.

2009-01-14 Thread sijo jose
Hi all, I have been stuck at two places. 1. This is regarding User and his corresponding. Actually I have a User who is assigned a Group 'xx' while he is created. But at a later stage I would like to regroup him to a Group 'yy'. Simply changing the User group is not working sice I think the c

Not repeating view code for multiple items on their index page and on view pages of items they belongo.

2009-01-14 Thread die...@be
Hi fellow bakers, long time no see. I have this issue: Customer hasmany users, user belongsto customer. Now, in the customerscontroller's index action I can set $this- >Customer->recursive = 1; If I then generate the views for customer, I nicely see the associated users when viewing a customer. B

Re: Tabs in Layout... Help Please.

2009-01-14 Thread Martin Westin
One technique I have used where I want it to be as automatic as possible (but possibly not compatible with any routing scenario) is this: My main menu consists of either plugins or controllers (some of each kind.) So I use this to figure out what the current plugin or top- level controller is: -

Re: Problem on save operation

2009-01-14 Thread grigri
Do you have $cacheQueries set to true in the model? This would cause this behavior. Try adding `var $cacheQueries = false` in your model definition. hth grigri On Jan 14, 8:53 am, "marco.rizze...@gmail.com" wrote: > I paste my code: > > function edit($id=-1) > { >    pr($this->data); // Origin

Re: Who uses Cake + jQuery ajax

2009-01-14 Thread Miles J
Thank you, was the perfect answer. Also now on the ajax controller side, does the post show up in $this- >data? Im assuming yes. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group,

Re: Problem on save operation

2009-01-14 Thread Miles J
Can you paste your whole action? Still a bit lost what the problem is. --~--~-~--~~~---~--~~ 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 fro

Re: BeforeSave and undefined index

2009-01-14 Thread Kanten
Well, that was a really embarressing error. Especially considering I used 1 hour trying to debug it. Thank you very much! /Anders On Jan 13, 6:01 pm, grigri wrote: > You wrote this: > >                $this->data['ArvcProfile']['minor_criteria'] == $minor; >                 $this->data['ArvcPro

Re: Who uses Cake + jQuery ajax

2009-01-14 Thread Martin Westin
Hi Miles, I like to use "REST light" :) That is: I make sure any data push, modification and similar actions are POST and any data retrieval is GET. create, update, delete = POST find, list, get, show... = GET It makes is a bit cleaner in my head. I do this for non-ajax calls and ajax calls al

Re: Problem on save operation

2009-01-14 Thread marco.rizze...@gmail.com
I paste my code: function edit($id=-1) { pr($this->data); // Original Passed Data .. $object=$this->Document->read(null,$id); . pr($this->data); // Data after read operation . } The original passed data is correct . (Example : $data['Document'] ['title']='edite