function problem in controller

2010-07-14 Thread Master Ram
Hi. to all in my controller i am using one function. function text() { ;;; 1000 lines of code ;;; } function add() { //Here i want same code. is having in text function. it is possible to call text() here. // i want to reduce the code. } Check out the new CakePHP Questions site

Re: cakeDC Tag Plugin Delete issue

2010-07-14 Thread abocanegra
I solved it, You can check out the code on my blog http://www.whatartist.com/blog/2010/07/making-cakedc-tags-plugin-delete-by-model-only/ On Jul 8, 4:35 am, abocanegra aaronbocane...@gmail.com wrote: I have been enjoying the Tag Plugin by CakeDC. However, I am having an issue when it is

Re: Something like ActiveMerchant?

2010-07-14 Thread iamcam (Cameron Perry)
Bharadwaj, That's the best I could come up with in the PHP world. Unfortunately the PEAR packages look outdated, and the Kohana component is for that framework - not sure how it would work as a stand-alone. There are ports in other languages (python and Objective- C), but that doesn't help us.

Re: Validation problem

2010-07-14 Thread Dr. Loboto
Rule '/^[a-z]$/i' accepts strictly one latin symbol in any case. Example: 'a' or 'B'. Rule '/^[a-z][A-Z]$/i' is same as '/^[a-z][A-Z]$/' and accept strictly two latin symbols, first in lowercase and second in upper. Example: 'aB'. Rule '/^[a-zA-Z]$/i' is same as '/^[a-zA-Z]$/' and same as

updating views in ajax

2010-07-14 Thread engine
Hi friends, i dont know this questions has been asked before or maybe straight forward. But i am not able to relate this to any solution. i had one flip-flop function triggered via a $html-link() this will check a Boolean column from database and displays Active or Inactive on the anchor of

Re: function problem in controller

2010-07-14 Thread Jeremy Burns | Class Outfit
$this-text(); Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 14 Jul 2010, at 07:15, Master Ram wrote: Hi. to all in my controller i am using one function. function text() { ;;; 1000 lines of code ;;; } function add() { //Here i

Re: function problem in controller

2010-07-14 Thread euromark
its very unlikely that all 1000 lines need to be in the controller most of them can be outsourced to libs, components or even model functions only the remaining lines (maybe the half) should then be divided - and only if it makes sense you should add _ in front of the method, though. this way its

applying css to form input fields

2010-07-14 Thread Tomfox Wiranata
hi, i am trying to pimp up my forms with css. but it seems a little more difficult with cake. technically i wanna have my login form close to facebook. elements side by side username - inputfield password - inputfield remember me forgot password? i know it works like that:

Re: applying css to form input fields

2010-07-14 Thread Jeremy Burns | Class Outfit
You probably just need to tweak the CSS using display: inline and so on. What does the HTML output look like? It'll be easier to advise once we see that. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 14 Jul 2010, at 10:43, Tomfox Wiranata wrote: hi, i

Re: applying css to form input fields

2010-07-14 Thread Tomfox Wiranata
hi jeremy, is there a feature that show how it looks in html? On 14 Jul., 11:48, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: You probably just need to tweak the CSS using display: inline and so on. What does the HTML output look like? It'll be easier to advise once we see

Re: function problem in controller

2010-07-14 Thread euromark
well i guess you meant it the other way around^^ add() and _text() On 14 Jul., 11:04, euromark dereurom...@googlemail.com wrote: its very unlikely that all 1000 lines need to be in the controller most of them can be outsourced to libs, components or even model functions only the remaining

Re: applying css to form input fields

2010-07-14 Thread Jeremy Burns | Class Outfit
View page source in your browser. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 14 Jul 2010, at 10:54, Tomfox Wiranata wrote: hi jeremy, is there a feature that show how it looks in html? On 14 Jul., 11:48, Jeremy Burns | Class Outfit

Re: applying css to form input fields

2010-07-14 Thread Yasir Arafat Hasib
If you have the cake.generic.css file or default cake php file. there you will get a .input, textarea classs just change as you need On Wed, Jul 14, 2010 at 3:43 PM, Tomfox Wiranata tomfox.wiran...@gmail.comwrote: hi, i am trying to pimp up my forms with css. but it seems a little more

Re: applying css to form input fields

2010-07-14 Thread Tomfox Wiranata
of course ^^ here you go :) form id=UserLoginForm method=post action=/muh/users/login accept-charset=utf-8 div style=display:none;input type=hidden name=_method value=POST //div div class=loginfield requiredlabel for=UserUsernameBenutzername/label input name=data[User][username] type=text

$this-paginate() inside a Model?

2010-07-14 Thread Shaz
With my current craze of moving all logic from my models to my controllers, a slight problem has risen - namely I can't seem to use $this-paginate() in a Model function thats called in a controller. $this-find() works perfectly find, and I'm trying to replace $this- find( 'all', $conditions );

Re: updating views in ajax

2010-07-14 Thread Shaz
Read up on call backs and the cake's ajax afterRender or beforeRender/load - it'll give you a better understanding on how best to you use AJAX. On 14 July, 08:37, engine radicalet...@gmail.com wrote: Hi friends, i dont know this questions has been asked before or maybe straight forward. But i

Re: $this-paginate() inside a Model?

2010-07-14 Thread Shaz
(Sorry I meant from my Controllers to my Models!) On 14 July, 12:12, Shaz shazam...@gmail.com wrote: With my current craze of moving all logic from my models to my controllers, a slight problem has risen - namely I can't seem to use $this-paginate() in a Model function thats called in a

FULL TEXT SEARCH

2010-07-14 Thread Annamalai
Hi i am using ordinary search functionality in my business controller . but now need to implement FULL TEXT SEARCH. can any one give idea ?? Thanks in advance Thanks Annamalai.S Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

Re: Validation problem

2010-07-14 Thread McBuck DGAF
I would defer to Dr. Loboto on this, since he obviously knows more about regex than I do. Maybe he can suggest the correct rule . . . ? My only response to your last post, Felix, is that you cannot remove / i since the / is required to delimit the regex. In other words, just removei. Good

Re: FULL TEXT SEARCH

2010-07-14 Thread Hugo M
What DB are you using? Often fulltext search is implemented in a DB level (MySQL with MyISAM tabes and Postgres has this feature built in). 2010/7/14 Annamalai annamala...@gmail.com Hi i am using ordinary search functionality in my business controller . but now need to implement FULL TEXT

column width in view

2010-07-14 Thread Charles Bueche
Hi, [sorry, for the CSS question in what is primarily a CakePHP list] I'm sure many of you had the issue : in the record view, the column width for the fields is fixed, lending field names over the field values. I can't find where to change this in the CSS file. Hints ? TIA, Charles Check out

Re: $this-paginate() inside a Model?

2010-07-14 Thread grigri
It makes no sense for paginate to be called as-is in a model. The `paginate` method is part of the controller, because it relies on URL settings (which page, sort order, etc) which only the controller can access. Allowing the model to access these parameters directly would violate MVC - in a bad

Re: column width in view

2010-07-14 Thread Mike Karthauser
On Wed, July 14, 2010 2:45 pm, Charles Bueche wrote: Hi, [sorry, for the CSS question in what is primarily a CakePHP list] I'm sure many of you had the issue : in the record view, the column width for the fields is fixed, lending field names over the field values. I can't find where to

Re: Validation problem

2010-07-14 Thread grigri
A regexp that only allows letters, numbers and spaces? '/^[a-z0-9\\x20]*$/i' A regexp that only allows words of letters and numbers, each separated by a single space: '/^(?:[a-z0-9]+\\x20)*[a-z0-9]$/' hth grigri On Jul 14, 2:44 pm, McBuck DGAF mcbuckd...@gmail.com wrote: I would defer to Dr.

Re: Validation problem

2010-07-14 Thread Felix Fennell
Ok, I've got everything working now! The rules I have ended up with are; First name: 'rule' = '/^[a-zA-Z]+$/', Second name: 'rule' = '/^[a-zA-Z]+$/', Company name: 'rule' = '/^[a-zA-Z\s]+$/', (Company name should also allow spaces) I realise that I could use /i instead of the [a-zA-Z] bit

Re: column width in view

2010-07-14 Thread Charles Bueche
Hi Mike, you rock my world, found and patched ! Firebug installed, it looks nice, I will have to dig into it. Thanks for the advice, Charles On 7/14/10 15:51, Mike Karthauser wrote: On Wed, July 14, 2010 2:45 pm, Charles Bueche wrote: Hi, [sorry, for the CSS question in what is primarily

Re: Fatal error: Allowed memory size of 16777216 bytes exhausted

2010-07-14 Thread Kirk
i've been attempting to reduce memory consumption on my app too. use debug($this) to see the different objects loaded into memory, and make sure to pass by reference where possible. i also added this snippet at the bottom of my default.ctp: echo 'uMemory Usage:/ubr /'; $memory_in_bytes =

Re: FULL TEXT SEARCH

2010-07-14 Thread Annamalai
Thanks for your reply . I am using MySQL with MyISAM tables. and this my table structure, fields marked red color are need to use in search CREATE TABLE IF NOT EXISTS businesses ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created date NOT NULL, modified datetime NOT NULL, user_id

Re: Validation problem

2010-07-14 Thread cricket
On Tue, Jul 13, 2010 at 2:57 PM, Felix Fennell fe...@felixfennell.co.uk wrote: Removing the /i doesn't do anything unfortunately - I read the handbook page too and thought it should work. They use this to check for any string using alphanumeric characters + dashes + underscores;

Please help | Newbie in cakephp

2010-07-14 Thread Jramirez07
Hello, I am very new to cake and started using to test things out and so far loving it. Have had some complications and been searching everywhere for answers on it but no luck. Here's what I have: two models: Artists Albums which are associated with each other with the hasMany / hasOne

Cannot send the email to more than one recipient.

2010-07-14 Thread googong
Hi all, I follow the document http://book.cakephp.org/view/1284/Class-Attributes-and-Variables to send mail. Address the message is going to (string). Separate the addresses with a comma if you want to send the email to more than one recipient. I tried to send many to email with separate comma

CakePHP 1.3.2 Performance under load

2010-07-14 Thread Matthew Porter
Hi everyone, I am currently investigating CakePHP for an upcoming project, however I have read some articles suggesting the performance of CakePHP 1.2 is well behind that of comparable frameworks under load. In particular, one article (found here:

How to use SEO urls in CakePHP without the ID?

2010-07-14 Thread alopes
Hello, How i can route my URLs without showing the ID in the URL. For example i have: www.mywebsite.com/id-article-title.html and i want only www.mywebsite.com/article-title.html Regards Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related

Re: applying css to form input fields

2010-07-14 Thread Jeremy Burns | Class Outfit
So I guess you need to apply some style to div.loginfield label and div.loginfield input[type=text]. Perhaps make them display: inline for a start and give the label a width? Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 14 Jul 2010, at 11:02, Tomfox

Re: Too many SQL queries!!

2010-07-14 Thread eugenioc...@hotmail.com
Have you try caching the queries? Just add var $cacheQueries=true; in your app_model.php Cache query will not make a query twice example; $this-set('name',$this-Model-field('name',array('id'=$id))); //more code if($this-Model-field('name',array('id'=$id))=='something'){ //doSomething }

Re: Validation problem

2010-07-14 Thread Felix Fennell
Thanks grigri, cricket, I've got it working now - I worked out the + thing from a regex tutorial. On 14 July 2010 02:09, cricket zijn.digi...@gmail.com wrote: On Tue, Jul 13, 2010 at 2:57 PM, Felix Fennell fe...@felixfennell.co.uk wrote: Removing the /i doesn't do anything unfortunately - I

Re: FULL TEXT SEARCH

2010-07-14 Thread Hugo M
Here there is a good example :) http://dev.mysql.com/doc/refman/5.1/en/fulltext-natural-language.html You should add a fulltext index to that table. Probably in Cake you will need to do a $this-Model-query, I don't know if with find methods you can use MATCH expression. 2010/7/14 Annamalai

Re: Please help | Newbie in cakephp

2010-07-14 Thread james livsey
Have you tried to decalre the display field? if you add the line var $displayField = 'name'; in the artists model class it should show the name instead of the id field. Hope that helps! On Wed, Jul 14, 2010 at 4:15 AM, Jramirez07 jramire...@gmail.com wrote: Hello, I am very new to cake

Re: cakeDC Tag Plugin Delete issue

2010-07-14 Thread Kirk
perhaps the problem is that the Taggable behavior has no beforeDelete callback On Wed, Jul 14, 2010 at 2:45 AM, abocanegra aaronbocane...@gmail.comwrote: I solved it, You can check out the code on my blog http://www.whatartist.com/blog/2010/07/making-cakedc-tags-plugin-delete-by-model-only/

Re: CakePHP 1.3.2 Performance under load

2010-07-14 Thread Mike Karthauser
hi matthew On Wed, July 14, 2010 5:44 am, Matthew Porter wrote: Hi everyone, I am currently investigating CakePHP for an upcoming project, however I have read some articles suggesting the performance of CakePHP 1.2 is well behind that of comparable frameworks under load. In particular, one

Re: CakePHP 1.3.2 Performance under load

2010-07-14 Thread keymaster
See the following thread describing some of the highest traffic cake sites... http://groups.google.com/group/cake-php/browse_thread/thread/a87ac46d4f590566/e2c097afb7eda061?lnk=gstq=cakephp+high+traffic+sites# Check out the new CakePHP Questions site http://cakeqs.org and help others with their

Re: How to use SEO urls in CakePHP without the ID?

2010-07-14 Thread cricket
On Wed, Jul 14, 2010 at 5:42 AM, alopes adrianolopesfrei...@gmail.com wrote: Hello, How i can route my URLs without showing the ID in the URL. For example i have: www.mywebsite.com/id-article-title.html and i want only www.mywebsite.com/article-title.html Add a column to your table to hold

Best practice query - Where to render element

2010-07-14 Thread sanedevil
Hi Bakers! Is it ok to render an element from a controller? Or as a best practice, let the controller always render the view and then in the view render the element? Thanks! KS Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You

Re: Best practice query - Where to render element

2010-07-14 Thread Nabil Alsharif
It's usually best to have the view render the elements and to pass settings/variables to view that passes it on to the element but to every rule there are exceptions. On Wed, Jul 14, 2010 at 1:52 PM, sanedevil sanede...@gmail.com wrote: Hi Bakers! Is it ok to render an element from a

Question about slugs

2010-07-14 Thread Roland Pish
Hi. I have urls like this in my project: www.mysite.com/practitioners/view/1 and I want to convert them to: www.mysite.com/the-name-of-the-practitioner So I started using slugs (and the corresponding db field) and configured this: Router::connect('/:slug/

Re: Best practice query - Where to render element

2010-07-14 Thread Sam
One use I've had for rendering an element in the controller(well, from a component actually) is for a form plugin- my users could put a bbcode like tag in the body of a page and it would render the proper form within their content... normally I would do this processing with a helper, but the form

Re: Question about slugs

2010-07-14 Thread Sam
Above your route for the slugs you need to add a route for every controller as follows: Router::connect('/example/:action',array('controller'='example', 'action' = 'index')); Or, you could modify your slugs routing and add a path before the slug e.g. Router::connect('example/:slug/

Re: Question about slugs

2010-07-14 Thread Roland Pish
Thanks a lot Sam. Great idea. I'll add the routes for the other controllers. Regards. On 14 jul, 16:33, Sam s...@masterscommission360.com wrote: Above your route for the slugs you need to add a route for every controller as follows:

Re: Cannot send the email to more than one recipient.

2010-07-14 Thread nurvzy
Can you get it to work with just one recipient? Because my first question is if you (or your host) has setup sendmail properly. You can always use a SMTP server to send your mail which is usually recommended for bulk email anyway. Nick On Jul 13, 9:27 pm, googong gong...@gmail.com wrote: Hi

Re: CakePHP 1.3.2 Performance under load

2010-07-14 Thread Matthew Porter
Thanks everyone. Seems CakePHP can handle some serious load. It's a pity there isn't more information on this and performance tuning tips in the Cookbook. It's also a shame there is no mention of performance improvements in the release notes for each version. Something CakePHP really needs to

Re: CakePHP 1.3.2 Performance under load

2010-07-14 Thread ohcibi
I have read some articles suggesting the performance of CakePHP 1.2 is well behind that of comparable frameworks under load. In particular, one article (found here:http://www.sellersrank.com/php/cakephp-codeigniter-benchmark/) Alternatively, can anyone comment on the validity or otherwise

Re: Question about slugs

2010-07-14 Thread Miles J
Its a good idea never to route something to the root, you should always put them in a container. /user/miles /team/lakers /band/u2 Etc. On Jul 14, 4:23 pm, Roland Pish rolandp...@gmail.com wrote: Thanks a lot Sam. Great idea. I'll add the routes for the other controllers. Regards. On 14

Re: cake 1.3.2 wants to be too smart

2010-07-14 Thread Dérico Filho
why don't you dike this smartie thing out? On Jul 13, 4:11 am, Grzegorz Pawlik grzegorzpaw...@gmail.com wrote: That's not what I'm asking about. Lets say I NEED to use TIMESTAMP and CURRENT_TIMESTAMP as default value, and in that case cakePHP misbehaves. On Jul 13, 7:04 am, Walther

Re: Cannot send the email to more than one recipient.

2010-07-14 Thread googong
Yes other options are fine -one to recipient, -one and many cc recipient. -one and many bcc recipient. I wonder why to option need to be string because cc and bcc are array and it works fine. On Jul 15, 6:37 am, nurvzy nur...@gmail.com wrote: Can you get it to work with just one recipient?

Re: FULL TEXT SEARCH

2010-07-14 Thread Annamalai
Thanks for your reply ... 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@googlegroups.com

Re: cake 1.3.2 wants to be too smart

2010-07-14 Thread djogo
Yes, this kind of suck. I wanted to have both created_at and updated_at fields, which I remember being trivial at mysql, but cake doesnt allow you to: - have two or more timestamp fields - name your timestamp field whatever you want On 13 jul, 04:11, Grzegorz Pawlik grzegorzpaw...@gmail.com

Re: cake 1.3.2 wants to be too smart

2010-07-14 Thread Jeremy Burns | Class Outfit
I don't know if this would work for you and your set up, but could you populate and set the timestamp from within Cake using the date() function instead of relying on the database? Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 15 Jul 2010, at 05:26, djogo

Problem with deleting record

2010-07-14 Thread vanishri
Hi All, I have an applicetion developed using cake php. in which we can add,delete,and update the data. once i view and delete any record it will delete from database ,but once clicking browser's back button it reloads the deleted record's data. kindly let me know the solution. thansk in

Re: Problem with deleting record

2010-07-14 Thread Jeremy Burns | Class Outfit
See this thread: http://groups.google.com/group/cake-php/browse_thread/thread/94b90f0a9a0cdfd1/7ccde5a6f8f86f95?hl=enlnk=gstq=back+button#7ccde5a6f8f86f95 Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 15 Jul 2010, at 05:38, vanishri wrote: Hi All, I

Re: CakePHP 1.3.2 Performance under load

2010-07-14 Thread Matthew Porter
Thanks @ohcibi Yes, I realise the article is old ... however, it is still not flattering for Cake. It would be ideal if there was a follow-up test, or even something from the Cake team indicating how to get the best performance out of the framework to address these concerns. To the uninitiated,