Re: search some duplicate data befor save data problem

2010-08-05 Thread gimmebucks
why not separate it to 2 model and set hasMany relationship. it will be more easier. On Aug 5, 3:19 pm, hoss7 wrote: > i have this array: > > Array > ( >     [Usercat] => Array >         ( >             [subcat_id] => Array >                 ( >                     [0] => 3 >                    

Re: bug with HTML entity encoding of attribute of form elements

2010-08-05 Thread Dan Heberden
Does changing your quote pattern help? echo $this->Form->select('field', array( '1' => '' , '2' => '' ), null, array('onChange' => 'function(\"yyy\")')); \" (because php isn't escaping it) will get sent to the output, which _should_ render onclick="funct

Re: How to use SEO urls in CakePHP without the ID?

2010-08-05 Thread bradmaxs
Hi Cricket, Thanks for the reply about the behavior being compatible with 1.3. It sure is and what a great behavior it is. I got it up and running in under 5 minutes with NO hassle. Something that happens almost never for me:) Brad On Jul 14, 9:12 am, cricket wrote: > On Wed, Jul 14, 2010

bug with HTML entity encoding of attribute of form elements

2010-08-05 Thread drbuzasi
If a button is needed that is labeled as '' and has an 'onClick' attribute with some javascript containing a text parameter the code can't be created since when 'escape' is set to false in options (button default) the script is OK but buttons label will not be encoded. Setting 'escape' to true HTML

Re: W3C Validation

2010-08-05 Thread Miles J
is being deprecated (I believe), you should probably just remove it and use alternatives. On Aug 4, 9:06 pm, Jamie wrote: > At the risk of sounding cheeky: "fix" it by ignoring it. It's not the > end of the world. It's an invalid tag as far as the (X)HTML standard > is concerned. The only way to

Re: including php files in my view

2010-08-05 Thread Miles J
You use ajax, the controller and return an HTML response. http://milesj.me/blog/read/62/Doing-AJAX-Calls-In-CakePHP-Part-1-_-The-Front_end http://milesj.me/blog/read/63/Doing-AJAX-Calls-In-CakePHP-Part-2-_-The-Controller http://milesj.me/blog/read/64/Doing-AJAX-Calls-In-CakePHP-Part-3-_-The-JSON-R

Re: Using test cases with model relationships throws error

2010-08-05 Thread jharris
My best guess, without seeing your test case or fixtures, is that you need to add the fixture to your $fixtures var in your test case. i.e., class MenuItemTestCase extends CakeTestCase { var $fixtures = array('app.menu_item', 'app.alias'); } After doing that, they should load into the test DB.

Re: Operation syntax

2010-08-05 Thread jharris
The technical term, in case you're interested, is called a ternary operator. http://php.net/manual/en/language.operators.comparison.php On Aug 5, 12:30 pm, "Dave Maharaj" wrote: > Can someone explain what the "?" and the ":" mean? > > return ($this->meta['head_title'] ? $this->meta['page_header

Re: index back to page 1 after edition of a record in page N

2010-08-05 Thread euromark
you could save all pagination params to the session and retrieve them from there if not present On 5 Aug., 16:39, Charles Bueche wrote: >  Hi, > > I have a standard baked index view, with the paginator function. My > problem : if a user goes to page N (N>1), edit a record, and press > , the index

Re: Operation syntax

2010-08-05 Thread Tilen Majerle
this is shorten if clouse so if (!empty($lol)) print $lol; else //do something else... in shorten will be this: print (!empty($lol) ? $lol : NULL); -- LP, Tilen Majerle http://majerle.eu 2010/8/5 Dave Maharaj > Can someone explain what the “?” and the ”:” mean? > > > > return ($this

Operation syntax

2010-08-05 Thread Dave Maharaj
Can someone explain what the "?" and the ":" mean? return ($this->meta['head_title'] ? $this->meta['page_header'] : NULL); Does it mean return $this->meta['head_title'] IF $this->meta['page_header'] IS NULL / NOT SET? I googled it and looked thru php code but cannot seem to find an expla

Re: URL shortener - any way to not redirect but display specific page?

2010-08-05 Thread spheroid
Awesome, thanks a million for a thorough explanation. I will try this out On Aug 4, 11:47 am, cricket wrote: > On Wed, Aug 4, 2010 at 12:38 PM, spheroid wrote: > > Thanks, but how would it know what to render? Example, if the page > > needs to show blog article #23, effectively I need to pas

Re: sending multiple email

2010-08-05 Thread LunarDraco
This is a working solution, however you will eventually run into problems with this solution. The first may be browser timeout. Many ISP's have limits on how many emails per hour, and how much data per hour can be sent out before you are black listed. Whats missing from your solution is called thr

Re: Sending StatusMails by CronJob - what is the right approach?

2010-08-05 Thread LunarDraco
This is exactly how my app works. I can as an auth admin via the browser hit my controller action to send out notifications. The same Controller action can be called from the shell in interactive mode in which it outputs info about what emails were sent. The same Controller action can be called fro

including php files in my view

2010-08-05 Thread Tomfox Wiranata
hi, i found this great artice about refreshing DIVs http://designgala.com/how-to-refresh-div-using-jquery/ well that is just fine, but how do i inlcude the file reload.php shown in this line?? $('#loaddiv').fadeOut('slow').load('reload.php').fadeIn("slow"); is there a specific directory in cak

Re: Model cusstom name

2010-08-05 Thread safipeti
Hi! You can name your model whatever that fit your needs: Форма, but, I have not tested with cirillic letters. Forma->whateverVariable or $this->Forma->whateverMethod() should work fine On Aug 5, 3:39 pm, baur79 wrote: > Hi, > > i need to use LOCALE name for model in view > is it possable to

search some duplicate data befor save data problem

2010-08-05 Thread hoss7
i have this array: Array ( [Usercat] => Array ( [subcat_id] => Array ( [0] => 3 [1] => 1 ) [user_id] => 2 [group_id] => 5 ) ) i want befor save data in usercat table,

Re: Table naming creating a Bake problem..

2010-08-05 Thread safipeti
Hi! You have a table businesses and you would like to create business_customers. Cake, by convention, thinks that business_customers is a join table for business and, you guess, customers, and looking for customers and ends with an error because cannot find it. On Aug 4, 10:52 pm, Staple wrote:

index back to page 1 after edition of a record in page N

2010-08-05 Thread Charles Bueche
Hi, I have a standard baked index view, with the paginator function. My problem : if a user goes to page N (N>1), edit a record, and press , the index is back at page 1. Is there a way to come back to the page N after the save ? TIA, Charles Check out the new CakePHP Questions site http://cakeq

Re: some phone validation rule problem

2010-08-05 Thread Dan Heberden
This was answered via email, but aparently google didn't get it in the group so: If the table is set to a numeric field (tinyint, smallint, int, bigint) it will parse out the leading zero - the best would be a varchar for how many characters you need. e.g. if you're storing your numbers as 09+124-

Re: SaveAll not saving multiple model data when first oine is blank!

2010-08-05 Thread AmityWeb
I have concluded SaveAll does not work if you have multiple hasMany models and the first one (maybe others?) has no data. I have tried many, many things and it just does not save the data. So I have resorted to normal save() for the main model then individual saves for each hasMany model using the

Model cusstom name

2010-08-05 Thread baur79
Hi, i need to use LOCALE name for model in view is it possable to find solution like this and use in view echo $this->Officialform->customname or it better to write custom user function for model, best regards Baurzhan Kazakhstan / Shymkent city Check out the new CakePHP Questions site http

Re: handling of [tmp_name] with Images

2010-08-05 Thread Tomfox Wiranata
ok got this one with luck... turned out the tmp-file is created during the acutal uploading process...so when i execute the second process the tmp-file will not be there...i made a workaround so this problem is solved :) Check out the new CakePHP Questions site http://cakeqs.org and help oth

SaveAll not saving multiple model data when first oine is blank!

2010-08-05 Thread Affinity
Hi I am completely confused... I have several hasMany relationships in a model. I have a page that allows the user to add multiple rows of data to each of these hasMany tables. If the first hasMany data is entered, then any subsequent data is saved using SaveAll too. BUT if the first hasMany data

Re: Data Modelling Challenge

2010-08-05 Thread cricket
On Thu, Aug 5, 2010 at 6:19 AM, keymaster wrote: > The context is a standard ecommerce platform. > > A Country hasMany States. > Some Countries have no States. > A Region can be made up of either: > 1. entire Countries, or > 2. States within a Country. I suggest you use only the 2nd definition. I

Re: 1:n association: how to insert foreign key???

2010-08-05 Thread Mariano C.
I have resolved using select() instead of input(): echo $form->input('author_id', $authors); I'm using cake 1.3.3 and author array was a simple one-dimensional array. I've not idea about why that problem appears. Bug? On 5 Ago, 13:46, cricket wrote: > On Wed, Aug 4, 2010 at 3:26 PM, Mariano C.

Re: 1:n association: how to insert foreign key???

2010-08-05 Thread cricket
On Wed, Aug 4, 2010 at 3:26 PM, Mariano C. wrote: > Alas. nothing change, valid author_id value is still inside array. > > Analyzing authors select form appear like: > > > if I remove last [] on the fly(with Firebug), the insert happen > without problem cause (I suppose) author_id is no more >  [

how to handle acl for host without shell connection

2010-08-05 Thread Mariano C.
There's a tutorial to realize a very simple authentication control with acl and without possibility for shell connection? I need a very simple system Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because

Re: Data Modelling Challenge

2010-08-05 Thread Graham Weldon
Sounds like you need to simplify. Everything there is a region, and a region would have a type. A region can belong to another region through a child-parent relationship. Country is a Region State is a Region Region is a Region So: Region - id - parent_id - type - name This will allow you to mo

Data Modelling Challenge

2010-08-05 Thread keymaster
The context is a standard ecommerce platform. A Country hasMany States. Some Countries have no States. A Region can be made up of either: 1. entire Countries, or 2. States within a Country. The following Data Model does not work: Region HABTM Country hasMany State ... because there are Countrie

handling of [tmp_name] with Images

2010-08-05 Thread Tomfox Wiranata
hi, this is what happens. a user can upload a picture during an editing process, this is supposed to be a preview. then the image gets saved to a temp directory that is written in the image array, with the attribute [tmp_name]. the dir in there is ...xampp/tmp/file.tmp...this process happens with

Re: how can I check if form button is pressed?

2010-08-05 Thread Tomfox Wiranata
oki...got it :) i named the buttton and checked for params forms nameofbutton thanx to you :) On 5 Aug., 09:40, Tomfox Wiranata wrote: > oh..if i name the button 'tut' > > then the array says: > > Array > { > [tut] => > > } > > On 5 Aug., 09:37, Tomfox Wiranata wrote: > > > first of all thx to

Configuration in David Persson MediaPlugin in cake 1.3

2010-08-05 Thread marco.rizze...@gmail.com
I'm using David Persson MediaPlugin. With the version relative to cake 1.2 all works fine.Now I'm upgrading my web application to cake 1.3 so I try to use the Media Plugin version relative to cakephp 1.3. I have some problem with the use of callback "transferTo" instead of 'destinationFile' config

Re: how can I check if form button is pressed?

2010-08-05 Thread Tomfox Wiranata
oh..if i name the button 'tut' then the array says: Array { [tut] => } On 5 Aug., 09:37, Tomfox Wiranata wrote: > first of all thx to both of you. i appreciate it. > > @Dan: > > cake outputs: > > no characters in the first row (i guess thats for this.>data??) and > then: > > Array > { > > } > >

Re: how can I check if form button is pressed?

2010-08-05 Thread Tomfox Wiranata
first of all thx to both of you. i appreciate it. @Dan: cake outputs: no characters in the first row (i guess thats for this.>data??) and then: Array { } @sunsu did not work^^although it makes sense..even to me lol On 4 Aug., 16:00, sunsu sunsu wrote: > hi, > give the submit button a n