Re: Proper way to handle empty localization strings?

2010-04-21 Thread O.J. Tibi
Oh, and by the way, a follow up tip: if you need to embed variable values INSIDE your translation strings, you may want to use sprintf() and named parameters for argument swapping. Check http://php.net/sprintf for details on these. Cheers again! Check out the new CakePHP Questions site

Re: How to output UTF-8 sign?

2010-04-21 Thread John Andersen
Try to add a CSS class to the sort link and then use CSS to add something to the link. For example: [code] $paginator-sort('id', 'id', array('class' = 'asc'); [/code] and when clicked on, change into: [code] $paginator-sort('id', 'id', array('class' = 'desc'); [/code] Then with CSS make the

Re: View (form-input) - Disable word wrap?

2010-04-21 Thread sebb86
John Thanks a lot for all your help. In your example, is the cake.generic.css file the original? 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

Re: date display

2010-04-21 Thread violet nunda
thank you very much for the immediate response,i figured out that it was because of the css settings in the cake.generic.css.now forms are displaying well,now have to work on making the Interface appear better.i am also trying to work on implementing sending email to someone using

Re: How to output UTF-8 sign?

2010-04-21 Thread sebb86
Hello and sry that i have to ask again. But i dont know, what the correct syntax for the pagination is. At the moment i have: [code] ?php echo $paginator-sort(array('asc' ='id v', 'desc' ='id ^'), 'id'); ? [/code] How do i get class definitions inside? Check out the new CakePHP Questions site

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

2010-04-21 Thread j0n4s.h4rtm...@googlemail.com
Textmate.app Sequel Pro.app git PushPull via GitHub and Cyberduck.app Terminal.app + Cake Bake Console.app / Text Logs and Cake Debug Could use DebugKit Could use XDebug Could use Fixtures and Test Cases Check out the new CakePHP Questions site http://cakeqs.org and help others with their

How to avoid the redundant code, is it possible to write that code write in one function and we have to call other functions, please help me out

2010-04-21 Thread Narendra Padala
Hi all i am new to cake php please help me My problem is: common code for all the controller methods and other controller methods also --common code start--- if(!isset($intCurrentMenu)){ $intCurrentMenu = -1; //

Helpers in controllers

2010-04-21 Thread calvin
So I just encountered a situation where I'd like to use a helper in my controller even though this seems to break with Cake's MVC design. Googling the topic turned up a thread in this group in which loadHelper() is proposed as a means of doing just that, but it still seems to be discouraged. What

Advance Cakephp problem

2010-04-21 Thread accou...@myadengine.com
Hi, Anyone ever tried adword api with cake before? I got this problem, and don't know how to solve. Let say we have KeywordsController in cake, and within this controller we create new google keyword object, with new Keyword(). Then what happen was, the cakephp object Keyword, get overwritten

Re: Advance Cakephp problem

2010-04-21 Thread Jeremy Burns
Or rename your controller to something that doesn't clash with Google's? Jeremy Burns jeremybu...@me.com On 21 Apr 2010, at 08:27, accou...@myadengine.com wrote: Hi, Anyone ever tried adword api with cake before? I got this problem, and don't know how to solve. Let say we have

Re: Helpers in controllers

2010-04-21 Thread euromark
this question has been answered like a million times please try to search for it first! helper controller in the above search field gets http://groups.google.com/group/cake-php/browse_thread/thread/64c8ae45d89f4c76/f715c23b12822374 + many others On 21 Apr., 07:10, calvin

Re: Helpers in controllers

2010-04-21 Thread euromark
and no its not that much of a taboo as long as there arent any corresponding components/libs etc the cleaner approach would be to write lib classes that get inherited from both a component for controllers and the helper for views but as long as it is not so you have to break with the design a

Re: How to avoid the redundant code, is it possible to write that code write in one function and we have to call other functions, please help me out

2010-04-21 Thread Zaky Katalan-Ezra
If I understood your problem currently. Create an element for the menu. Pass arguments to the element in order to decide which menu items to render. You can consider splitting the menu to items with logic and static items, then you will be able to cache the static items menu. Check out the new

Re: Kaching: CakePHP Shopping Cart Framework Plugin

2010-04-21 Thread fabio
Dear Mike, thanks a lot for sharing your good work... I'm trying to get Kaching working, but i've encountered an obstacle regarding plugin routing... i guess I'm trying and trying to solve this but I couldn't solve it yet... that's why I'll try to explain it and hope on a little help... Basicly

Re: Kaching: CakePHP Shopping Cart Framework Plugin

2010-04-21 Thread fabio
Dear Mike, thanks a lot for sharing your good work... I'm trying to get Kaching working, but i've encountered an obstacle regarding plugin routing... i guess I'm trying and trying to solve this but I couldn't solve it yet... that's why I'll try to explain it and hope on a little help... Basicly

ACL: $model-parentNode() and inheritence

2010-04-21 Thread Andras
hello again, i have noticed the parentNode() of a model that actsAs an ACL requester must return a parent record ( if it exists ) and not an actual acl ( aro ) parent node as the name would suggest. My question: is permission inheritance still possible this way? If i have a Group that is

Re: Multi-level Models in CakePHP

2010-04-21 Thread WebbedIT
wouldn't one be able to use $this-Model-unbindModel() to take away any unwanted, extra associations? Yes, but that's exactly why Containable was written, it's a convenience wrapper that binds/unbinds all the relevant models based on the info you supply in the contain array of your find call

Re: drop-down list - displayed values

2010-04-21 Thread WebbedIT
It;s likely that what jeremy says is right, and if this is the case you can either a) Rename a field in your db table to name b) Specify the displayField attribute in your model to use a different field for find('list') c) Add a fields array to your find('list', array('fields'=array('Model.id',

Different time outs for different Session variabes.

2010-04-21 Thread #2Will
Hello. Is it possible to have different timeouts for different session variables in cake? I have a long session set in config.php so that the admin area doesn't time out too quick. But i want variables storing google tracking codes to time out on closing the window. Thanks for any help. Will

Re: is it advisable to use jquery on cakephp?

2010-04-21 Thread WebbedIT
I've recently switched to jQuery from Prototype as there seems to be a much wider availability of higher quality scripts available for it. I'm on Cake 1.2.6 so I call everything manually and I found the transition from Prototype to jQuery very easy (and I am terrible at javascript). HTH Paul

Re: News with Comments - how to sort by comments count?

2010-04-21 Thread WebbedIT
Whilst you doubt that your add/delete actions/callbacks are causing the automagic not to happen, I can assure you that it must be something somewhere in your configuration as counterCache works very well :o) Cricket may be on to something though, if your site is in production mode (debug set to

Problem with rewrite or routing

2010-04-21 Thread WhyNotSmile
Hi, I've been trying for a while to get my cake site up and running online... it's nearly there, but I seem to be having trouble with routing, or rewriting or something. Firstly, Cake doesn't seem to be finding my webroot. When it looked for the css directory, it was looking in

Re: Advanced search form

2010-04-21 Thread WebbedIT
At present this query is a little general to get a good answer from anyone. What part of creating this form are you struggling with? It's pretty much the same form you would show for adding a product minus a number of the fields, but you'd still have a drop-down for type, location, colour etc.

Re: refining search results

2010-04-21 Thread WebbedIT
At present this query is a little general to get a good answer from anyone. It's unlikely that someone will stop what they're doing, write a load of code and hand it over to you, but if you give it a go yourself and ask for assistance on specific problems as you hit them then you are much more

Re: reuseable Code with cakePHP

2010-04-21 Thread John Andersen
Are the data on the two servers the same? I just want to make sure that it is not an issue with the data :) As the two examples both are from the same location, then I would still think that the issue is the data, or may even be old code (not replaced in last code update). I received your reply

CMS

2010-04-21 Thread chandrasekhar reddy
Hi friends, I need some information Regarding CMS(Content Management System). Is There any CMS was Related to cakephp (Like joomla,drupal ( for php)) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message

where can i write controller for elements please help me out.

2010-04-21 Thread Narendra Padala
Hi All, I am new to cakephp, When i am try to create menu i have problem, where can i write controller for elements please help me out. include file code here : views/elements/gravitybar.ctp --

update status bar issue

2010-04-21 Thread Bryan Lim
Hi all, I am new to cakephp. I want to create a simple twitter update status bar. I use twitterlibphp. But it can't seems to work. I am not sure what is wrong. Can only deduce that the view has a problem. I simply took the add() view and modify it. Should I be using a form? I also attached my

Re: _controller convention

2010-04-21 Thread Bryan Lim
ok.. thank you! :) On Apr 21, 11:29 am, Miles J mileswjohn...@gmail.com wrote: There is no real reason. Just makes it easier to differentiate files that are open in your editor. On Apr 20, 8:14 pm, Bryan Lim ytbr...@gmail.com wrote: But don't the model and view need a _model or _view

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

2010-04-21 Thread Bryan Lim
skitle , you just made me download coda. On Apr 21, 1:22 am, skitle lancegerst...@gmail.com wrote: Coda. Disclaimer: You will hate every other editor once you use it. On Apr 20, 10:24 am, Jamie jamie@gmail.com wrote: Textmate. It's worth it. On Apr 18, 9:14 pm, Bryan Lim

Re: How to output UTF-8 sign?

2010-04-21 Thread John Andersen
The pagination-sort syntax can be seen here: http://api12.cakephp.org/class/paginator-helper#method-PaginatorHelpersort which says sort(title, key, options) and it is in the options array that you put the class definition. Enjoy, John On Apr 21, 10:03 am, sebb86 kahlc...@googlemail.com wrote:

Re: View (form-input) - Disable word wrap?

2010-04-21 Thread John Andersen
I don't use the cake.generic.css file, I use my own definitions, some as in the example! Enjoy, John On Apr 21, 9:28 am, sebb86 kahlc...@googlemail.com wrote: John Thanks a lot for all your help. In your example, is the cake.generic.css file the original? Check out the new CakePHP

Ajax Helper not respecting routes

2010-04-21 Thread Bryan Paddock
Hey all, Weird problem. I have a ajax search form and retrieves submissions and inserts them into a div. The ajax is working although the controller does not respect the prefix. ?php echo $form-create('Submission'); echo $form-input('search', array('class' = 'quicksearch')); echo

Re: CMS

2010-04-21 Thread Leonid Mamchenkov
Hi, On Wed, Apr 21, 2010 at 13:16, chandrasekhar reddy chanduc...@gmail.com wrote:  I need some information Regarding CMS(Content Management System). Is There any CMS was Related to cakephp  (Like joomla,drupal ( for php)) Try Google for CakePHP CMS - there is a whole bunch of links,

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: CMS

2010-04-21 Thread Sitthykun LY
Thank Leonid On Wed, Apr 21, 2010 at 6:27 PM, Leonid Mamchenkov leo...@mamchenkov.netwrote: Hi, On Wed, Apr 21, 2010 at 13:16, chandrasekhar reddy chanduc...@gmail.com wrote: I need some information Regarding CMS(Content Management System). Is There any CMS was Related to cakephp (Like

Re: CMS

2010-04-21 Thread mufti ali
Hope this list will help you 5 CakePHP based Content Managament System http://blogfreakz.com/cms/cakephp-based-cms/ On Wed, Apr 21, 2010 at 6:42 PM, Sitthykun LY ly.sitthy...@gmail.comwrote: Thank Leonid On Wed, Apr 21, 2010 at 6:27 PM, Leonid Mamchenkov leo...@mamchenkov.netwrote: Hi,

Re: 1.3rc4 and saveAll, strange return values

2010-04-21 Thread Jon Bennett
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

Re: Ajax Helper not respecting routes

2010-04-21 Thread genellern
hi i would do that this way: echo $ajax-form(null, 'post',array('model'='Submission','action'='search','id'='formEdit','update' = 'submissions-list')); echo $form-input('search', array('class' = 'quicksearch')); echo $form-submit();     'url'= '/judge/submissions/search', ? When I submit

Re: CakePHP Auth Component cannot remember url before authentication

2010-04-21 Thread Prof. No Time
I got it dear. Thanks very much. I opened up the Auth component and digested it myself (Afterall, its just another component written by a brother of mine, lol). I then discovered that the session variable for storing the intended url is 'Auth.redirect', so I leveraged on it by checking it and

saveAll() with $fieldList problem

2010-04-21 Thread marco.rizze...@gmail.com
I want use Model-saveAll() with fieldList to avoid to save some field My problem is that I have in the related model two fields with the same name but one field (of first model (ModelA) ) should be saved and the other (of second model(ModelB)) shouldn't be save. How do I set the fieldList in

Re: saveAll() with $fieldList problem

2010-04-21 Thread Jeremy Burns
Prefix all of your fields with the model name (it's good practice everywhere really). So ModelA.field_name, ModelB.field_name etc. Jeremy Burns jeremybu...@me.com On 21 Apr 2010, at 14:40, marco.rizze...@gmail.com wrote: I want use Model-saveAll() with fieldList to avoid to save some field

Re: Is it possible to write common code in one function and i have to call that function when i was required

2010-04-21 Thread LunarDraco
If the code is meant to transform or in some way CRUD or manipulate data and it needs to be accessible from multiple controllers, I would push it down to the model that it is associated with. then in your code you can call the function as $this-SomeModel-myFunction(); Pushing the code to the model

Re: Paginate - from paginated list to single paginated item

2010-04-21 Thread Bart
Hi paul, Thanks for your reply. I used your approach and it works! Thanks Now I had the paginator configured in such a way that the order of the items is done along a custom field 'order' and not by default along 'id'. And it seems the find('neighbors') does not allow the indication of an

Re: is it advisable to use jquery on cakephp?

2010-04-21 Thread jacmoe
If you want to use a helper, powered by jQuery, but behaving like the helper in Cake 1.2.x, then use this: http://bakery.cakephp.org/articles/view/ajax-helper-with-jquery I am using it with CakePHP 1.3.x without problems. :) I also use jQuery without any helper, and even the new js engine, but

Checking multiple columns for duplication checking in model

2010-04-21 Thread Swanny
Is there a way in a model to verify that a record does not exist already that matches a certain criteria. In the database table are three columns: id, list_id and product_id. I would like to be able to tell if there already exists a record with the same list_id AND product_id as the one being

Re: NewBie Help Creating a simple Cake Blog, Return 404 Error

2010-04-21 Thread netpumber
So the debug as you can see is already in 2. Configure::write('debug', 2); I delete handmade controllers , models and view and bake them as you say...with cake bake M/C/V command.. I add then the code and still returns me not found error :S Whats going on ? I have to use -app parameter ?

Re: 'multiple' validation rule

2010-04-21 Thread cricket
On Apr 21, 12:54 am, Jeremy Burns jeremybu...@me.com wrote: Might it be something to do with the field name? What happens if you rename it to election_office? ElectionOffice is the model name. I got the error msg to show up properly, though. I debugged $form- validationErrors: Array (

Session startup function

2010-04-21 Thread ZAky
I need to utilize several things in my application when session start. 1. I read the cookie to determine the user selected language. 2. The user selected layout 3. The user theme I also have a global parameter, the year the user select. For all these parameters I check if a value exist in the

Re: 'multiple' validation rule

2010-04-21 Thread John Andersen
I think that Jeremy was on the right track! As the form expects a field/column, then should the field not be named as ElectionOffice.id, so that it points to a column in table!? Maybe give it a try! You actually had the .id attached in your first post! Enjoy, John On Apr 21, 8:44 pm, cricket

Re: Checking multiple columns for duplication checking in model

2010-04-21 Thread Andy Dirnberger
Here's a stripped down example of how I do it: app_model.php class AppModel extends Model { ... function isUniqueMulti($data, $fields) { if (!is_array($fields)) { $fields = array($fields); } foreach ($fields as $key) { $tmp[$key] = $this-data[$this-name][$key];

Re: 'multiple' validation rule

2010-04-21 Thread cricket
On Apr 21, 1:56 pm, John Andersen j.andersen...@gmail.com wrote: I think that Jeremy was on the right track! As the form expects a field/column, then should the field not be named as ElectionOffice.id, so that it points to a column in table!? Maybe give it a try! You actually had the .id

Re: NewBie Help Creating a simple Cake Blog, Return 404 Error

2010-04-21 Thread Sam Sherlock
does it return a cake error 404 or an apache gen error 404? what code do you add after baking. Bake should generate all you need to be able to add, edit,delete and view posts - S On 21 April 2010 16:25, netpumber r00f...@gmail.com wrote: So the debug as you can see is already in 2.

CakePHP + admin routes + .htaccess + production mode

2010-04-21 Thread WebbedIT
The link below describes perfectly the problem I am facing when trying to get my password protected AwStats playing nicely with CakePHP. http://stackoverflow.com/questions/1607422/cakephp-admin-routes-htaccess-production-mode/2686360#2686360 With debug set to 1, the HTTP Auth login appears and I

Re: 'multiple' validation rule

2010-04-21 Thread WebbedIT
I have posted and taken part in multiple threads involving the 'multiple' rule and eventually applied my own core hack to get it working. Others have came up with alternatives that massage the data array so save and validation works, I think there's even something in the bakery about it.

Re: CakePHP + .htaccess + production mode

2010-04-21 Thread WebbedIT
Edit: removed the bit about admin routes as that is not part of my issue 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

Re: NewBie Help Creating a simple Cake Blog, Return 404 Error

2010-04-21 Thread netpumber
It returns apache not found error. So my web root dir is /var/www then in it i bake a blog so i have /var/www/blog directory now..where is the root dir for my cake php project. Then i bake Controller / Model / View Here are the codes : Model: (Noting added) [code] ?php class Post extends

Re: View (form-input) - Disable word wrap?

2010-04-21 Thread sebb86
Okay, thats the reason. I have to much standard definitions in the cake.generic.css. It would take me to much time to change all this. But inspite of this, i used some of your definitions! :-) I'm new to CSS (and also to CakePHP), so some source code was very usefull for me. Thanks a lot for all

Re: How to output UTF-8 sign?

2010-04-21 Thread sebb86
Hello again and thanks. I got an arrow in my column header. But its every time (asc or desc) the same arrow, so i think, the paginate source code is still wrong. My problem is still, that i dont know how to combine two classes in one paginate function. [code dont works] ?php echo

Re: How to output UTF-8 sign?

2010-04-21 Thread sebb86
Hello again and thanks. I got an arrow in my column header. But its every time (asc or desc) the same arrow, so i think, the paginate source code is still wrong. My problem is still, that i dont know how to combine two classes in one paginate function. [code dont works] ?php echo

Re: NewBie Help Creating a simple Cake Blog, Return 404 Error

2010-04-21 Thread Sam Sherlock
and you have mod rewrite enable in apache - this seems to me that things prior to cake not functioning ie mod_rewrite when you have baked and you go to http://mydomain.com is the page displayed ok - is the css applied - or is this file error 404 too is http://mydomain.com/css/cake.generic.css

Re: is it advisable to use jquery on cakephp?

2010-04-21 Thread Sam Sherlock
I use jquery + cake all the time and often feel that they were made for each other :) no helpers, I feel the same as Miles J in cake1.3 I plan to carry on as before and make some use of the engines too. but just Jacmoe says it depends on the task - S On 21 April 2010 16:30, jacmoe

Re: Multi-level Models in CakePHP

2010-04-21 Thread andy
Ah, that's interesting! Thanks again for the help. Andy On Apr 21, 2:19 am, WebbedIT p...@webbedit.co.uk wrote: wouldn't one be able to use $this-Model-unbindModel() to take away any unwanted, extra associations? Yes, but that's exactly why Containable was written, it's a convenience

Re: 'multiple' validation rule

2010-04-21 Thread cricket
On Apr 21, 4:50 pm, WebbedIT p...@webbedit.co.uk wrote: I have posted and taken part in multiple threads involving the 'multiple' rule and eventually applied my own core hack to get it working.  Others have came up with alternatives that massage the data array so save and validation works, I

postgres tree behavior

2010-04-21 Thread Chris Turner
Hello - I'm new to cake, and am attempting to prototype an application for evaluation, using postgres as the backend. I'm trying to create a business products catalog using the 'Tree' behaviour, and currently the 'moveup()'/'movedown()' features are not working (although it appears that setting

Re: Kaching: CakePHP Shopping Cart Framework Plugin

2010-04-21 Thread Mike Friesen
Hi, Sorry, but I never thought of installing kaching in a subdirectory. I've been playing around with it tonight and your right, the css / links don't work inside a subdirectory. I'll create a ticket for that and I'll get that working for the next release. In the meantime, the only thing I can

Re: Helpers in controllers

2010-04-21 Thread calvin
I did search... That's how I found this... ah, nevermind. Anyway, I _know_ how to use helpers in controllers. I wasn't asking how to do it. I was trying to get people's perspective on the issue and, specifically, whether the Cake developers really intend on helpers being used exclusively in

Re: Joining Data for Auth Component to read

2010-04-21 Thread capo64
Well basically I have over a thousand products and I'll be assigning a price modifier per group (ie Bronze Silver and Gold members have different prices for their items), so I would think the best way would be to check the User's Group's price_modifier when the user logs in, and store it in the