Re: $model-save - which id is used?

2009-05-10 Thread JamesF
on edit it uses the id of the record you pulled up. on add it uses the next auto-incremented id. On May 8, 11:18 am, Jonathan jst...@image.dk wrote: Here is a pretty simple save example from the manual: function edit($id) {     if(!empty($this-data)) {        

Re: css problem

2009-05-10 Thread JamesF
your syntax seems ok but when you load firebug and expand the + on the css line do you see it loading an html page (missing method/ controller)? if so your file is in the wrong spot. make sure it's in / webroot/css On May 9, 6:56 pm, Paulos23 paulitosthe...@gmail.com wrote: Hello guys. i am

Re: Foreign Key

2009-05-10 Thread JamesF
technically i believe foreign keys just have to have the same data type as the related primary key. but i didn't google it. On May 8, 5:10 am, Miles J mileswjohn...@gmail.com wrote: If you want a slug, you still would need an id. I do this all the times, for example my table: Category: id,

Re: Splitting a Controller in two?

2009-05-10 Thread Mantas
Hi! Could you write how to configure cake to have admin section in separate class? Thanks. On 3 Bal, 01:05, Miles J mileswjohn...@gmail.com wrote: There isn't really any disadvantages. For a few of my projects, I made the admin a completely separate application and had both apps share the

Re: css problem

2009-05-10 Thread paulos nikolo
ty james for your reply.I finally found it :) 2009/5/10 JamesF usaexportexpe...@gmail.com your syntax seems ok but when you load firebug and expand the + on the css line do you see it loading an html page (missing method/ controller)? if so your file is in the wrong spot. make sure it's in /

New Komodo Macro -- CakePHP Toggle

2009-05-10 Thread shaggz
I just wanted to announce a new CakePHP macro I created for Komodo Edit. It is compatible with CakePHP 1.2+. Please check it out if you're a Komodo user. I've pasted the features below: The general purpose of the macro is to allow easy navigation between CakePHP model/view/controller files.

Re: Poll: what do you hate about CakePHP?

2009-05-10 Thread Mateo San Román
Don't quite understood... You can always unbind relationships and select the fields you want with find On May 8, 6:00 am, gaurav.v.sharma gaurav.v.sha...@gmail.com wrote: if one could modify the amount of data that cake fetches during any operation. For example the action index fetches more

Re: No multiple select. Why?

2009-05-10 Thread rich...@home
If you don't want to add them by hand ever time. I've written a function that will do it for you: http://www.richardathome.com/blog/cakephp-auto-populating-foreign-key-dropdown-fields On May 8, 3:16 pm, brian bally.z...@gmail.com wrote: Did you fetch a list of Users in your controller?

Re: Default value of INT NOT NULL fields

2009-05-10 Thread j0n4s.h4rtm...@googlemail.com
My suggestion, as far as I understood you, cakephp inserts NULL instead of '0' right? Set your database to default '0' as it should work. - If it does not add function beforeSave() { /* ... */ } to your YourModelWithLotsOfInts - Within that check if a variable is a.) or empty or NULL or

Re: $model-save - which id is used?

2009-05-10 Thread jstein
On May 10, 8:25 am, JamesF usaexportexpe...@gmail.com wrote: on edit it uses the id of the record you pulled up. Thanks for your reply, - but I don't pull up anything before I call save... The id of the record to be modified is only present as a parameter to the edit function. In some

Re: Permission problem in baking script

2009-05-10 Thread jstein
On May 9, 7:30 am, zarbizade zarbizad...@gmail.com wrote:  The error is something like this Web Server has not Permission To create file in /var/www/app/temp . Is there any Solution to These problem.If i try to give permission using my root user will be work or not? No guarantee, but the

Re: New Komodo Macro -- CakePHP Toggle

2009-05-10 Thread AD7six
On May 9, 6:58 pm, shaggz tyler.scha...@gmail.com wrote: I just wanted to announce a new CakePHP macro I created for Komodo Edit.  It is compatible with CakePHP 1.2+. Hi shaggz, Interesting stuff, why not take a look at writing a komodo wrapper for the cakemate plugin

Re: Lang in url and named parameters

2009-05-10 Thread Pixelastic
I want to keep the :lang parameter in the url for SEO purposes. This way each ressource of my app will have a different url and my pages will be indexed in all the available languages (seems logical as their content will be different). On 8 mai, 18:55, John Andersen j.andersen...@gmail.com

Re: Authentication problem

2009-05-10 Thread carlito999
But the problem still goes on. The saved password in database is hashed. But they always shows 'login error' while trying to log in. On May 9, 8:51 pm, brian bally.z...@gmail.com wrote: Auth hashes the password automatically. On Fri, May 8, 2009 at 11:39 PM, carlito towhid...@gmail.com

Folder structure

2009-05-10 Thread Mateo San Román
One thing I don't like of CakePHP is the way the folder structure is done. When working on one particular resource, you have to navigate on three different folders: (models, controllers, and views/resource). If the folder structure were resource-oriented, one could have a folder for every

Re: hasOne relationship problem

2009-05-10 Thread Rick
Looking through cake/libs/model/model.php I don't see anywhere in saveAll where a check is done for a hasone association. (May have missed it). I don't see how it could do this by default in any case. It could recognize the hasone association but then how would it verify uniqueness. It

Re: $model-save - which id is used?

2009-05-10 Thread Rick
Take a look at $this-Recipe. I think it is in there. debug($this-Recipe); On May 10, 7:33 am, jstein jst...@image.dk wrote: On May 10, 8:25 am, JamesF usaexportexpe...@gmail.com wrote: on edit it uses the id of the record you pulled up. Thanks for your reply, - but I don't pull up

Re: Email Component Help: smtpError

2009-05-10 Thread rartavia
Hello mscdex, thanks a lot for your answer I haven't used the Email component yet, but I did notice that with the newest version of cake (1.2.3.8166) there was a fix for the Email component. Specifically, instead of sending a hardcoded HELO cake, this newest version will send HELO and then

Re: XML rendering

2009-05-10 Thread Smelly Eddie
AAron: I am not sure what your adding to app/xml/data.ctp for. This should be handled like any other view. You need; The parse xml extensions config (which you have) A controller action (your's looks good) An XML view (app/views/CONTROLLERNAME/xml/CONTROLLERACTION.xml Here's an article I

Re: $model-save - which id is used?

2009-05-10 Thread Enrique
The id can be found in $this-data. $this-data is automatically filled by the submitted form data and the form sends the id with the post data. The action parameter $id is only used to load the model and fill in the form. Hope that answers your question. - Enrique On 8 Mai, 12:18, Jonathan

Re: Update a DIV jQuery

2009-05-10 Thread Enrique
And you should always keep a good Cheatsheet under your pillow: http://www.gscottolson.com/weblog/2008/01/11/jquery-cheat-sheet/ - Enrique On 9 Mai, 17:19, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: As i drop prototype and move forward with jQuery i need to find replacements

Bug? Plugin and controller with same name

2009-05-10 Thread gerhardsletten
Experience a bug with cake_1.2.3.8166 where I have a Posts plugin that has a controller with same name. When I try to redirect to the index function cake adds :controller in the end. I get this url: http://localhost/~gerhard/gersh.no/admin/posts/:controller Anybody who knows if thats a bug?

confirm message

2009-05-10 Thread Paulos23
Hi peeps, Well i am creating some nice crud functionality and i use some images.All working perfect but i have problem with the delete action coz i want a confirm message to appear when user tries to delete.What am i doing wrong?Here is my example code: ?php echo $html-image(delete.png,

Re: confirm message

2009-05-10 Thread Enrique
The url array is only that: an URL array, i.e. there is no confirm parameter here. What I would do is putting the image in a $html-link() and use it's confirm parameter and disable the HTML escape (to output the image tag correctly). Maybe there is another way, looking at the cake HTML helper

I eliminated the default pages routing and now my controllers won't load

2009-05-10 Thread Bankai
I wanted my URLs to look like: www.website.com/some_content Instead of the cakephp default: www.website.com/pages/some_content So I edited the router.php to this Router::connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); #Router::connect('/pages/*', array('controller' =

user preferences on a social site

2009-05-10 Thread park
On an social site, users may change preferences on whether their profiles are open for strangers, or whether their actions are posted to the newsfeed section. In cake, what's the best practice for implementing this functionality? Will ACL work well on this? Or is there any other solutions?

user preferences on a social site

2009-05-10 Thread park
On a social site, users may change preferences on whether their profiles are open for strangers. In cake, what's the best practice for implementing this functionality? Will ACL work well on this? Or is there any other solutions? Many thanks!

Re: user preferences on a social site

2009-05-10 Thread brian
On Sun, May 10, 2009 at 1:33 PM, park park@gmail.com wrote: On an social site, users may change preferences on whether their profiles are open for strangers, or whether their actions are posted to the newsfeed section. In cake, what's the best practice for implementing this

Re: confirm message

2009-05-10 Thread paulos nikolo
I tried to use html-link as you said but i can't make it work.I wonder what is the solution. 2009/5/10 Enrique enrique.jaco...@gmail.com The url array is only that: an URL array, i.e. there is no confirm parameter here. What I would do is putting the image in a $html-link() and use it's

Re: Add dynamic CSS to head from element?

2009-05-10 Thread toby1kenobi
I actually have that already - care to elaborate on why you mentioned it though? Thanks, Toby On May 9, 5:26 am, Ketan Shah ketan.s...@gmail.com wrote: add this ?php echo $scripts_for_layout ;? in your head tag of the layout file. -Ketan.www.propertyjungle.inwww.innovatechnologies.in On

Re: Add dynamic CSS to head from element?

2009-05-10 Thread toby1kenobi
It's slightly odd eh? Coincidentally, I've just run int0: ...So it's not as strange as, say, the $inline param for the css() method. Now *that* makes no sense. What is going on there?! According to the docs it seems like I should be able to create a link tag in the head of my document by

Re: confirm message

2009-05-10 Thread Kyle Decot
Try this: echo $html-link($html-image(delete.png,array (alt=Delete,title=Delete)),$html-url(array (controller=users,action=delete)),array(),Are you sure to delete user?,false); On May 10, 2:09 pm, paulos nikolo paulitosthe...@gmail.com wrote: I tried to use html-link as you said but i can't

Re: user preferences on a social site

2009-05-10 Thread Kyle Decot
I agree w/ Brian. On my site, I have all my user preferences stored in my profiles table. On May 10, 1:57 pm, brian bally.z...@gmail.com wrote: On Sun, May 10, 2009 at 1:33 PM, park park@gmail.com wrote: On an social site, users may change preferences on whether their profiles are open

Re: Add dynamic CSS to head from element?

2009-05-10 Thread brian
This is how the style (and script) tags are added to your layout. I think Ketan didn't realise that your problem is that you're trying to add a style *block* to your page. On Sun, May 10, 2009 at 3:26 PM, toby1kenobi toby.math...@gmail.com wrote: I actually have that already - care to

Re: $model-save - which id is used?

2009-05-10 Thread jstein
On May 10, 4:35 pm, Rick will...@gmail.com wrote: Take a look at $this-Recipe.  I think it is in there. debug($this-Recipe); Yes - $this-Recipe-id is set to the correct id - but then again: How? Regards Jonathan --~--~-~--~~~---~--~~ You received this

Re: $model-save - which id is used?

2009-05-10 Thread Miles J
Thats how CakePHP is built, wonderful right? --~--~-~--~~~---~--~~ 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 group, send email to

Re: Lang in url and named parameters

2009-05-10 Thread Miles J
I would suggest prefix routing: http://book.cakephp.org/view/46/Routes-Configuration#Prefix-Routing-544 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to

jQuery help

2009-05-10 Thread Dave Maharaj :: WidePixels.com
I am trying to do something so simple and just cant get it. I have a link... click it and it runs a function in the controller returning the success/fail message from the controller function into a div (saved or unable to save please try again) but I am having absolutely no luck with it. Do I

Re: $model-save - which id is used?

2009-05-10 Thread jstein
On May 10, 5:52 pm, Enrique enrique.jaco...@gmail.com wrote: The id can be found in $this-data. No. My first thought was that the form helper would insert a hidden field with the id - but it doesn't (and debug($this-data) shows that the id is not present in the data). Now I did some

Re: confirm message

2009-05-10 Thread paulos nikolo
Ty you help me in most important part...After your solution there was an error and i found it.the complete is: ?php echo $html-link($html-image(delete.png,array(alt=Delete,title=Delete)),$html-url(array(controller=users,action=delete,$user['User']['id'])),array(),Are you sure to delete

CakePHP 1.2 AdminAuth Problem

2009-05-10 Thread simon...@terra.com.br
Hi Everyone, I did migrate to CakePHP 1.2 and with the older version, I could init the AdminAuth this way in the app_controller file : //init the admin component... $this-AdminAuth-msgError = Erro ao efetuar seu login. Tente novamente.;

Re: $model-save - which id is used?

2009-05-10 Thread Miles J
Yes its all done in the initializing of the controllers/models, not within the forms. --~--~-~--~~~---~--~~ 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: social networking script with CakePHP

2009-05-10 Thread rgreenphotodesign
Have not tried Noserub, http://www.addthis.com looks kind of cool. There is also a social bookmark helper on the bakery. On May 9, 1:21 pm, Dardo Sordi Bogado dardoso...@gmail.com wrote: have you seen Noserub ? On Sat, May 9, 2009 at 12:31 PM, Liran liran...@gmail.com wrote: Hi there! :)

Re: New Komodo Macro -- CakePHP Toggle

2009-05-10 Thread shaggz
On May 10, 7:07 am, AD7six andydawso...@gmail.com wrote: Hi shaggz, Interesting stuff, why not take a look at writing a komodo wrapper for the cakemate plugin (http://thechaw.com/cakemate) which puts most of the logic in a cake shell. In this way your marco would only need to construct

Re: XML rendering

2009-05-10 Thread Aaron Torres
Ah, that file path was actually a typo: app/views/controllername/xml/data.ctp (same name as the controller action) actually contains: test case?php echo $message; ?/case /test I accidentally omitted controllername from the full path, but it's definitely correct and I'm getting the same

Validation question

2009-05-10 Thread Dave Maharaj :: WidePixels.com
Throughout my application i have about 100 various input fields in forms. Most use the same validation rules max min alphanumeric and so on Is it possible to define a set of validation rules in app_model that can be used in the other models rather than adding the same rules over and over to

Re: Validation question

2009-05-10 Thread Miles J
Well you could place the validation array on the $validate property within AppModel. --~--~-~--~~~---~--~~ 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: I eliminated the default pages routing and now my controllers won't load

2009-05-10 Thread JamesF
make sure when usings reverse routing to use verbose linking...ie you have to link like this echo $html-link('link text', array('controller'='your_controller', 'action'='your_action')); On May 10, 1:21 pm, Bankai hgnelso...@gmail.com wrote: I wanted my URLs to look

Re: confirm message

2009-05-10 Thread arif hossen
I think it is good solution for your error correction .Please follow this code: ?php echo $html-link(__('Delete', true), array('action'='delete', $user['User']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $user['User']['id'])); ? On Mon, May 11, 2009 at 3:37 AM,

Validate postal

2009-05-10 Thread Dave Maharaj :: WidePixels.com
In the cookbook 4.1.4.23 postal validating postal codes How can you validate the zip/postal if you don't know if its Canadian, American or one of the others? Can you attempt to validate if it in American format then Canadian then others and if any of them pass is fine if not return false?

Re: Lang in url and named parameters

2009-05-10 Thread John Andersen
Ok, then maybe a Sitemap should be considered instead of the lang paramater! See http://en.wikipedia.org/wiki/Sitemap for more information. Enjoy, John On May 10, 4:25 pm, Pixelastic timcc.pe...@gmail.com wrote: I want to keep the :lang parameter in the url for SEO purposes. This way each