Re: Sessions and Redirect

2009-08-12 Thread Dr. Loboto
Try first retrieve your saved data from session in login action, then do login, and on success write your data back to session (maybe on fail too - don't know). Looks like session is re-created on login. On Aug 12, 5:03 am, LS wrote: > Er... > Sorry, you're right. > My code example was wrong, bu

Re: unwanted white space in html

2009-08-12 Thread persianshadow
i found my problem but need solution ! my layout and view file contain some Asian (persian) Character and i must save my file with UTF8 encode instead ANSI . when i save my view file with ANSI encode everything goes Right way and css appear in head tag and don't show unwanted white spaces but w

Re: expired cache files

2009-08-12 Thread Dr. Loboto
Check cache.php - looks like massive expired files deletion occurs on file cache engine start. On Aug 11, 10:50 pm, zonium wrote: > Any insight everyone? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" gro

Re: How to add a style to individual select options?

2009-08-12 Thread DavidH
Thanks for your help guys. Cheers David On Aug 12, 3:20 pm, "Brendon Kozlowski (Realm)" wrote: > That actually has recently been added (clarified) to the cookbook > documentation.http://book.cakephp.org/revisions/view/9876/Automagic-Form-Elements > "Besides the specific input options found bel

Saving SQL query generated by the framework

2009-08-12 Thread Abhishek
Hi, How can i get the SQL query generated by the framework. It does get saved in the log, but in that case along with that lot of other information is saved. I need to store just the SQL query generated as it is in a database so that i can retrieve them later and run them. Any idea how do i go a

Re: unwanted white space in html

2009-08-12 Thread persianshadow
i set my css link with your parameters but now don't insert css link in my html document ! only with this format : $html->css('screen'); work but with above bugs . also cakephp don't show any Error and i confuse with this problem :(. On Aug 13, 1:52 am, brian wrote: > You're not passing the p

Re: getting a 404 with Media View

2009-08-12 Thread Stinkbug
Thanks brian! I finally got around to testing this in our production environment tonight. Sure enough, the path wasn't right. I added APP . to the front of my path and it fixed the problem. Thanks for the advice. It's still odd to me that it works in our test environment fine without it, but

SaveAll help

2009-08-12 Thread Dave Maharaj :: WidePixels.com
I have a simple form: input('Platform', array('multiple'=>'checkbox','label'=>false, 'div' => false)); echo $form->input('Addition.aplatform'); ?> The 'Platform', array('multiple'=>'checkbox','label'=>false, 'div' => false)); is a HABTM relationship the 'Addition.aplatform'); is a hasOne

git clone: Permission denied

2009-08-12 Thread BeanDog
The new CakePHP code site, http://code.cakephp.org/source, says to use "git clone d...@code.cakephp.org:cakephp.git" to get a copy of the code (I assume that's the latest 1.2 stable code). However, when I try to do that, I get the following error: Permission denied (publickey). fatal: The remote

Re: get data from another table

2009-08-12 Thread paulos nikolo
I will try your solutions and i if i still have prob i 'll let you know.I really appreciate your knowledge and time of you. Ty very much. 2009/8/13 brian > > I think this might work alright: > > $data = $this->Location->find( >'all', >array( >'conditions' => array

Re: Tree Behaviour problems

2009-08-12 Thread Cris Sawfish
Seriously now my brains are all over the wall!! Thank you very much! I was ready to give up with that! On 13 Αύγ, 01:59, brian wrote: > That error occurs when Cake doesn't recognise a function/method, so it > passes it directly to the DB query. The problem is that you have > $actAs; it should be

Re: Tree Behaviour problems

2009-08-12 Thread brian
That error occurs when Cake doesn't recognise a function/method, so it passes it directly to the DB query. The problem is that you have $actAs; it should be $actsAs. A fairly common error, I think. As for the model being passed as a param, you can ignore it. The behavior takes care of that. The d

Re: unwanted white space in html

2009-08-12 Thread brian
You're not passing the param correctly. Try this: echo $html->css('screen', 'stylesheet', null, false); On Wed, Aug 12, 2009 at 4:30 PM, persianshadow wrote: > > hi brian > > yes ! my css links insert in body tag ! > > now i change these : > > 1 - add to head tag > > 2 - and my css tags in head

Re: get data from another table

2009-08-12 Thread brian
I think this might work alright: $data = $this->Location->find( 'all', array( 'conditions' => array( 'Location.id' => array(1,2,3,4) ), 'recursive' => -1 ) ); /* there's probably an elegant way to do

Tree Behaviour problems

2009-08-12 Thread Cris Sawfish
Hi 2 all, I'm building a web app and a I have to store some data in hierarhical order (parent - child) similar to the 'categories example' in the documentation. So I decided to use the Tree behaviour. To practice a little bit with the TreeBehaviour, I tried to follow the example but without any l

Wrapping a Vendor PHP API into a Model for Validation Coolness?

2009-08-12 Thread eusef
Hi all, I'm looking at taking an existing PHP library (that acceses external data through SOAPish requests) and creating a Model for it (accessible to my Controller). I'm not sure if this is the best approach though. I thought I would look to you all for some thoughts. The goal is to : Simply a

Re: get data from another table

2009-08-12 Thread paulos nikolo
Ok i get it.i had that idea on my mind.Now if i want to copy rows with the id 1,2,3,4... in locations table to destinations table i should do something like that? $this->Destination-=$this->Location; $this->Destination->save($this->data) ?? I mean what's the appropriate query to database to implem

Re: unwanted white space in html

2009-08-12 Thread persianshadow
hi brian yes ! my css links insert in body tag ! now i change these : 1 - add to head tag 2 - and my css tags in head tag : css('screen'); echo $html->css('custom'); ?> and i do this : $html->css('screen', $inline=false) but don't work and css links stay in body tag. please help me for rig

Re: HTML helper in function?

2009-08-12 Thread Josh
Ahhh... passing a handle as an argument. It seems so obvious now. Thanks I have actually already moved things to a helper, which makes more sense anyway. The helper I have will suit my needs fine this time around. It will be easy to wrap tags around the menu elements when I get around to the CSS

Re: Using Javascript link

2009-08-12 Thread brian
Sorry, I forgot to get back to you; I was in the middle of a crisis. cake/../img/picturename.gif That path doesn't look right. I think there's something deeper wrong. And what about that in your view? Is it so, or is that actually in your layout? And, what I meant about rollovers is that, whe

Re: get data from another table

2009-08-12 Thread brian
So the locations data is not kept? I think what I'd do is not bother with a relation between the two models but use both models in the locations_controller: var $uses = array('Location', 'Destination'); Then you could do $this->Destination->etc. On Wed, Aug 12, 2009 at 2:45 PM, paulos nikolo wr

Re: Using Javascript link

2009-08-12 Thread Sarah
Nevermind, I finally figured out the location of the images. I set the 'address' of the alt pictures to: cake/../img/picturename.gif so it would have been: element.src = cake/../img/picturename.gif :) --~--~-~--~~~---~--~~ You received this message because you

Re: get data from another table

2009-08-12 Thread paulos nikolo
Ty Brian for you reply.I have 2 models destination,location and 2 controllers destinations and locations_controller.I dont have set a relation yet between them (i wasn't sure if it is necessary),but here is the idea.The initial data are saved in locations_controller,which contain some search data d

Re: server transfer problem

2009-08-12 Thread brian
Vijay, thanks, but mod_rewrite is not available on this server. I'm sure now that this is not a Cake problem. On Wed, Aug 12, 2009 at 1:59 PM, Vijay Kumbhar wrote: > Hello Brain, > > Please edit the .htaccess in the root folder & app folder. > Add the app/webroot instead of webroot. > > On Wed,

Re: ajax remoteFunction problem

2009-08-12 Thread bondo
The function h($text) in /cake/basics.php has changed and is causing the problem for me. It now uses htmlspecialchars which escapes the single quotes. In the beta version it didn't do this. Without modifying that code, how can I solve my problem so that it does not escape the single quote? On Au

Re: server transfer problem

2009-08-12 Thread Vijay Kumbhar
Hello Brain, Please edit the .htaccess in the root folder & app folder. Add the app/webroot instead of webroot. On Wed, Aug 12, 2009 at 9:37 PM, brian wrote: > > @Robert, the .htaccess files were already removed and the App.baseUrl > line uncommented. > > @Jonathon, I'm not completely certain w

Re: Error baking using 1.3 dev

2009-08-12 Thread mark_story
Just clone from git. Packaging every fix into a tar.gz is impossible and will not be done. But for now you can either sit tight until another tar is packaged, or clone from git. -Mark On Aug 12, 3:36 am, Reijer wrote: > Hello Mark, > > is it possible to download the 1.3 branch with the fix, w

Re: DeleteQuery in HABTM is like 'dependent'=> true in hasMany associations?

2009-08-12 Thread Josoroma
Sorry, typo error, is: Articles hasandBelognsToMany Tags --~--~-~--~~~---~--~~ 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,

Re: Containable, Pagination and HABTM

2009-08-12 Thread sunertl
On 12 Aug., 19:00, brian wrote: > Why not just use find()? Can a User belong to so many Groups that you > need to paginate them? Normally, a user will belong to about 10 groups, but the "moderators" belong to much more (30-50). Also groups are used only for one year tops and I would like to keep

DeleteQuery in HABTM is like 'dependent'=> true in hasMany associations?

2009-08-12 Thread Josoroma
Im using the following structure: User hasMany Listing Listing hasMany Contacts Listings hasAndBelongsToMany Articles Articles hasMany Tags When i delete a User or a Listing all their associated Listings and Articles are successfully deleted. But not their Tags. Listings and Articles are deleted

Scaffolding with data in different PostgreSQL schemas

2009-08-12 Thread Antônio Marco
Hi, folks! I'm having a problem with Scaffolding with data in different PostgreSQL schemas. There are 2 different PostgreSQL schemas with related tables: - dme - habitacao Some habitation's tables has foreign key to dme's tables. There are 2 different Cake application each one with your own m

ajax remoteFunction problem

2009-08-12 Thread bondo
I just upgrade from an old 1.2beta version to 1.2.3.8166 but I'm having a problem with using the remoteFunction now. This is the code I have: function new_heading(heading) { var name = prompt("Enter a heading name", "");

Re: get data from another table

2009-08-12 Thread brian
Which controller are you working with? Do you have both Location & Destination models? How are they associated? What fields/columns do they have? If you set up the $data correctly, you should be able to do, eg: $this->Location->Destination->set($data); $this->Location->Destination->save(); On

Re: Containable, Pagination and HABTM

2009-08-12 Thread brian
Why not just use find()? Can a User belong to so many Groups that you need to paginate them? On Wed, Aug 12, 2009 at 8:49 AM, sunertl wrote: > > Hey there, > after hours of googling and reading tutorials I am desperate now and > seek your help. > > I am working with Cake 1.2.4.8284, I have two mod

Re: Is there a way to select an action from a double-click?

2009-08-12 Thread FrederickD
Those are really great answers and give me a direction to look to do more research. Thanks very much for comments! On Aug 12, 8:53 am, Bart wrote: > Frederick, > > There are many options. To get the best feel you are probably looking > at some ajax. You can use many different list controls that

Re: unwanted white space in html

2009-08-12 Thread brian
It looks to me like a CSS issue. Newlines in the source shouldn't have any affect at all on how the page renders. Look at the HTML tab in Firebug and hover the cursor over the surrounding elements in the source to see the margin/padding. If you click on the tag, you can see the style rules on the

Re: cake media plugin imagemagick adapter

2009-08-12 Thread David Persson
Hi Josoroma, Is the error coming from imagick or gd? It would help if you could post the complete error message and explain with which kind of image files the error is triggered (or even upload the image somewhere so that I can reproduce the issue). Adapters are tried in the order: BasicImage, I

Re: HTML helper in function?

2009-08-12 Thread brian
Pass a handle to the helper to your function: outputMenu($html, $linkTree, $level); function outputMenu(&$html, $array, $level) { Even better, have a look at Andy Dawson's TreeHelper. I think it's precisely what you need for this. http://bakery.cakephp.org/articles/view/tree-helper-1 Let me k

Re: Fatal error: Class 'Dispatcher' not found - please help

2009-08-12 Thread brian
How are your directories structured? Specifcally, app, webroot, and the cake (libs) dir. Look in webroot/index.php for the line: $Dispatcher = new Dispatcher(); Just above that, put: die(CAKE_CORE_INCLUDE_PATH); On Mon, Aug 10, 2009 at 11:15 PM, RAAJ wrote: > > > i have gotten this messege

Re: Uploading file issue - worning mkdir()

2009-08-12 Thread brian
I doubt that it's a good idea to leave that commented. Try putting this just above those lines: die(debug($pathname)); Set debug to 2 and see what that shows. Maybe the path is wrong somehow. On Wed, Aug 12, 2009 at 12:57 AM, leafchild book wrote: > I'm trying to upload to /webroot/img/uploads/

Re: Search function

2009-08-12 Thread Luke
You are missing a few OR in your below text, I have tried it out and get all the needed OR, did you just keft it out below or what is the issue? Oh and by the way of course you will need a WHERE aswell in the first part $sql = "SELECT * FROM table"; I forgot that one. On 12 Aug., 17:00, "Dave Ma

Re: server transfer problem

2009-08-12 Thread brian
@Robert, the .htaccess files were already removed and the App.baseUrl line uncommented. @Jonathon, I'm not completely certain what you mean, but I know that it *was* working. PHP, that is. I'm actually quite sure that the problem is not with Cake, though. It probably is due to something else wit

RE: Search function

2009-08-12 Thread Dave Maharaj :: WidePixels.com
Yeah that's the basic idea to build the "Post.title LIKE '%" . $value. "%' OR Post.description LIKE '%" . $value . "%' "; string from the user submitted text So if there are 3 words it ends up "Post.title LIKE '%" . $value. "%' OR Post.description LIKE '%" . $value . "%' ";"Post.title LIKE '%" .

Re: Will speed be affected?

2009-08-12 Thread Jamie
I can tell you from experience that you will NOT experience any significant slowdown. I did just this for a CMS I made with CakePHP (I'm in the middle of writing a blog post about the process). Basically, I had a core library with "cms_" prefixed versions of my controllers and models - so CmsUser

Re: Calling save attempts to insert instead of update

2009-08-12 Thread Robert P
Model::saveField() still requires a valid primary key, which I suspect he is setting to NULL at the beginning of his method. On Aug 12, 9:30 pm, eusef wrote: > If you know which field you need to update perhaps you could try > using : > >    saveField(string $fieldName, string $fieldValue, $vali

Session.php session_cache_limiter value

2009-08-12 Thread Ron
HI 5.2.4-2ubuntu5.6 Cakephp 1.2.1.8004 I'm confused by a behaviour that cake is exhibiting. I have a site which some users access from behind a proxy server. Those users behind the proxy report that they are seing personal information for users other than themselves. I examined the headers of

Re: Calling save attempts to insert instead of update

2009-08-12 Thread eusef
If you know which field you need to update perhaps you could try using : saveField(string $fieldName, string $fieldValue, $validate = false) From : http://book.cakephp.org/view/75/Saving-Your-Data GL - Phil On Aug 11, 8:03 pm, tron wrote: > I have a problem with one specific controller

Re: Default values in select lists

2009-08-12 Thread jburns
Thanks - that worked spot on. In fact I shortened it a bit to: echo $form->input('listname', array('options'=>array('Please choose a value') + $mylist)); So simple when you know the answer! Thank you. On Aug 12, 4:08 pm, Marcelo Andrade wrote: > > On Aug 11, 9:21 am, arif hossen wrote: > >>

unwanted white space in html

2009-08-12 Thread persianshadow
hi i design my html code with XHtml and CSS and add to my cakephp application but in html view i have two unwanted white space that don't have any codes in source view of html output view image of my page with unwanted white space : http://s1d4.turboimagehost.com/sp/ec096e69ec1f5ec9d0f5939bf

Re: HTML helper in function?

2009-08-12 Thread Josh
@James - The code I have up there should produce the error. Throw the $this-> object reference in front of the html->link() to get the reference to a non-object error @Martin - Are you sure you can do that with an object? I think Global can only be applied to variables, no? I'll try it out of cur

Re: Default values in select lists

2009-08-12 Thread Marcelo Andrade
> On Aug 11, 9:21 am, arif hossen wrote: >> You can use below code cakephp format. >> >> > >> echo $html->input('listname',array('options'=>$mylist,'Selected'=>'Please >> select a value)); Cake 1.1? On Wed, Aug 12, 2009 at 2:51 AM, jburns wrote: > > This doesn't add a new value to the list, j

Multiple hasAndBelongsToMany associations

2009-08-12 Thread jburns
I have a properties (as in houses) table and a users table. I have a number of tables that join these two, for example property_viewings, property_favourites and property_ratings. The table structures are quite simple; an id column, property_id, user_id and occasionally some additional fields. I'd

Re: Certain strings crashing CakePHP - where do I look first?

2009-08-12 Thread Brendon Kozlowski (Realm)
My first thought, is "would it be possible to upgrade to CakePHP v1.2.4 to possibly remove any lingering effects of an older code base?" My second thought is, "If upgrading is out of the question, did you try 'baking' a very simple MVC based on a test table in your DB that you can attempt to dupl

Re: How to add a style to individual select options?

2009-08-12 Thread Brendon Kozlowski (Realm)
That actually has recently been added (clarified) to the cookbook documentation. http://book.cakephp.org/revisions/view/9876/Automagic-Form-Elements "Besides the specific input options found below you can specify any html attribute (for instance onfocus). For more information on $options and $htm

Re: Can not get the parameter from url

2009-08-12 Thread joshua
I agree with you. It seems the post.id will be better than a none friendly URL in my case. I will choose the other way to implement this and it really wast me a lot of time. Robert, thanks for your suggestion. On Wed, Aug 12, 2009 at 9:44 PM, Robert P wrote: > > If a character is not URL-friendl

Re: Search function

2009-08-12 Thread Luke
Hi Dave, Maybe not the nicest solution, but this should work: $i=0; // This is your counter // Now build your SQL String $sql = "SELECT * FROM table"; foreach ($string as $key => $value) { $value = trim($value); //strip white space befor and

Re: How to add a style to individual select options?

2009-08-12 Thread grigri
Sure, it's (afaik) undocumented, but it can be done: create('Bacon'); $colours = array( array('name' => 'Red', 'value' => '#F00', 'style' => 'background- color: #F00'), array('name' => 'Green', 'value' => '#0F0', 'style' => 'background- color: #0F0'), array('name' => 'B

Re: create .po file from database table (multilingual, l10n I18n)

2009-08-12 Thread euromark (munich)
you should take a look at my ideas a couple of weeks ago http://www.cakephpforum.net/index.php?showtopic=1588 i am almost finished with this plugin (as i had the same intention you have - keeping the work at a minimum, especially with multiple sites to work with) my ideas go a little bit further

Re: clearCache() unexpected behavior

2009-08-12 Thread Martin Westin
Yes that was what I meant, but I probably wasn't clear enough. But I don't understand why it should do even that. clearCache() with no filename does that already. Why would I want the "fallback" behavior of - if 'cachefile' does not exist then delete every other cache file - in the view directory

Re: Log Errors when debug = 0?

2009-08-12 Thread Martin Westin
That doesn't look too bad... quite nice actually. I might have to give it a try some day soon. thanks. On Aug 12, 9:45 am, David wrote: > Thanks for the tip Martin - I think I've worked it out. > > First I overrode the Debugger class in a new class called TDebugger, > which I saved in app/ven

Re: Is there a way to select an action from a double-click?

2009-08-12 Thread Bart
Frederick, There are many options. To get the best feel you are probably looking at some ajax. You can use many different list controls that will give you the browse feel. As far as using html there are options there too. For example, you could turn your title or name field into an edit link. Ju

Re: Is there a way to select an action from a double-click?

2009-08-12 Thread euromark (munich)
nothing easier than that with jquery: $("td.clickMe").dblclick(function() { ... }); On 12 Aug., 15:41, Ian R wrote: > On Aug 12, 9:02 am, FrederickD wrote: > > > I'm sorry my post was not more clear. I know in things Internet- > > related there is no double-click like in a local application. H

Re: Can not get the parameter from url

2009-08-12 Thread Robert P
If a character is not URL-friendly without being encoded, then in my mind it serves no purpose in a clean URL. If you are running an internationalised multi-lingual website then is it not feasible to rely on something other than a localised URL segment to serve the content? Surely something like

Re: Is there a way to select an action from a double-click?

2009-08-12 Thread Ian R
On Aug 12, 9:02 am, FrederickD wrote: > I'm sorry my post was not more clear. I know in things Internet- > related there is no double-click like in a local application. However, > I cannot figure out how to have a row in a list of users (from /users/ > index.ctp), or even an attribute within that

Re: How to add a style to individual select options?

2009-08-12 Thread rich...@home
Not out of the box, no. There's nothing stopping you creating a ColourPickerHelper of your own though. On Aug 12, 1:45 pm, DavidH wrote: > Hi > > Is there any way of passing style settings for each select option when > using $form->select? > > I've a drop down that allows users to choose a col

Re: Ubdate HABTM and hasMany

2009-08-12 Thread Luke
Hi, i have to get back to this topic, since I still have not found the solution. When I print out the $this->data array, i get the below. So now not forget, recipe HABTM subcategories recipe hasMany ingredients Array ( [Recipe] => Array ( [id] => 6 [RecipeUI

Re: Is there a way to select an action from a double-click?

2009-08-12 Thread FrederickD
I'm sorry my post was not more clear. I know in things Internet- related there is no double-click like in a local application. However, I cannot figure out how to have a row in a list of users (from /users/ index.ctp), or even an attribute within that row (perhaps 'username'), be a hot spot so tha

RE: Search function

2009-08-12 Thread Dave Maharaj :: WidePixels.com
Yeah what I am trying is the 'LIKE statement with OR between them'. I split the terms @ ',' into an array , trim the spaces around each word so I am left strictly with the values. But having a hard time making the search string to create. //create an array of search terms if more than 1 was enter

Containable, Pagination and HABTM

2009-08-12 Thread sunertl
Hey there, after hours of googling and reading tutorials I am desperate now and seek your help. I am working with Cake 1.2.4.8284, I have two models, User (table users) and Group (table group) where User HABTM Group. The join table is called groups_users, it contains user_id and group_id and an a

How to add a style to individual select options?

2009-08-12 Thread DavidH
Hi Is there any way of passing style settings for each select option when using $form->select? I've a drop down that allows users to choose a colour from a long list. It would be cool(ish) if the each option in the select had the background-color set to the actual colour. Thanks David --~--~--

Re: Can not get the parameter from url

2009-08-12 Thread joshua
I got what you say. Consider multi-language case. For English, I use following code to make the friendly url [code] $string = strtolower($string); // Any non valid characters will be treated as _, also remove duplicate _ $string = preg_replace('/[^a-z0-9_]/i', '-

Re: Error baking using 1.3 dev

2009-08-12 Thread Reijer
Hello Mark, is it possible to download the 1.3 branch with the fix, without Developer Access? Reijer On 6 aug, 19:46, mark_story wrote: > No problem, sorry there was an issue at all.  It seems that gwoo has > pushed the fix, so it should be working now. > > -Mark > > On Aug 5, 9:09 pm, Isak Ri

create .po file from database table (multilingual, l10n I18n)

2009-08-12 Thread ava
Hello, building multilingual websites is an ongoing process because content of websites often change. Therefore translations have to be done for every new release. Instead of extracting the po files and then translation the file content I wish to do something smarter. - keep translations in a db

Re: CakePHP Editor/IDE

2009-08-12 Thread Sergio Pola
I use eclipse-pdt. I add cake like a library and I the IDE provide code completation and phpdoc preview of the selected function or variable. If you want to have code completation for a model in the controller you must declare the variable explicity like $person = new Person(); and comment the lin

Re: Can not get the parameter from url

2009-08-12 Thread Robert P
That URL looks extremely unfriendly to me. I can understand urlencode (), but why addslashes() as well? This has been covered many, many, many times before. For friendly & clean URLs use: Inflector::slug($url, '-'); On Aug 12, 8:17 pm, joshua wrote: > I want to make a friendly url in my app

Can not get the parameter from url

2009-08-12 Thread joshua
I want to make a friendly url in my app. So assume the url likes following: [code] var $url = "what's the project name is?"; [/code] Before I insert this url into database, I want to encode it firstly. [code] $url = urlencode(addslashes($url)); //$url ='what%26%23039%3Bs+the+project+name+is%3F' [/

Re: HTML helper in function?

2009-08-12 Thread grigri
Hi Josh, With that sort of code, you'd be better off putting it in your own helper. That helper can load its own helpers, so doing links wouldn't be a problem. This thread: http://groups.google.com/group/cake-php/browse_thread/thread/f3a8243e2226c696 deals with this approach, but for radio boxe

Re: Function Find - problem

2009-08-12 Thread boobalan
Thank you very much. On Aug 11, 8:25 pm, CobaltShark wrote: > It would be helpful if you posted the actual code of your find(), but > it would appear that you are not forming your conditions array > correctly. I haven't had any issues using LIKE, and maybe this link > will help :http://book.cake

Re: Search function

2009-08-12 Thread John Andersen
As soon as you have more than one word, for which to make a search for within a text, it becomes more complex! You can do as JamesF wrote, write the find, so each word is included in a LIKE statement with OR between them. You can also do as Smelly Eddie wrote, use tags instead, but the problem is

Re: How can I leave entered value even there is an errro and couldn't complete

2009-08-12 Thread Laeffe
On Aug 11, 11:06 am, leafchild wrote: > How can I get "$this->data" has "recursive = 6" data to avoid getting > "undefined index" error? I believe i had the same problem as you. Or in my case it was an overbelief in cakephp :P What you need to do is to ether re-read the original-data and then m

Re: Certain strings crashing CakePHP - where do I look first?

2009-08-12 Thread technicaltitch
Thanks hugely delocalizer and bert and anyone else who reads this. I am trying to get the site working on Apache locally (I did have it but the hard disk crashed a couple months ago and I'm struggling hence the delay). I hadn't come across debugging PHP before - sounds very useful. What is the ge

Re: Search function

2009-08-12 Thread Smelly Eddie
better yet avvoid storing multiplee values in one field. Create a reference table (tags) and add those values one per record. It. Will save the code maintainers sanity down the road On Aug 11, 11:32 pm, JamesF wrote: > some fancy combos 'LIKE' and 'OR' in your find conditions array should > get

get data from another table

2009-08-12 Thread Paulos23
Hi ppl, I have a problem with my app.In particular i have a locations_controller where i receive some xml data ,which i parse them and save them in the locations table.The locations table usage is for cache reasons so i use a 2nd table destinations to save final choices of user.How can i get the d

Form Helper

2009-08-12 Thread hmvrulz
I have two tables restaurants n cuisines which are related to each other as HATBM table cusinies have certain fixed entries - 54 number i restarurant can hve any number of cuisines. on baking the application this came with a multiple select. since i wanted check boxes i used array( 'type' => 's

Re: wrapper function not working!

2009-08-12 Thread John Andersen
No problem :) For your information - if you do not specify an action in the form- >create statement, cakePHP default to the add action, which is why your register form invokes the add action in your controller! Enjoy, John On Aug 12, 11:46 am, armen wrote: > Thank you man. > Im a newbie as

Re: wrapper function not working!

2009-08-12 Thread armen
Thank you man. Im a newbie as you could tell. -Armen On Aug 12, 1:07 am, John Andersen wrote: > Thanks Armen, > > Your register.ctp is missing the action parameter in the form->create > statement! Compare it with the login.ctp, where it is correctly > specified! > > As soon as you specify the re

Re: Currency precision

2009-08-12 Thread jburns
Perfect - thank you. On Aug 12, 8:26 am, Robert P wrote: > After reviewing /cake/libs/view/helpers/number.php try: > >     $number->currency($property['Property']['price'], 'GBP', array > ('places' => 0)); > > If the documentation doesn't answer your question, the source will. > > On Aug 12, 1:5

Re: wrapper function not working!

2009-08-12 Thread John Andersen
Thanks Armen, Your register.ctp is missing the action parameter in the form->create statement! Compare it with the login.ctp, where it is correctly specified! As soon as you specify the register action in the form->create statement, it will invoke the register action in your controller! Best wi

Re: HTML helper in function?

2009-08-12 Thread Martin Westin
I don't know how you do it James. I just did a quick test in a view and defining a function inline in the view will not provide that function with access to the local variables outside the function ($html, $form...) One ugly way of making it work is to make a global reference to the html helper (

Re: Log Errors when debug = 0?

2009-08-12 Thread David
Thanks for the tip Martin - I think I've worked it out. First I overrode the Debugger class in a new class called TDebugger, which I saved in app/vendors: App::import('Core', 'Debugger'); class TDebugger extends Debugger { function handleError($code, $description, $file = null, $line = n

Re: Calling save attempts to insert instead of update

2009-08-12 Thread Robert P
If it's showing the correct values when viewing but not when saving, then the form might be submitting to /employees/edit and not to / employees/edit/:id as you're presuming. 1. Does it work if you remove the line ($this->Employee->id = $id)? 2. Replace pr() with debug(). What is the output in ea

Re: Will speed be affected?

2009-08-12 Thread Martin Westin
I don't think that will slow things down significantly. Cake caches paths (in debug=0) and locations of classes. Logically the more directories php has as include paths the more time an include will take but that is also very little extra time and probably hardly measurable in this case. /Martin

Re: Currency precision

2009-08-12 Thread Robert P
After reviewing /cake/libs/view/helpers/number.php try: $number->currency($property['Property']['price'], 'GBP', array ('places' => 0)); If the documentation doesn't answer your question, the source will. On Aug 12, 1:56 pm, jburns wrote: > I'd like to take a number and display it as curre

Re: Custom library functions

2009-08-12 Thread alaxos
Excellent, that will really help to keep my code clean. Thanks a lot for your answers, nIcO On 11 août, 17:13, Martin Westin wrote: > If you start adding more functions you may want to put them into a > separate file. > The top of my bootstrap.php looks like this: > > // This would mess things