Determine to insert or update data in beforeValidate().

2010-08-03 Thread Lapinski
Any input? Appreciate. --Lapinski 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, send email to cake-php@googleg

Re: Select Distinct only for Unique fields?

2009-10-28 Thread lapinski
What do you mean by "it doesn't work"...? any more details? --Lapinski gimperdaniel wrote: > > > I am having a problem with SELECT DISTINCT > > This is what I have in my model: > > This works: > > $this->find('all', array('fie

Manipulating data fields with different array structure in model callback methods

2009-10-27 Thread lapinski
uot; way to handle this, or I have to make a if-else condition to go through all the possible scenarios case by case? Thanks! --Lapinski -- View this message in context: http://www.nabble.com/Manipulating-data-fields-with-different-array-structure-in-model-callback-methods-tp26078723p26078723.html S

Validating data from single or multiple records.

2009-10-27 Thread lapinski
ld'] array['ModelName']['field'] array['ParentModelName']['ModelName']['field'] array['ParentModelName'][0]['ModelName']['field'] Is there a generic way to handle this, or I have to make a if-else condition t

Re: need some help with routes...

2009-10-16 Thread lapinski
* matches everything (including /), so your syntax will not only match what you wanted, but also match some URLs that you may not want (e.g. '/artist/ARTISTNAME/this_is_not_album_name/album/ALBUMNAME'). Lapinski gimperdaniel wrote: > > > Ok, this is what I have now..

Re: How to make this query the Cake way?

2009-10-13 Thread lapinski
you'll need to rebind Robot hasOne Tag which I am not sure if it will get everything you want. See this post by teknoid for more details: http://teknoid.wordpress.com/2008/07/17/forcing-an-sql-join-in-cakephp/ Lapinski Xoubaman wrote: > > > Robot HABTM Tag > User hasMany Rob

Re: Paginate - order clause is ambiguous!

2009-09-22 Thread lapinski
Try this: var $paginate = array ('order' => 'Page.index'); Lapinski mig_akira wrote: > > Hello everyone! > > I'm having a problem here. > > I have a table Pages, which belongsTo Categories. I'm using an "ordenable" >

Re: How to reach a url from form inputs without using ajax

2009-09-10 Thread lapinski
If I understand you correctly, you would want to use the routing feature in Cake. Under config/routes.php, add a reroute rule so that link/edit/id points to edit(id) action in Link controller. Lapinski Airzebeth wrote: > > > Hello everybody, > > I'm new with cak

Re: i am facing problem in Localization in CakePHP

2009-08-06 Thread lapinski
What exactly isn't working for you? anurag-16 wrote: > > > In recent Cakephp version (1.2x) i am try to implement multilanguage > app on cakephp by using guidelines of Cookbook online manual. > > http://book.cakephp.org/view/163/Localization-in-CakePHP > > But its not working... >

Re: Model Find With Conditions On Associated Models Not Working

2009-07-23 Thread lapinski
http://teknoid.wordpress.com/2008/07/17/forcing-an-sql-join-in-cakephp/ http://teknoid.wordpress.com/2008/09/05/example-of-cakephps-containable-for-deep-model-bindings/ Lapinski erturne wrote: > > > On Dec 7, 5:48 pm, brian wrote: >> I misinterpreted MenuPostings. I thought

Re: Model Association via "conditions" fails!

2009-07-23 Thread lapinski
http://teknoid.wordpress.com/2008/07/17/forcing-an-sql-join-in-cakephp/ Lapinski ohneworte-2 wrote: > > > Hello Together, > I want to link two Models without using a Foreign Key, but using some > Conditions instead. Here is my example: > > Model: > -

Re: 404 Header

2009-07-22 Thread lapinski
Did you turn debug mode off? Ma'moon Al-Akash wrote: > > Sure ... > HTTP/1.1 302 Found > Date: Tue, 21 Jul 2009 20:00:04 GMT > Server: Apache > X-Powered-By: PHP/5.2.6 > Location: http://video.maktoob.com/?url=sfgsd > Cache-Control: private, no-cache, no-store, proxy-revalidate, > no-transfo

Re: How to keep Session data clean and not messed up

2009-07-19 Thread lapinski
Why it doesn't work for you? If you need everything fresh every time a user starts over, then POST is a solution. Lapinski Raph-8 wrote: > > > Yes - I'm afraid you missed the point. ;) > > It's only an example and using $_POST it's not the solution IM

Re: Blank white screen on new upload

2009-07-16 Thread lapinski
Are you sure index.php under webroot/ is pointing to the right ROOT, APP_DIR and CAKE directories? Lapinski Lisa-69 wrote: > > > Hiya, > > Our client has a site built with CakePHP and has today had a prob with > their previous host - so we've quickly had to move it

Re: Localization - values in translated strings - my solution

2009-06-24 Thread lapinski
Thanks for your suggestion, but is there any way to accomplish this without changing the cake core? Lapinski Julien Buratto-5 wrote: > > > I thought that this could interest someone else. > > If you want to be able to translate strings which contains dynamic > data

Re: Change the content-type

2009-06-18 Thread lapinski
>header('Content-Type: text/xml'); I got an XML object in my responseXML. Are we missing something? Or the requesthandler is not working as wished? Lapinski jperras wrote: > > > Use the RequestHandlerComponent::respondAs method. This should set the > appropriate con

Re: xml not parse correctly

2009-06-13 Thread lapinski
my_xml_file.xml is not a valid xml file. a valid xml file needs to have a root node. so if you modify the file to include a root node (such as ...) then the parsing should work. Lapinski robert123 wrote: > > > i am using the below codes, took from the bakery, straight > &g

Re: Session.timeout vs session cookie expiration date

2009-06-11 Thread lapinski
I was having the same concern. I looked at session.php (under cake/libs/), in function __initSession(): security: high : $this->cookieLifeTime = 0 security: medium : $this->cookieLifeTime = 7 * 86400 security: low : $this->cookieLifeTime = 78894 foldiman wrote: > > > I haven't found an

Re: Telling PHP to put "&" NOT "&"

2009-05-04 Thread Lapinski
rray($value)){ >                         restore_html_ecoded_characters($pArray[$key]); >                 }else{ >                         $pArray[$key] = str_replace("_#", "&#", $value); >                 } >         } > > } > > Lapinski: About your sugge

Re: Telling PHP to put "&" NOT "&"

2009-05-04 Thread Lapinski
rray($value)){ >                         restore_html_ecoded_characters($pArray[$key]); >                 }else{ >                         $pArray[$key] = str_replace("_#", "&#", $value); >                 } >         } > > } > > Lapinski: About your sugge

Re: Telling PHP to put "&" NOT "&"

2009-05-04 Thread Lapinski
rray($value)){ >                         restore_html_ecoded_characters($pArray[$key]); >                 }else{ >                         $pArray[$key] = str_replace("_#", "&#", $value); >                 } >         } > > } > > Lapinski: About your sugge

Re: Telling PHP to put "&" NOT "&"

2009-05-02 Thread Lapinski
Why did you need to hack it this way? Why not just leave the user input intact and convert them to html entities by php? http://us3.php.net/htmlentities On May 2, 6:13 pm, rartavia wrote: > Hi there. > > Benedikt: I did try str_replace, preg_replace and strtr, same result. > >

Re: Search engine like function?

2009-05-02 Thread Lapinski
check out http://bakery.cakephp.org/articles/view/sphinx-behavior and see if it fits your need? On May 1, 9:00 am, mbourque wrote: > I am building a data warehouse site that contains a lot of customer info. I > need to allow users of my app to have a search page that lets them enter > natural

Re: Telling PHP to put "&" NOT "&"

2009-05-02 Thread Lapinski
did you try to debug your output right after the replacement? it looks to me that you're reading the XHTML output from the browser... On May 2, 12:29 am, rartavia wrote: > Hello, i'm trying to make a replace of a character in a string for an > '&'. I tried several ways of replacement but (cake