Re: Setting Up CakePHP on MAC with MAMP and Eclipse

2009-09-06 Thread Martin Westin
A few points for installing Cake to run in Mamp. Simplest way is to drop the whole Cake folder (containing cake,app,vendors...) into Mamp's htdocs folder. Should be: /Applications/MAMP/htdocs That should have Cake running but you probably need / want the database too, right. You need to rename a

Re: Can you paginate an array of data without going to the DB to find it?

2009-09-06 Thread DavidH
Yes I looked at the custom query pagination; but the reason that is no good is in the title 'query'. I'm not doing a query on a database I've already got my data set that I want to paginate. Well I guess the custom query pagination is the way to go in that I'll have to override the existing pagin

Re: Should id be hidden value?

2009-09-06 Thread Jamie
Well, are you just new to CakePHP, or PHP in general? Because remember that CakePHP is really just PHP. And just like with any PHP-driven webpage that uses database tables with unique IDs, you need to pass the ID in the form somehow. You just need to do some security/sanity checks when processing

Re: Using a Button to Submit an AJAX Form

2009-09-06 Thread Shaun
The solution is to use this: $form->button('Submit', array('type' => 'submit')); Not this: $form->button('Submit', array('onclick' => 'this.form.submit()')); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP

Re: Setting Up CakePHP on MAC with MAMP and Eclipse

2009-09-06 Thread FrederickD
Hey Kludge! Try going to www.widgetpress.com and checking out ModelBaker. It is a Mac front-end to CakePHP so that you never have to use the CLI. The product has a graphical representation of the database model you are creating for the project. ModelBaker is not an end-all solution. It is design

Re: How is the difference between Model::query() and Model::execute()?

2009-09-06 Thread Dr. Loboto
Cake 1.1 had 2 methods - query() for queries that return data (like SELECT) and execute() for those who don't (like UPDATE). In Cake 1.2 execute() method is deprecated and you should use query() for both types of custom queries. On Sep 5, 10:53 pm, cogitovn wrote: > I looked up in cakePHP Manual

Re: Query Help

2009-09-06 Thread Dr. Loboto
Looks like you just forgot enclose your custom sql into brackets. array( 'Post.status' => 0, 'Post.rank <=' => $rank, '('.$sql.')' ) On Sep 7, 1:56 am, "Dave Maharaj :: WidePixels.com" wrote: > For some reason this query is pulling more results then that which is > possible. > >

Re: Should id be hidden value?

2009-09-06 Thread Dr. Loboto
ID must be passed. It can be done through form hidden field or through URL. Choose your way. For security check passed id in controller. On Sep 6, 8:32 pm, thesti wrote: > hi, > > i'm learning CakePHP and i take the Blog tutorial. > > and as i came to the modifying a post part, it's written that

HttpSocket, Twitter Datasource, and an unexpected response

2009-09-06 Thread archF6
I have implemented the Twitter Datasource found in the bakery [ http://bakery.cakephp.org/articles/view/twitter-datasource ] which uses Http Socket to send a GET request to Twitter, and parses the XML response into an array. Everything works great about 95% of the time, however, after long period

Re: HttpSocket, Twitter Datasource, and an unexpected response

2009-09-06 Thread archF6
Just to follow up, after a bit of digging, it appears this is a documented issue with Twitter that's been showing up for a few weeks now [ http://groups.google.com/group/twitter-development-talk/browse_thread/thread/88506e01a9c1a4e4 ], [ http://groups.google.com/group/twitter-development-talk/bro

Re: Can you paginate an array of data without going to the DB to find it?

2009-09-06 Thread Dr. Loboto
You can try custom query pagination. http://book.cakephp.org/view/249/Custom-Query-Pagination On Sep 6, 11:53 pm, DavidH wrote: > Hi > > I'm using CakePHP as a development framework; but my data is stored / > retrieved in documents from a Couch DB. I've written home grown > classes to access th

Re: Undefined variable when using a custom helper

2009-09-06 Thread Dr. Loboto
Helpers are for views, not controllers. Of course it do not exists in controller. On Sep 6, 8:14 pm, troven wrote: > I've searched the net for an answer to the following error: >     Notice (8): Undefined variable: commons [APP/controllers/ > profiles_controller.php, line 2388] > > I've declared

Re: How is the difference between Model::query() and Model::execute()?

2009-09-06 Thread cogitovn
In another project, I could use execute() for SELECT statements, even that SELECT statements getting data from more than one table. So, I don't understand What "execute() is called privately within the Model class." is. Please explain more details. Thank you! 2009/9/6 euromark (munich) > > same

Re: Media Plugin

2009-09-06 Thread David Persson
Hey Robert, The paths you get from the MediumHelper to they point to existing assets (try accessing the path directly). What is the actual HTML which gets rendered when you use embed(...) ?> ? MediumHelper::file() is quite flexible it takes both a single string argument as well as an array (like

Setting Up CakePHP on MAC with MAMP and Eclipse

2009-09-06 Thread Kludge
Anyone have any idea on how to do this? I have MAMP and Eclipse installed correctly and have been doing PHP development for a while now and everything works fine. I now want to jump into CakePHP but can't wrap my head around setting it up. Any insight and or steps on getting there would be great.

Re: What do messages in Debugkit Timer mean?

2009-09-06 Thread nologicon
I was wondering that myself. Anyone? -- View this message in context: http://n2.nabble.com/What-do-messages-in-Debugkit-Timer-mean-tp3460593p3594484.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message b

RE: Query Help

2009-09-06 Thread Dave Maharaj :: WidePixels.com
Because the $sql is built from the input separated by , so it will search Mary, Tom as SELECT `Post`.`id` FROM `Posts` AS `Post` WHERE `Post`.`status` = 0 AND `Post`.`rank` <= 0 AND `Post`.`title` LIKE '%mary%' OR `Post`.`description` LIKE '%mary%' OR `Post`.`title` LIKE '%tom%' OR `Post`.`descr

Re: Query Help

2009-09-06 Thread Miles J
Why dont you just use the built it or mechanics? 'OR' => array('Post.title LIKE' => '%'. $value .'%', 'Post.description LIKE' => '%'. $value .'%') --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To p

RE: Query Help

2009-09-06 Thread Dave Maharaj :: WidePixels.com
The $sql is created with this: $i=0; // This is each counter // Now build SQL String $sql = ""; foreach ($string as $key => $value) { $value = trim($value); //strip white space befor a

Re: Query Help

2009-09-06 Thread Miles J
It seems like the OR is breaking it. What does the $sql variable look like? --~--~-~--~~~---~--~~ 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 unsubscrib

Query Help

2009-09-06 Thread Dave Maharaj :: WidePixels.com
For some reason this query is pulling more results then that which is possible. I am running a contain $params = array('contain' => false, 'conditions' => array( 'Post.status' => 0, 'Post.rank <=' => $rank, $sql ),

Re: Need a bit of help with the delete function

2009-09-06 Thread Miles J
No you dont need to the name the index in the array, you only do that for routed pages and named arguments. $html->link('Delete', array('action' => 'delete', $fullname['Fullname'] ['name_id']), null, 'Are you sure?' ); --~--~-~--~~~---~--~~ You received this messag

Can you paginate an array of data without going to the DB to find it?

2009-09-06 Thread DavidH
Hi I'm using CakePHP as a development framework; but my data is stored / retrieved in documents from a Couch DB. I've written home grown classes to access the Couch and have turned off Cake's desire for a DBMS by creating my own dbo_source that just returns true making Cake think it's connected O

Re: Should id be hidden value?

2009-09-06 Thread stefan blickensdoerfer
hi baked views should not be used as final solution for an application. but you can use the security component to avoid manipulation of form data. regards On Sun, Sep 6, 2009 at 3:32 PM, thesti wrote: > > hi, > > i'm learning CakePHP and i take the Blog tutorial. > > and as i came to the mod

Should id be hidden value?

2009-09-06 Thread thesti
hi, i'm learning CakePHP and i take the Blog tutorial. and as i came to the modifying a post part, it's written that if we supply the 'id' field to the FormHelper then the form will be used to edit a post. when i see the source page, i see that the id is there as a hidden Input in the edit form

Undefined variable when using a custom helper

2009-09-06 Thread troven
I've searched the net for an answer to the following error: Notice (8): Undefined variable: commons [APP/controllers/ profiles_controller.php, line 2388] I've declared it in my Controller - as you can see from the debug output: Array ( [0] => Commons THIS IS IT [1] => Html

Auth problem. Please help

2009-09-06 Thread Veoempleo
Hello, I've configure the auth module in app_controller, and in a user view I use swfupload script to upload an image. When it is completed, it launch windows.location.reload() The module upload image and update db, BUT when the javascript launch windows.location.reload(), auth finalize session:

Re: Using a Button to Submit an AJAX Form

2009-09-06 Thread Shaun
The $form->button still reloads the page because I'm using ('onclick' => 'this.form.submit()') Is there any way to use a button to submit the data without reloading the page? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

Neighbors help.

2009-09-06 Thread Dave Maharaj :: WidePixels.com
I am having some problems with finding neighbors in pagination. I have a standard index whichs lists all the post -> view get the neighbours ok that works no problem. view function : this gets me the posts before and after $post_id I pass $neighbors = $this->Post->__getNeighbors($post_id, $rank,

Re: cake cant find model's method!!!

2009-09-06 Thread Dr. Loboto
With such names I better check code and model filename for misspellings. I guess that this model filename should be enrollees_offered_subject.php Remember, that if cake do not find file with model it loads AppModel instead. And if model name is conventional and table exists, all seems normal unti

Re: My behavior does not work with containable

2009-09-06 Thread schneimi
This is really unfortunately. Anyway, I found an old patch/hack for the core and made it work with the latest CakePHP 1.2.4.8284. Because this may help others as well, I put it on my blog: http://schneimi.wordpress.com/2009/09/06/behavior-afterfind-on-model-associations/ On 5 Sep., 16:44, brian

Re: Parsing image BB with HTML helper

2009-09-06 Thread BeroFX
Okay, I know I wasn't crazy, after 3 hours of searching, I found it. http://www.gersh.no/posts/view/embed_images_anywhere_in_cakephp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this g

Re: Need a bit of help with the delete function

2009-09-06 Thread Russell
Just change the url $html->link('Delete', array('action' => 'delete', 'id' => $fullname['Fullname']['name_id']), null, 'Are you sure?' ) to $html->link('Delete', array('action'=>'delete',$fullname['Fullname'] ['name_id'], array('escape' => false), sprintf(__('Are you sure ?', true), $fullna

Parsing image BB with HTML helper

2009-09-06 Thread BeroFX
Hi guys! I saw a really neat piece of code a few weeks ago, but forgot to bookmark it and am running crazy now. I was actually a component that did the following: You put [image:123] in your text (e.g. Post text) and save it. When you're reading the data out, you do $post['Post']['text'] = $th

Need a bit of help with the delete function

2009-09-06 Thread Whitty
Hi, I've just started using cakephp, and I'm working on a small program, I have an existing db which has a table ID called name_id but I'm unable to delete records from the table using this id using the delete function here is an example of the code: this is the function: function delete