Re: Can I run 2 versions of CakePHP within a single project

2010-07-02 Thread Louie Miranda
You mean, run parallel? different subdomain? or folder? I think, you could do that. Just check for syntax changes from 1.2 to 1.3 though. Goodluck -- Louie Miranda - Email: lmira...@gmail.com - Web: http://www.louiemiranda.com On Thu, Jul 1, 2010 at 11:21 PM, WebRia webriaconsult...@gmail.com

Re: Using Key Value pairs with Cake

2010-07-02 Thread Zaky Katalan-Ezra
Google for the database you want and cake for example mongodb cakephp *http://www.slideshare.net/ichikaway/phpstudytokyo-mongodb-php-cakephp* Never used it myself On Thu, Jul 1, 2010 at 6:24 PM, WebRia webriaconsult...@gmail.com wrote: I know Cake does some fantastic automagic as long as the

Re: Can I run 2 versions of CakePHP within a single project

2010-07-02 Thread Daniel S. Reichenbach
I was wondering if it was ever possible that we have the new version of cake running in a folder called cake-new' or something and selectively recode a few pages to run using cake 1.3 while the rest of the site continues to use cake 1.2.. Have you tried using something like git? You could create

Re: Can I run 2 versions of CakePHP within a single project

2010-07-02 Thread Zaky Katalan-Ezra
Maybe use the old version as plugin http://book.cakephp.org/view/114/Plugins Just an idea, never used it myself On Thu, Jul 1, 2010 at 6:21 PM, WebRia webriaconsult...@gmail.com wrote: Yeah I know this might sound weird, but the problem is, We built a really large site using Cake 1.2 Beta, and

Hide empty value in select box

2010-07-02 Thread sherzo
Hi all I have a selectbox like this $form-select('city_id',$city, array ('empty'=false, 'selected'='1', 'label'= false), array('label'=false, 'div'=false, 'name'='city_id', 'id'='city_id')); I need to remove the empty option at the top of my options. I even set the ''empty'=false' but it not

Re: Hide empty value in select box

2010-07-02 Thread Jeremy Burns | Class Outfit
A couple of thoughts... What is in the $city array? This will be used to populate the select list, so if there's an empty row there, you'll get an empty row in the list. Is there an option with an id of 1? If not, your default value might be messing things up a bit. Jeremy Burns Class Outfit

Re: Hide empty value in select box

2010-07-02 Thread Andrei Mita
can we see the option array? On Fri, Jul 2, 2010 at 10:28 AM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: A couple of thoughts... What is in the $city array? This will be used to populate the select list, so if there's an empty row there, you'll get an empty row in the

Re: Hide empty value in select box

2010-07-02 Thread sherzo
Hi Here is the content of my array Array ( [4] = Adana [2] = Ankara [1] = Istanbul [3] = Izmir ) its wired!!! when I use echo $form-select('city_id',$city, array ('empty'= false), false, false); it doesnt show the empty space but it sends the city_id value as undefined !!!

Re: Hide empty value in select box

2010-07-02 Thread Jeremy Burns | Class Outfit
The guide says: select(string $fieldName, array $options, mixed $selected, array $attributes) There are only four attributes and you have five. Try: $this-Form-select('city_id', $city, 1, array('empty' = true)); Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com

Re: Hide empty value in select box

2010-07-02 Thread sherzo
Hi Jeremy thanks for the reply i used $this-Form-select('city_id', $city, 1, array('empty' = false)); and the empty space is still there!!! i really need to remove that space from the form %-| Jeremy Burns | Class Outfit wrote: The guide says: select(string $fieldName, array

Re: Hide empty value in select box

2010-07-02 Thread Jeremy Burns | Class Outfit
Stumped. I just tried exactly the same code and it worked as necessary. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 2 Jul 2010, at 09:18, sherzo wrote: Hi Jeremy thanks for the reply i used $this-Form-select('city_id', $city, 1, array('empty'

Can I do a custom find then paginate?

2010-07-02 Thread Louie Miranda
Can I do a custom find (mysql full text search) then paginate? $this-Publication-recursive = 0; $params = array('conditions'=array( MATCH(Publication.ITEMCODE, Publication.ITEMKEYWORDS, Publication.DESCRIPTION) AGAINST ('Jazz') )); $results = $this-Publication-find('all', $params);

Re: Hide empty value in select box

2010-07-02 Thread sherzo
can you please try this? echo $form-select('city_id',$city, array ('empty'=false, 'selected'='1', 'label'= false), array('name'='city_id', 'id'='city_id')); this is the only way that I can have the city_id value after the form submission!! but still I have the empty space in the form !

Re: Hide empty value in select box

2010-07-02 Thread sherzo
I fixed it!!! its working under this condition- echo $form-select('city_id', $city, null, array('label'=false, 'div'=false,'name'='city_id', 'id'='city_id', 'empty'='false'),false); no space, and the values sends to the controller after the form submission Thanks Jeremy :) Jeremy Burns |

Re: Can I do a custom find then paginate?

2010-07-02 Thread Teh Treag
Louie, You can specify conditions for paginate as stated here in the manual: http://book.cakephp.org/view/165/Controller-Setup You should end up with something along the lines of this, http://bin.cakephp.org/view/1633497516 On Jul 2, 3:28 am, Louie Miranda lmira...@gmail.com wrote: Can I do a

MilesJ's Uploader plugin doesn't work with SecurityComponent

2010-07-02 Thread red
Hi, I'm using MilesJ's Uploader plugin [1][2] and it works very well. I'm using it as the behavior for model. Now I need to enable SecurityComponent, but uploading doesn't work any more. I'm getting error from Upload Behavior: There was an error attaching this file!. I've also set

Re: echoing data after retrieving it via find. cake doesn't echo the actual value, but rather array

2010-07-02 Thread Tomfox Wiranata
thanks guys..i will give it a shot On 1 Jul., 18:41, Renato de Freitas Freire renat...@gmail.com wrote: I dont know what version you are using... but in 1.2, i would do like this: $adressee = $this-User-find('first',array('conditions' = array('User.email' =$user,'fields' =

Re: MilesJ's Uploader plugin doesn't work with SecurityComponent

2010-07-02 Thread red
Ok, I've figured it out - Uploader won't work if there is multiple models in form (SecurityComponent adds hidden fields with _Token key, so it's treated as another model in data table). Quick fix in attachment.php file (from line 150): if (count($Model-data) == 1) { $fileToUpload =

Re: Undefined property: QuestionsController::$Session

2010-07-02 Thread mariusg
I think you need to include Session component in your app controller components array. On Jun 30, 11:59 pm, n4thancake hellbr...@gmail.com wrote: Hi to all, I'm newer to CakePHP and i'm reading this book 'packt publishing cakephp application development'. I'm running into a problem where my

making a layout with CSS in CakePHP

2010-07-02 Thread Tomfox Wiranata
hi, before i used cakephp i designed a layout with CSS naked (no framework, no CMS) to show a members profile. now, i am asking myself how to make this work in cakephp. this is what i got worked so far: i put all my divs containers into a view template: div class=frame div

Re: making a layout with CSS in CakePHP

2010-07-02 Thread Jeremy Burns | Class Outfit
Your css files go in /app/webroot/css/. You include them by putting echo $this-Html-css(array('filename')); in the head section of your layout. You do your data retrieval in the controller, although your function actually calls methods of the models, which do all of the database heavy lifting

Re: making a layout with CSS in CakePHP

2010-07-02 Thread Tomfox Wiranata
thanks a lot for the very quick answer...i'll give it a try :) On 2 Jul., 17:36, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Your css files go in /app/webroot/css/. You include them by putting echo $this-Html-css(array('filename')); in the head section of your layout. You

User HABTM User/Firend (Social Network )

2010-07-02 Thread Henrique Machado
I need a system that associate users from one single table making them friends. Until now, everything goes fine. The problem is when the user 1 is friend of user 2, cake don't understand that user 2 is friend of user 1 too. Is there a way to tell Cake to make a reverse query? Or I need to insert

Re: Need CSV import: best practices?

2010-07-02 Thread LunarDraco
I placed my csv import logic in my model and will probably move portions of it to a behavior as soon as I need to import more than the one type of model data. The reason for this is I needed to handle large record count imports where there was a substantial amount of related data in the imported

Re: User HABTM User/Firend (Social Network )

2010-07-02 Thread hugom
I insert 2 records, uid_1 and uid_2. It's probably a good way to do it. It's just an extra step when you do an insert and an extra step when you do a delete. On Jul 2, 1:51 pm, Henrique Machado henri@gmail.com wrote: I need a system that associate users from one single table making them

Re: MilesJ's Uploader plugin doesn't work with SecurityComponent

2010-07-02 Thread Miles J
Thanks, I will patch this :] On Jul 2, 7:09 am, red mbu...@gmail.com wrote: Ok, I've figured it out - Uploader won't work if there is multiple models in form (SecurityComponent adds hidden fields with _Token key, so it's treated as another model in data table). Quick fix in attachment.php

Re: MilesJ's Uploader plugin doesn't work with SecurityComponent

2010-07-02 Thread red
You're welcome. And also thanks :) On 2 Lip, 21:25, Miles J mileswjohn...@gmail.com wrote: Thanks, I will patch this :] On Jul 2, 7:09 am, red mbu...@gmail.com wrote: Ok, I've figured it out - Uploader won't work if there is multiple models in form (SecurityComponent adds hidden fields

Re: Large core.* files being generated in app/webroot

2010-07-02 Thread mofahead
Thanks. I'm not seeing anything strange in the logs . Aren't 50MB files a little large for php dump crash files? On Jun 29, 6:58 pm, Jonathon Musters luvz2...@gmail.com wrote: core.XXX are ussualy php dump crash files i would check your php error logs On Tue, Jun 29, 2010 at 7:13 PM,

How to implement helper fields in my model?

2010-07-02 Thread mofahead
Hi all, I'm fairly new to cakephp so forgive me if this question has an obvious answer. It seems like it must be a common problem but I can't seem to find any documentation for it. The gist of it is that I have a product model, and the product has length and width fields (number of inches,

Re: Large core.* files being generated in app/webroot

2010-07-02 Thread cricket
On Fri, Jul 2, 2010 at 6:40 PM, mofahead davebrowndes...@gmail.com wrote: Thanks. I'm not seeing anything strange in the logs . Aren't 50MB files a little large for php dump crash files? That depends on what PHP had read into memory. A core dump is, essentially, what the process had in

Including an External Library file that has functions that aren't in a class?

2010-07-02 Thread Rick Dane
I have a need to include certain library files from various php projects where it has a source file with the functions that are to be called not within classes... I have been reading on how to do this and have tried the method of placing the file in the vendor folder and including it through:

Re: working cakephp-filter-plugin for CakePHP 1.3 ?

2010-07-02 Thread Jose
Hello. I'm one of the developers of the Filter Plugin (the developer who unified all those hacks was one of my junior devs). An updated version is here (all versions work with CakePHP 1.3): http://github.com/josegonzalez/cakephp-filter-plugin ?php PostsController extends AppController { var

Re: User HABTM User/Firend (Social Network )

2010-07-02 Thread Rick Dane
Yeah just package it into a component so that doing the association both ways isn't a big deal On Jul 2, 12:02 pm, hugom ham1...@gmail.com wrote: I insert 2 records, uid_1 and uid_2. It's probably a good way to do it. It's just an extra step when you do an insert and an extra step when you

Re: How to implement helper fields in my model?

2010-07-02 Thread Rick Dane
Well, I think the validation part would go in a controller, so you would want to have the beforesave helper call a function in a controller, this could also call a component, if needed... I haven't done this myself but I think this is the correct procedure based on my understanding of cakephp