How to edit files with form helper in CakePHP?

2010-09-20 Thread mpeshev
Hello, I'm using the form helper to generate my forms. I've added a multipart form with a file field which I add successfully. The problem is: how to edit the model with file existing? I use the standard file upload functionality from here:

Execute Linux commands from controller

2010-09-20 Thread Urs
Hi.. How can we execute linux commands from the controller? like: Example1: cat file1.txt Example2: ifconfig | grep eth | awk {'print $1'} Plz help.. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message

Re: Execute Linux commands from controller

2010-09-20 Thread Andrei Mita
I don't know if CakePHP has something special in place for executing commands but exec and passthru will definitely work: http://www.php.net/manual/en/ref.exec.php On Mon, Sep 20, 2010 at 1:10 PM, Urs ajnur...@gmail.com wrote: Hi.. How can we execute linux commands from the controller?

PHP Errors are not printed to screen

2010-09-20 Thread psybear83
Hi everybody I'm still fighting with a CakePHP application I've overtaken from somebody else, and it's a bit a mess. One thing I still couldn't figure out is why PHP Errors aren't printed to screen in my application. I've set define('LOG_ERROR', 2); Configure::write('debug', 2); in core.php,

Re: PHP Errors are not printed to screen

2010-09-20 Thread Jeremy Burns | Class Outfit
Do you have the Security component enabled (look in app_controller.php). If you do, uncomment it and try again. Also, clear your cache files (/app/tmp/cache/models persistent). Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 20 Sep 2010, at 12:17,

Re: PHP Errors are not printed to screen

2010-09-20 Thread Joshua Muheim
The security component was disabled (within /* ... */); I uncommented it, but nothing changed. In my cache folder there's no such folders like models or persistent. I created them. Nothing changed... Thanks though! Any other idea? On Mon, Sep 20, 2010 at 1:21 PM, Jeremy Burns | Class Outfit

Re: Multi-table search

2010-09-20 Thread Jon Bennett
Create a view or a stored procedure in your database and call it instead of using find. Or write it as plain old SQL in a custom model function, nothing forcing you to use cake's ORM. j -- jon bennett - www.jben.net - blog.jben.net Check out the new CakePHP Questions site

Re: Multi-table search

2010-09-20 Thread Andrei Mita
If you do run a plain SQL query be sure to properly escape your data first. On Mon, Sep 20, 2010 at 4:29 PM, Jon Bennett jmbenn...@gmail.com wrote: Create a view or a stored procedure in your database and call it instead of using find. Or write it as plain old SQL in a custom model

Re: PHP Errors are not printed to screen

2010-09-20 Thread Joshua Muheim
Nobody got another idea? This issue really blocks me from productively writing code... On Mon, Sep 20, 2010 at 1:41 PM, Joshua Muheim psybea...@gmail.com wrote: The security component was disabled (within /* ... */); I uncommented it, but nothing changed. In my cache folder there's no such

Re: PHP Errors are not printed to screen

2010-09-20 Thread Jeremy Burns | Class Outfit
Are you actually debugging errors out? What happens if you do die(debug($someVariable)); Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 20 Sep 2010, at 16:16, Joshua Muheim wrote: Nobody got another idea? This issue really blocks me from productively

Re: Less verbose usage of HtmlHelper?

2010-09-20 Thread Evan R. Murphy
My three reasons are less characters (- file size)... To be sure, seeking fewer characters was the impetus for my original post. I wanted to eliminate the $html- boilerplate from all my calls to HtmlHelper. div('foo', 'bar') is shorter than div class=foobar/div. :) The HTML filesize is equal or

Re: Less verbose usage of HtmlHelper?

2010-09-20 Thread Miles J
Ok but what if you needed to add more attributes besides the id? Also what would you do when you need to echo PHP variables and loops within a div? On Sep 20, 9:38 am, Evan R. Murphy evanrmur...@gmail.com wrote: My three reasons are less characters (- file size)... To be sure, seeking fewer

Re: PHP Errors are not printed to screen

2010-09-20 Thread Miles J
Is this localhost or on a server? Check your php.ini to see if error reporting is being turned on. On Sep 20, 8:25 am, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Are you actually debugging errors out? What happens if you do die(debug($someVariable)); Jeremy Burns Class

Re: How to edit files with form helper in CakePHP?

2010-09-20 Thread Miles J
The form helper does not handle this functionality. The form helper merely creates the input fields in the HTML and pre-populates it with data set within the controller. It should be pretty easy. When editing, in the view just check if the image path is set and then display it. ?php if

Re: Less verbose usage of HtmlHelper?

2010-09-20 Thread Evan R. Murphy
On Sep 20, 12:01 pm, Miles J mileswjohn...@gmail.com wrote: Ok but what if you needed to add more attributes besides the id? One example would be: div('foo', 'bar', aa('style', 'float:left')) Also what would you do when you need to echo PHP variables and loops within a div? Your point

Re: Less verbose usage of HtmlHelper?

2010-09-20 Thread Evan R. Murphy
Sorry, that last example should have read: echo div('foo', (function () { $acc = ''; foreach(...) $acc .= ...; return $acc; })()); On Sep 20, 12:18 pm, Evan R. Murphy evanrmur...@gmail.com wrote: On Sep 20, 12:01 pm, Miles J mileswjohn...@gmail.com

Prevent Ajax duplicate Submissions

2010-09-20 Thread Dave Maharaj
I have googled and tried various bind unbind with no success. (Ajax Submitted form) e.preventDefault(); Sure all that's is good stuff but something simple like isSubmitted = false; submit form isSubmitted = true; then while waiting for response if pressed again do nothing if

memcache and counterCache

2010-09-20 Thread Jeremy Burns
I have moved some code to a production environment. One model is using counterCache. When I turn on Memcache the counterCache doesn't work. If I change it to File caching, it works again. Has anyone experienced anything like this? Are there settings I should be aware of? Check out the new

RE: Prevent Ajax duplicate Submissions - Current Script

2010-09-20 Thread Dave Maharaj
This is my rough js Click submit nothing, click again it submits, click again it submits twice, again submits 3 times…you get the picture. And while its sent to the server you can continue to click away adding to the requests in multiples. Anyone see where I am going wrong here? script

Re: cakephp editor

2010-09-20 Thread cricket
On Sun, Sep 19, 2010 at 1:41 PM, nurvzy nur...@gmail.com wrote: I use and enjoy jedit. Multiplatform, tons of plugins, full IDE with just a handfull of plugins or keep it streamlined.  It takes a little settup, but ill never go back to anything else. I've been using jedit also, on linux Mac,

Re: New with CakePHP, problem with docs and options parameters

2010-09-20 Thread laduree
Thanks a lot for taking the time to answer! And, let me apologize for the delay, I was in a rural area where the Internet costs per byte. I wasn't really looking at any particular class, just reading the documentation to learn about the cakephp framework. What you tell me is a bit disappointing.

Re: cakephp editor

2010-09-20 Thread mufti ali
I use aptana. Aptana is free and is the best for me :D Mufti, http://blogfreakz.com http://webdev5.com On Tue, Sep 21, 2010 at 12:51 AM, cricket zijn.digi...@gmail.com wrote: On Sun, Sep 19, 2010 at 1:41 PM, nurvzy nur...@gmail.com wrote: I use and enjoy jedit. Multiplatform, tons of

Re: cakephp editor

2010-09-20 Thread Miles J
Use Netbeans (PHP not Java) for windows. On Sep 20, 10:51 am, cricket zijn.digi...@gmail.com wrote: On Sun, Sep 19, 2010 at 1:41 PM, nurvzy nur...@gmail.com wrote: I use and enjoy jedit. Multiplatform, tons of plugins, full IDE with just a handfull of plugins or keep it streamlined.  It

Re: PHP Errors are not printed to screen

2010-09-20 Thread cricket
On Mon, Sep 20, 2010 at 7:41 AM, Joshua Muheim psybea...@gmail.com wrote: The security component was disabled (within /* ... */); I uncommented it, but nothing changed. In my cache folder there's no such folders like models or persistent. I created them. Nothing changed... What do you have

Re: Prevent Ajax duplicate Submissions - Current Script

2010-09-20 Thread cricket
On Mon, Sep 20, 2010 at 1:49 PM, Dave Maharaj m...@davemaharaj.com wrote: This is my rough js Click submit nothing, click again it submits, click again it submits twice, again submits 3 times…you get the picture. And while its sent to the server you can continue to click away adding to the

Finding records with linked data

2010-09-20 Thread Chuck
I have ZipCode hasMany Post and am trying to construct a find within the ZipCode model that will show me all of the ZipCodes that have a linked Post. The SQL query I'm eventually trying to duplicate is: SELECT zip_codes.city, states.state, COUNT( * ) AS city_count FROM zip_codes, states, posts

Re: cakephp editor

2010-09-20 Thread Zaky Katalan-Ezra
Netbeans for Linux also. Code completion is much better then eclipse 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 this group,

Re: PayPal Payments Pro Component Help

2010-09-20 Thread bradmaxs
Thanks @euromark, I tried your solution today and Viola - it worked. Now just some configuration of my cart and I am ready to go. Thank you for pointing me there! Brad On Sep 19, 8:02 am, euromark dereurom...@googlemail.com wrote: its quite old maybe something changed in the api? this

Models problem

2010-09-20 Thread newbie
Hi. I was trying to debug an issue where whenever I perform $this- ModelName-Validates(), it always returns true. However, I discovered that if I deleted all the files in the Model folder, I didn't get any errors. I was able to save queries to the database, regardless. What is wrong? Is this

Re: cakephp editor

2010-09-20 Thread John L
Has anyone tried CodeLobster for PHP which has a CakePHP plugin? I am new to CakePHP also and am curious if this is a good IDE to use. On Sun, Sep 19, 2010 at 10:44 AM, dhiraj ray dhiraj.r...@gmail.com wrote: i'm new in cake php. i want to know which editor is better for devlop cakephp sites.

seo, index.php and rewrite

2010-09-20 Thread pastomano
Hello, Using Google Webmaster tools I spotted something that causes another problem called duplicated content. With my app written in Cake I use seo friendly urls, but google has also indexed index.php?url=seo/friendly/url . Using .htaccess I'm trying to make 301 redirect all index.php?url=ex/

Simple Acl controlled Application

2010-09-20 Thread AGB
I'm new to cakephp and have set up the 'Simple Acl controlled Application' successfully, but I was a bit concerned about the way AuthComponent works went it stores passwords. I found that if the same password is used for different logins then the value stored is the same, which allows anyone with

Re: Execute Linux commands from controller

2010-09-20 Thread skimmas
I think that what you are looking for is the php command exec() http://php.net/manual/en/function.exec.php On Sep 20, 11:10 am, Urs ajnur...@gmail.com wrote: Hi.. How can we execute linux commands from the controller? like: Example1: cat file1.txt Example2: ifconfig | grep eth | awk

l10n.php, request to add mongolian language

2010-09-20 Thread Nandinbaatar Nabar Tsog
Hi, In cake/libs/l10n.php, mongolian language does not exist. Could you add mongolian language. nabar 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

Ignoring non-existent fields in queries

2010-09-20 Thread baskerville
Hello from a newbie to this group. As far as I can see, CakePHP automagically ignores non-existent fields when building a query. However, there is a problem when the query uses more than one table. Let me explain: In my project, a result list of Acts can be sorted by a number of different fields

records will possibly be overridden if not checked

2010-09-20 Thread rethab
hi there I have the following (simplified) scenario: A usual form to add a post (from the blog tutorial). If the form is submitted, this method is called inside the action: $this-Post-save($this-data); I also have some validation stuff inside the post model (title, body). Now I know, anybody can

SQL executed behind CakePHP without joins

2010-09-20 Thread paulocl
I using a CakePHP with a database like this: Estudant | Test | Question I create the three models. When I execute a find('all', array(recursive = 3)) the sql select executed in database not uses any join. First is executed select (fields) from estudants, then is executed one select (fields)

Re: Models problem

2010-09-20 Thread Tilen Majerle
emm...before u call $this-ModelName-validates() you need to set the data for validation...so do something like this: {{{ $this-ModelName-set($this-data); $validate = $this-ModelName-validates(); //will return true or false }}} and if u have something like that with associated models

Re: SQL executed behind CakePHP without joins

2010-09-20 Thread cricket
On Mon, Sep 20, 2010 at 1:25 PM, paulocl paul...@gmail.com wrote: I using a CakePHP with a database like this: Estudant  | Test  | Question I create the three models. When I execute a find('all', array(recursive = 3)) the sql select executed in database not uses any join. First is

Re: cakephp editor

2010-09-20 Thread j.blotus
Using netbeans for windows and for linux (sharing folder as virtual machine). Code completion, and code auto formatting is awesome, it's free, and frankly I found it to work better than many IDE's I have tried. On Sep 19, 10:44 am, dhiraj ray dhiraj.r...@gmail.com wrote: i'm new in cake php. i

Re: memcache and counterCache

2010-09-20 Thread j.blotus
You need to clear your cache. This happens to me sometimes because cake stores model schema and some other core info as files. Try setting up a convenience function like this: function clearCache() { //prevent a view from being shown during this operation $this-autoRender =

Re: records will possibly be overridden if not checked

2010-09-20 Thread euromark
you shouldnt use the cake default templates they are in no way prepared for the real world modify them in order to protect your data in your case you retrieve the data first in the edit action and right before save() you check the passed id against the real one from the record if they dont match,

Re: How to use CURRENT_TIMESTAMP in find conditions array

2010-09-20 Thread Andy Dirnberger
Did you try array(..., 'ClubsPlayer.start_datetime = CURRENT_TIMESTAMP')? On Sep 19, 5:38 pm, DerBjörn b.unkh...@googlemail.com wrote: Hi Zaky, yes with time() it works like that: ClubsPlayer.start_datetime =' = date('Y-m-d H:i:s', time()) but i thought there is a easilier way :) Thanks

Paginate Model by Tag?

2010-09-20 Thread Dave Maharaj
I have my Property Model which HABTM Amenities (pool, school, shopping mall..so on) I would like to click on Pools and then paginate all Properties with Pool tag. Any ideas where to get started? My Property Model is already paginated with options of property type (rental, sale, lease) so I am

Re: cakephp editor

2010-09-20 Thread Cruisine
i couldn't found the right serial for codelobster for PHP..do u have any guys?tq. On Sep 19, 9:53 pm, John L confidentia...@gmail.com wrote: Has anyone tried CodeLobster for PHP which has a CakePHP plugin? I am new to CakePHP also and am curious if this is a good IDE to use. On Sun, Sep 19,

How to Create and use dummy table in cakephp

2010-09-20 Thread rakeshyadav rakeshyadav
Hi All, In my application i am trying to use one table it is dummy table dynamicaly created by me and push some data and do some operations in that and finely i want to delete that table form database.Here i dont have chance to create modal for that table below i will give u php

Re: memcache and counterCache

2010-09-20 Thread Jeremy Burns | Class Outfit
Thanks I tried that before posting. No joy. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 20 Sep 2010, at 21:16, j.blotus wrote: You need to clear your cache. This happens to me sometimes because cake stores model schema and some other core info as

Memcached not working on default settings

2010-09-20 Thread Miles J
I just installed memcache for one of my apps and attempted to configure Cake to use it. When I changed default from File to Memcache, everything missed. I went from 0 to 300+ misses per request. I tried both of the following configs with the same result. Cache::config('default', array('engine' =