Re: how to add a relationship whit other key different to the PK

2010-05-12 Thread Martin Westin
. for example, the HasMany query should be: SELECT `Mirror`.`id`,  FROM `mirrors` AS `Mirror` WHERE `Mirror`.`software_id` = (6) But how i can put in the query, or in the conditions value add the id of software_id?? Thanks in advance On Wed, Apr 28, 2010 at 4:35 AM, Martin Westin

Re: Limitations to plugins for app modularity - are there any left in cake 1.3?

2010-05-11 Thread Martin Westin
My experience tells me that almost all of your limitations did not exist even before 1.3 - plugins couldn't access or extend app's models They could. I did it regularly. - code in the app couldn't access a plugin's models They could. But I would not recommend doing it. (IMHO an app should not

Re: Shared SSL and .htaccess

2010-05-11 Thread Martin Westin
Classic problem. being inside a aliased folder, like ~myuser you need to edit your .htaccess file adding a rewrite base. Search and find tons of threads discussing it in detail. (searching is easy once you know the right keywords) Once you got that done Cake should work fine. On May 10, 6:31 

Cookie::delete() spits error on one server but not the other

2010-05-11 Thread Martin Westin
I have been scratching my head a bit here and can't find the problem. $this-Cookie-delete('Auth.User'); ...is called on login and logout. When sometimes the Auth key does not exist in the cookie __values I get a notice from PHP... but only on my production server. php.ini is a likely candidate,

Re: Limitations to plugins for app modularity - are there any left in cake 1.3?

2010-05-11 Thread Martin Westin
I think you are reading two posts as one. I only mentioned using plugins for all visible features except a very few... nothing about paths. And to clarify about the app I refer to: The app is made up of many plugins.. not one common plugin. There is a lot of common functionality in the main

Re: Datasource CouchDB

2010-04-28 Thread Martin Westin
This is not an answer as such, only an idea if there is no datasource already. If you feel a bit adventurous you might be able to sneak a peek at the MongoDB datasource and make a similar one for CouchDB. The two databases are not identical but I think significant parts of the datasource would be

Re: how to add a relationship whit other key different to the PK

2010-04-28 Thread Martin Westin
You can set foreign_key to false and instead use the condition of the relationship. This is usually used for things like User.active = true and simple things like that but I think it can be used for your purpose. COme to think of it, I may be wrong. I vaguely recall an RC for Cake1.2 causing

Re: Bakery...arrogance or plain lack of attention

2010-04-26 Thread Martin Westin
I have a few articles published in the Bakery. This does not make me an authority on the subject but Since my first one was back in 2007 (I think), before it was even called the Bakery, I do have some experience of it over a pretty long time. My personal set of guidelines for writing articles

1.3rc4 and saveAll, strange return values

2010-04-21 Thread Martin Westin
I wanted to get some input on the return I get from Model::saveAll(). (I am on 1.3 RC4) When trying to save multiple records of the same model things did not save at all at first due to the new validation default. I needed individual validation so that correct records would save but invalid ones

Re: mac users, which ide are you using to develop cakephp?

2010-04-19 Thread Martin Westin
No ide, just Textmate for me. On Apr 19, 6:14 am, Bryan Lim ytbr...@gmail.com wrote: Hi all, mac users, which ide are you using to develop cakephp? to compile and to debug? I search the group here and realised this discussion is dated back to 2009. So, I want to know if there's any

Re: composite keys to identify a record

2010-04-19 Thread Martin Westin
In conclusion @Renan: Composite keys are a very normal part of database design but not in any way supported or very compatible with CakePHP. Either you have to access that data via your own queris (no find and save), not use the core Schema Shell to dump the schema ,and a bunch of other things

Tip: MongoDB-Datasource undocumented feature

2010-04-16 Thread Martin Westin
I did not know the datasource could do this and almost didn't try it as a result. Don't make the same mistake. Yasushi Ichikaway has developed a very nice datasource for MongoDB. http://github.com/ichikaway/mongoDB-Datasource/ Mars Story wrote a very nice intro post about it.

Re: the plugins dont work at all

2010-04-16 Thread Martin Westin
Hi, Plugins do work. I have whole apps build with a limited core and numerous plugins (22 of them in one case). I can think of a few details to double-check. I don't think you should have plugins named in camelCase. Try naming the folder and the urls you try pizza_order instead. (The plugin in

Timezone management advice

2010-04-12 Thread Martin Westin
Hi, I have found myself in a position where I need to support correct times across timezones. I'd love any advice and gotchas from those experienced in timezone management of a Cake app. I have gotten a bit bewildered by the complexity by something that looks to simple on the face of it. I need

Re: How can Schema Shell create new tables?

2010-03-30 Thread Martin Westin
Also, I can't get the reverse to work either. I.e. update does not notice that a table should be dropped. I'd love some help on that also. On Mar 30, 7:51 am, Martin Westin martin.westin...@gmail.com wrote: Hi, cake schema run update -f always creates an ALTER TABLE statement. So how about

How can Schema Shell create new tables?

2010-03-29 Thread Martin Westin
Hi, cake schema run update -f always creates an ALTER TABLE statement. So how about when a new table is in the schema? I see the code really in DboMysqlBase::alterSchema() for my dbo but the same logic was found in the Postgres class. Since I am quite sure the Schema Shell would not have been

Re: cake schema run update gone crazy

2010-03-26 Thread Martin Westin
to ignore the Model classes in the same way as generate and therefore update a schema generated using the option. So, Schema Shell appear to do all the important stuff I need... more testing will confirm. On Mar 25, 4:59 pm, Martin Westin martin.westin...@gmail.com wrote: Ah. Thanks for the hint

non-interactive Schema Shell for deployment?

2010-03-26 Thread Martin Westin
I am almost there with the Schema Shell. Now just one thing remains. Being able to do run update -f without answering y or n to the questions. Is there a non-interactive mode for the Schema Shell? I can't see any option to do it. /Martin Check out the new CakePHP Questions site

Re: non-interactive Schema Shell for deployment?

2010-03-26 Thread Martin Westin
Found a shell-based way to automatically answer the question. http://www.unix.com/shell-programming-scripting/30246-how-give-variable-command-shell-script.html On Mar 26, 3:41 pm, Martin Westin martin.westin...@gmail.com wrote: I am almost there with the Schema Shell. Now just one thing

cake schema run update gone crazy

2010-03-25 Thread Martin Westin
I thought I'd give schema migrations a try. But something small must be horribly wrong with how I am trying to use the schema shell. I run cake schema run update on the database that just generated the schema and the shell wants to add all the columns to the tables again. That can't be right?

Re: cake schema run update gone crazy

2010-03-25 Thread Martin Westin
://www.ianmjones.comhttp://twitter.com/ianmjones On 25 Mar 2010, at 13:02, Martin Westin wrote: I thought I'd give schema migrations a try. But something small must be horribly wrong with how I am trying to use the schema shell. I run cake schema run update on the database that just generated

Re: After the Cake is baked...

2010-02-22 Thread Martin Westin
Avoid getting sued? Stop being an american work like a charm. ;) (sorry, I could not resist) On Feb 22, 8:39 am, Johnny Cupcake sparklew...@hotmail.com wrote: OK, so after we have successfully built our modern, interactive CakePHP website...where can we learn how to actually /run/ the

Re: 1.2.6 strtotime error

2010-02-18 Thread Martin Westin
That should not be a Cake 1.2.6 problem but a php 5.3 problem. (or even possibly 5.2.10 or something) I had this error notice way before 1.2.6... and the fix is exactly what you paste... to set the default timezone so that php is happy. One small problem is that the PHP manual lists a lot of

Re: About CakePHP and DB2

2010-02-10 Thread Martin Westin
Can you be more specific. Do you have a problem with CakePHPs db2 driver? What specifically is not working? I haven't used many drivers (MySQL and Sqlite) but I would expect them all to work just by choosing to use them. From the manual var $default = array('driver' = 'db2',

Re: inflector - class methods - slug ????

2010-02-10 Thread Martin Westin
Cake only supports conversion of a specified list of characters to their root a or o. You need to patch the Inflector class (and post it back to the tracker). line 496 of inflector.php is where the action starts. It is quite obvious where to add your additional characters. Actually I added those

Re: inflector - class methods - slug ????

2010-02-10 Thread Martin Westin
to set string to lowercase ( i was having problems with chars like Ó and Á ) Martin what do you mean by: I will let you post the ticket though. Sorry im not a expert on CAKEPHP , yet On 10 Fev, 14:37, Martin Westin martin.westin...@gmail.com wrote: Cake only supports conversion

Re: Access Global Function in CakePHP

2010-02-10 Thread Martin Westin
I can not imagine why you would use a localized variable variable. Anyway... $temp_var = __('String',true); echo {${$temp_var}}; On Feb 11, 8:14 am, Mukhamad Ikhsan ikhsan.o...@gmail.com wrote: global function like __() is break the OOP concept, in some cases i need the function bind to

Mongo without a schema?

2010-02-09 Thread Martin Westin
Hi, I thought I'd see if any user or contributor to the MongoDB datasource can answer this question. The datasource is this one by ichikaway: http://github.com/ichikaway/mongoDB-Datasource The datasource strangely requires each model to define $_schema in the class definition. I say strangely

Re: Release: CakePHP 1.2.6

2010-02-01 Thread Martin Westin
I want to add my thanks to everyone contributing. @Mark Did you forget to make this topic a sticky? On the first page in the google group the 1.2.5 announcement is still pinned at the top but this one is not. Check out the new CakePHP Questions site http://cakeqs.org and help others with their

My Cake app presented at CES keynote

2010-01-18 Thread Martin Westin
I have been working on the same Cake app for the past two years. A lot of it has been a bit hush hush but last week we were truly outed by Qualcomm. Check out our 3 min segment from the Keynote: http://www.greatconnection.se/en/ces The system transmits medical images from echo machines

Re: My Cake app presented at CES keynote

2010-01-18 Thread Martin Westin
!  Well done. Chad On Jan 18, 4:23 am, Martin Westin martin.westin...@gmail.com wrote: I have been working on the same Cake app for the past two years. A lot of it has been a bit hush hush but last week we were truly outed by Qualcomm. Check out our 3 min segment from

Re: adding/updating additional fields in HABTM's join table

2010-01-18 Thread Martin Westin
Of-course there is :) The trick to getting some control over the join table is the with key. http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM This tells Cake to use your class file for the join model and any methods and settings in it. Mariano also has a good write-up of how to get the

Re: coding practices with models

2009-12-29 Thread Martin Westin
I feel the same way sometimes. It is tempting to use model methods as $record-method() in a way similar to an object-based ORM (e.g. Rails, where class methods are used for finding and instance methods are used for record manipulation). But the way Cake works it is a bit dangerous and I would

Re: Containable query

2009-12-03 Thread Martin Westin
Well, Containable will not do what you want in this case. Containable will not limit your primary result-set by conditions on some associated model. Logically it might be said to flow like this: Your query will find all Users since you have no condition to limit the users. Each User will also

Re: HABTM questions

2009-12-03 Thread Martin Westin
About the pagination: http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM Look at the bottom. The last examples abut binding can be used to let paginator deal with your habtm. When it comes to finding related data find is better than read. But probably find('first') in this case since it

Re: download API documentation and book

2009-12-03 Thread Martin Westin
These will not be the great answers you were hoping for. It is just my DIY way of dealing with the problem you describe. On the start page of The Book (left sidebar, at the bottom) there is a link to all in one page. I go there. Get a cup of coffee while it renders and then save it as a pdf. Then

Re: Delete confirm

2009-12-03 Thread Martin Westin
Really interesting thread guys. I often resort to just disabling SecurityComponent (I know) when I run into the black hole of death a few times and can't figure out why. Is there a good way to debug SecurityComponent problems so that dealing with specific issues on some forms can be less hit and

Re: Views/layouts/js folder

2009-12-01 Thread Martin Westin
I believe it is supposed to contain layout files for any action you have that outputs javascript (using parseExtensions). You can return pure javascript from ajax calls and have that code executed in the browser. I have only ever used rss, xml, and a few of my own like xls and mms... never js,

Re: CakePHP performance 1.2 - is future any better?

2009-11-24 Thread Martin Westin
I can only agree with all these suggestions and add a little beauty i was introduced to recently. X-Sendfile is a great for performance if you do any file output from php. It offloads all the actual output of the file to the webserver (nginx, Apache, lighttpd...). For me, implementing sendfile

Re: About multilingual websites

2009-11-24 Thread Martin Westin
Hi, For 1: If Cake has trouble figuring out where your app is (for some reason). The simple workaround is to specify it with the full path: /Users/thomaus/Sites/MyApp/cake/consol/cake -app /Users/thomaus/Sites/ MyApp/app i18n extract That is the foolproof and disgustingly verbose way of making

Re: File upload size (copy by value)

2009-11-24 Thread Martin Westin
You are looking at the problem form the wrong angle. Don't store 42MB files in the database, that's all. Files are best stored in the filesystem. Then you store the filename (and path) in your database. You will never even need to have the file in php-memory at all. /Martin On Nov 24, 7:37 

Re: CakePHP performance 1.2 - is future any better?

2009-11-24 Thread Martin Westin
Maybe someone should answer the original question: Will future versions improve performance? 1.3 - most likely not too much. 2.0 - this will likely see some more significant improvements since php4 is dropped. Any advancements after 2.0 are also likely to offer improvements as more and more code

Re: CakePHP performance 1.2 - is future any better?

2009-11-24 Thread Martin Westin
Straight from the source. Thanks Larry, I was mostly guessing that 2.0 would see the bigger improvements. :) On Nov 24, 4:17 pm, Larry E. Masters aka PhpNut php...@gmail.com wrote: On Tue, Nov 24, 2009 at 9:07 AM, Martin Westin martin.westin...@gmail.comwrote: Maybe someone should answer

Re: addons.mozilla.org soon will leave CakePHP..

2009-11-18 Thread Martin Westin
A lot of their reasoning is solid but part of it sound like classic 1.1 issues. They note some of it in their google spreadsheet. Reading partly between the lines it sounds like they don't like Simpletest, the cake shell and php4 limitations (=ORM with array- data). With that one has to

Re: Timeout in Internet Explorer but no other browsers

2009-11-10 Thread Martin Westin
I'll say from the start: I don't have the answer to your question. I reply simply to clarify some points and ask for a few more details. IE spends 12sec loading before displaying the error on one page. At the same time IE spends 3min loading on another page before displaying the same error. Is

Re: Mod rewrite skip

2009-11-10 Thread Martin Westin
Am I right when I say that you want /app/webroot/manager/existing_file -- should be accessible /app/webroot/manager/nonexistent_file -- should not be rewritten to a missing controller page It that is what you want, the lazy answer is that you don't have to worry. When you are live... at debug

Re: Date Calculation Problem

2009-10-30 Thread Martin Westin
I do a lot of this kind of thing: date('Y-m-d H i s', strtotime('+1 hour',strtotime($start_datetime))); You can use handy things like +2 monday to get to monday two weeks from now and a number of cool things that I prioritize. /Martin On Oct 30, 8:08 am, Jiru jiransl...@gmail.com wrote:

Re: 404 Status

2009-10-30 Thread Martin Westin
debug = 1 and you are expected to be in development and any missing file is likely to be a missing controller or action. debug = 0 and you are expected to be deployed... Cake now returns 404 for missing items. On Oct 30, 7:01 am, #2Will willjbar...@gmail.com wrote: Hi, My installation of

Re: Odd code in sanitize core lib?

2009-10-29 Thread Martin Westin
I am just guessing here but couldn't it be replacing looks like an exclamation but is really far out into outfer space with a normal exclamation? Using a bad font and the code look different. On Oct 29, 7:32 am, Miles J mileswjohn...@gmail.com wrote: I thought you were lying so I checked, and

Re: Simple question from a newbie seeking help from the gods

2009-10-19 Thread Martin Westin
'])); ? Can I just put $this-IngredientGroup-Ingredient-removeFromGroup( $ingredient ['id'], $ingredientGroup['IngredientGroup']['id']) directly in the view somehow? That seems to go away from the MVC methodology. Thanks again! Will On Oct 17, 10:27 am, Martin Westin martin.westin...@gmail.com

Re: Simple question from a newbie seeking help from the gods

2009-10-17 Thread Martin Westin
First the quickfix... hopefully. This will try to save a PHP-null value. $this-data['ingredient_group_id'] = null; Instead try to save an SQL-null value. $this-data['ingredient_group_id'] = 'null'; Or even just a zero if the above doesn't work. $this-data['ingredient_group_id'] = '0'; Now

What kind of Model-methods do you write?

2009-10-17 Thread Martin Westin
Dumb question? I hope not. I wanted to see which is the most popular way of writing methods in models. And by which way and what kind I am referring to if the methods assume and require a loaded row from the database or not. Better use an example. Drawing from the ever present blog tutorial,

Re: gwoo Leaving CakePHP??

2009-10-16 Thread Martin Westin
Best of luck to Garret in his future endeavors. I am confident that Larry, Nate, Mark, Joel, Andy and everyone else active in developing CakePHP will continue to do a beautiful job. I also hope I can continue, if not increase, my miniscule contributions. /Martin

Re: How to implement multiple pagination with SAME model on a single view?

2009-10-14 Thread Martin Westin
The support for multiple pagination on the same page is not complete. The source and API reveals that work did start on this feature but it was not finished for 1.2. I am not sure if it is suppsed to be in 1.3 or if you have to wait for 2.0. On Oct 14, 1:30 pm, doze doze...@gmail.com wrote:

Re: how to deal with empty data in index-views (example inside...)

2009-10-13 Thread Martin Westin
I just check for empty data and switch out part of the view. Much like the code sample Ceryl supplied. For more advanced use you can go all the way to using a status field in your database. An example, still from my file manager, User hbtm File can be used to figure out if a user has seen a

Re: Can you recommend quality (virtual) server hosting?

2009-10-13 Thread Martin Westin
, Martin Westin martin.westin...@gmail.com wrote: Hi, at my day-job we have plans to expand to the US. For that purpose I wanted to find a reliable hosting provider. Any good/bad experiences you can share would be welcome. I am looking for: • Server hosting / real, virtual or cloud

Re: how to deal with empty data in index-views (example inside...)

2009-10-12 Thread Martin Westin
This kind of view is often a good candidate for first-run information. If you know that empty data will predominately occur for new users you can use the blank page to display suggestions and instructions about how to get started. For example: In my file manager application, an empty folder

Can you recommend quality (virtual) server hosting?

2009-10-12 Thread Martin Westin
Hi, at my day-job we have plans to expand to the US. For that purpose I wanted to find a reliable hosting provider. Any good/bad experiences you can share would be welcome. I am looking for: • Server hosting / real, virtual or cloud. (we run special system software want to control the OS) • Able

Re: about https

2009-10-08 Thread Martin Westin
Find a certificate authority you like (price vs trust). They all have tutorials and detailed information on how to install their certificates. Or google for senf-signed certificates. (and non of it has anything to do with CakePHP...) On Oct 8, 5:45 am, wiky wqsha...@gmail.com wrote: Hi i am

Beginners guide to php security

2009-10-06 Thread Martin Westin
I stumbled across this link today. Very good clear example-driven guide to basic php security. http://phpsec.org/projects/guide/ Deals with sql injection, xss, hijacking globals, validating input. All the basics. It should be said that you get a lot of these things for free with Cake but I

Re: afterSave causing save to fail

2009-10-06 Thread Martin Westin
If you are staying on MySQL you can do something like: SET @pos=0; UPDATE busstops SET pos = ( SELECT @pos := @pos +1 ) WHERE route = 1 ORDER BY pos ASC Found that on: http://dev.mysql.com/doc/refman/5.0/en/update.html Roughly half-way down the comments. Search for: Posted by Christian Hansel

Re: $form-input('') when database-field contains special characters

2009-10-06 Thread Martin Westin
Strange indeed. I can't remember getting blank strings myself. /Martin On Oct 3, 7:01 pm, Melanie Sommer melanie-som...@mailinator.com wrote: Hello Martin Since the field is empty I suspect you may have Sanitize in place, or some other text cleaner. No (not that I know, just the

Re: Where request comes from?

2009-10-03 Thread Martin Westin
. http://www.milesj.me/resources/script/ajax-handler-component On Oct 2, 7:12 am, Martin Westin martin.westin...@gmail.com wrote: You CAN... but it is painful to say the least. Since you can't have your cake and eat it ;) your best bet is to look inside the Security Component to see what

Re: Where request comes from?

2009-10-02 Thread Martin Westin
curious. Dave -Original Message- From: Martin Westin [mailto:martin.westin...@gmail.com] Sent: October-01-09 5:45 PM To: CakePHP Subject: Re: Where request comes from? The Security Component does this kind of thing for you. For example, it will embed a hash value into the form

Re: Where request comes from?

2009-10-01 Thread Martin Westin
The Security Component does this kind of thing for you. For example, it will embed a hash value into the form which is a checksum of the form. If a field is missing or added it will be captured. If a hidden value is modified this will also be captured. Also sessions will be more secure and a lot

Re: $form-input('') when database-field contains special characters

2009-10-01 Thread Martin Westin
In reference to the bottom f your post. utf-8 and latin1_swedish_ci do not mix. Since the field is empty I suspect you may have Sanitize in place, or some other text cleaner. A simple character set problem should give you garbage but not empty strings. /Martin On Oct 1, 5:59 pm, Dr. Loboto

Re: afterSave causing save to fail

2009-10-01 Thread Martin Westin
Maybe Cake does not like you calling a saveAll inside a saveAll? A bit unrelated, but what is that afterSave doing? It looks like a lot of work for little result. What I see is you finding all images in a gallery ordered by the order_id. Then you set the order id of each one to a number in

Re: slow static multilingual site made with cakephp

2009-09-28 Thread Martin Westin
Loads very fast most of the time but it does load very slowly at other times. I get results mostly around 0.06-0.1s but a few were all the way up at 4.5s. To me that suggests either some problem with disk speed. Are you on (an overloaded) shared server or is this site all that is running on the

Re: Javascript inside a ajax content not work

2009-09-28 Thread Martin Westin
Some (most?) javascript libraries will strip the response of live javascript. You should configure the ajax call to evaluate the script instead. Exactly how you do that depends on the library. On Sep 28, 10:34 am, marco.rizze...@gmail.com marco.rizze...@gmail.com wrote: Hi I use ajax helper

Re: MAMP + CakePHP issues

2009-09-25 Thread Martin Westin
On 1 I second the opinion that vhosts are the way to go. I have never ever ever bothered modifying htaccess files just to get a few apps to run under localhost/one, /two and so on. You are on a Mac and in perfect position to setup in a way that is 100% identical to a production deployment. You

Re: Doubt in cake php

2009-09-24 Thread Martin Westin
Ever heard of a can of worms :) (The whole -This is MVC. -No, this is MVC thing can turn nasty at times.) Cake allows no direct access to Models from Views. That is how the MVC pattern has been implemented in Cake even though there are other interpretations in other Frameworks. If everyone had

Re: i18n table with 180 000+ entrys

2009-09-23 Thread Martin Westin
One thing I have yet to figure out is how to deal with charset/ collation problems using an i18n table. Because of this I would probably go for separate tables even though it requires more work to make id's sync and all that. The problems I am referring to are queries like

Re: Advanced setup

2009-09-22 Thread Martin Westin
Your problem is likely the cause of one of your .htaccess files not set correctly. You probably need a rewrite base. If I get your setup correctly (and I am not at all sure I do) you have the Apache document root set to var/www and everything else if in sub-folders of that. I can't really figure

Re: CakePHP and scalability

2009-09-22 Thread Martin Westin
http://www.mysqlperformanceblog.com/ I hope you have seen this blog? They have had a number of post lately about indexes and always post about optimization in one way or the other (funny enough). If you have added indexes which did not improve much you may be defining them wrong for the query

Auth redirects ssl back to plain http

2009-09-22 Thread Martin Westin
I was doing a test to see how my app runs under ssl and found that Auth redirects me out of ssl. All other links and redirects appear to work which is why I ask for help. It is surely some detail I have missed since it can't be a bug in Auth or Router. Does anyone know what I might be doing

Configure Cake under Nginx with ssl

2009-09-22 Thread Martin Westin
! just adding it to the list of params will make php think it is always running under ssl. fastcgi_param HTTPS on; /Martin On Sep 22, 10:38 am, Martin Westin martin.westin...@gmail.com wrote: I was doing a test to see how my app runs under ssl and found that Auth redirects me out of ssl. All

Re: Encoding problem

2009-09-16 Thread Martin Westin
Thanks for finding that one. I had not caught that before and I use non-english characters all the time. Guess Iäd better slow my application down by replacing all strtolower with the mb_ version... and possibly if clauses and things to make sure mb is installed. But have a look at php.net... it

Re: Question about Reverse Routing

2009-09-16 Thread Martin Westin
I think you can drop the wildcard and it will work. Router::connect('/search', array('controller' = 'skateparks', 'action' = 'index')); /Martin On Sep 16, 4:38 am, Kyle Decot kdec...@gmail.com wrote: I am having a little bit of trouble w/ my reverse routing. In my routes.php file I have:

Re: Encoding problem

2009-09-16 Thread Martin Westin
I noted that you need to do some extra work on ucfirst() since it has no direct mb_ equivalent. You have to roll your own or pick one from php.net since mb_convert_case() can only work like ucwords(). On Sep 16, 11:42 am, Martin Westin martin.westin...@gmail.com wrote: Thanks for finding

Re: I want to know now controller or plugin in routes.php

2009-09-16 Thread Martin Westin
If the names conflict the plugin has precedence. I thinks these are right: /abcs = 1. index on abcs controller in abcs plugin (aka the pluginname controller) 2. index on abcs controller in app /abcs/cba = 1. index on cba controller in abcs plugin 2. cba on abcs controller in abcs plugin (aka

Re: Pizza Online Order Notification?

2009-09-16 Thread Martin Westin
I think Tim is right here. Individual logins work in theory but in a busy restaurant where supposedly a single computer will be logged in all day and used by everyone... passwords would get swapped, written on a post-it and other secure things in a heartbeat. Security = putting the post-it under

Re: caching engines

2009-09-16 Thread Martin Westin
Since you ask, I'd say file. Sorry, that is my least favorite answer to get. All the others require special setups. All the others are better than file under the right circumstances. APC and XCache provide a big performance boost if you need it and like installing php extensions yourself.

Re: Bug?

2009-09-15 Thread Martin Westin
If you really did set username, email to unique and not username unique and email unique (see the difference?) all is as it should be. In the first instance (one index combining the two fields) would have to have the same username and email combination for MySQLs index to throw an error. Is

Re: Cache Problem with safari 4

2009-09-14 Thread Martin Westin
then see display time Firefox and IE will show you new time but Safari still display cache time. That's why I mention Safari still cache. Thanks On Sep 11, 2:03 pm, Martin Westin martin.westin...@gmail.com wrote: I am not sure that is a cache problem or anything you can fix. Are you sure I

Re: session lost during ajax calls problem

2009-09-14 Thread Martin Westin
You might want to looks at some of these suggested solutions. http://bakery.cakephp.org/articles/view/redirects-with-ajax Pick the one that works the best for you. /Martin On Sep 11, 6:03 am, learning_cake_php lunaro...@gmail.com wrote: so theres no way on switching to normal redirect from

Re: isUnique Validation for Multiple Fields

2009-09-14 Thread Martin Westin
I could easily skip that validation and always let a new vote through. Only when the same user votes again their original vote would be updated. That is totally a matter of taste. I just happen to like being abel to change my mind and update my vote. That doen't work better for rating users,

Re: Cache Problem with safari 4

2009-09-11 Thread Martin Westin
I am not sure that is a cache problem or anything you can fix. Are you sure I use Safari 4 all the time and I am under the impression that the browser sometimes doesn't do any request at all when using the back button. It simply re-displays what it a few moments ago. I have not checked if the

Re: Release: CakePHP 1.2.5

2009-09-10 Thread Martin Westin
Thank you so much for this update. The php 5.3 fixes especially. --~--~-~--~~~---~--~~ 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

Re: session lost during ajax calls problem

2009-09-10 Thread Martin Westin
For that one there is no one-click simple trick. I guess you could return an ajax html snippet containing a javascript that trigger a redirect... unless it gets captured in some security check. What I have done though is to have that logic in javascript. Cake simply returns success or error on

Re: PHP IDEs

2009-09-10 Thread Martin Westin
On Sep 10, 1:05 pm, jason m ippatsu.ya...@gmail.com wrote: The only downside of textmate is that it doesn't really support any other encodings besides UTF8. Jason Say what? How do you mean Textmate doesn't support any other encoding? It works quite happily in 8859-1 (aka latin1) and Mac

Re: Problem with Security component and form submit

2009-09-10 Thread Martin Westin
I don't think is affects your problem but in the code you posted the html would be invalid. The form and /form should be at the same hierarchical leven in the html but you have the end inside a div. A 404 is what you would get is SecurityComponent decided to kick you in the behind. It is called

Re: Flow Control with Ajax

2009-09-09 Thread Martin Westin
On successful login, Auth Component does a redirect to either: 1. where you were before you were redirected to the login screen (not in your case I guess) 2. whatever default you have set 3. the website index page. (I think that is the correct order) I guess your problem is that your ajax call

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

2009-09-09 Thread Martin Westin
...acos and aros are still complicated for me this time..hehe On Sep 8, 12:02 am, Martin Westin martin.westin...@gmail.com wrote: I agree with the good doctor. One detail you may not realise is that it matters little if if you name the model correctly unless you also specify

Re: Two paginations on one page, can't figure it out

2009-09-09 Thread Martin Westin
Yes I saw defaultModel too after I posted. Both my paginated models were in paginator's params array but using them both seems, as you say, to only affect parst of the helper. For example, numbers pulls the correct values provided by the component and uses them for counting pages but does not

Re: How to Call Library Function from a Component

2009-09-09 Thread Martin Westin
I believe you can call it statically like this: Security::hash(...); /Martin On Sep 9, 8:45 am, Sarah sarah.e.p.jo...@gmail.com wrote: I want to call the hash function from the Core Security Library. In this controller I can simply call $this-hash(...); but in the component I get an

Re: session lost during ajax calls problem

2009-09-09 Thread Martin Westin
At security level high CakePHP creates a new session id for each request (often enough anyway). This behaviour might be causing you problems using Ajax. The intermittent aspect of the problem is because ajax will be fine as long as you don't make use of the A too much. Cake will only allow one

Re: Setting Up CakePHP on MAC with MAMP and Eclipse

2009-09-08 Thread Martin Westin
will definitely have more than one project... any guidance would be appreciated. Thank you in advance! On Sep 6, 11:32 pm, Martin Westin martin.westin...@gmail.com wrote: A few points for installing Cake to run in Mamp. Simplest way is to drop the whole Cake folder (containing cake,app

Re: help::sending data from one controller to another controller

2009-09-08 Thread Martin Westin
You have had your first bump into the wall of strictly linking views, controller and model. I generally tend to link the views and controller more and keep my models more loose. That is, I don't have a problem with using ModelB in ControllerA. I read that you want one click to save both Contact

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

2009-09-08 Thread Martin Westin
I agree with the good doctor. One detail you may not realise is that it matters little if if you name the model correctly unless you also specify with on the associations... and that you do it from both sides. Unless you specify with and specify the Modelname Cake might be loading AppModel (I

Two paginations on one page, can't figure it out

2009-09-08 Thread Martin Westin
Hi, I just can't seem to figure this out. I want to paginate two models on the same page. I can't figure out how to make the Helper output links correctly. Example: $paginator-numbers(array('model'='ModelA')); $paginator-numbers(array('model'='ModelB')); I thought that would be it. Those two

  1   2   3   4   5   >