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

Re: Multiple forms in the same view not working

2009-09-22 Thread ramanujan
Hi John, thanks for your answer. I take your second advice and it worked. --~--~-~--~~~---~--~~ 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

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

Re: CakePHP and scalability

2009-09-22 Thread Jon Bennett
http://www.mysqlperformanceblog.com/ very interesting. From reading http://www.mysqlperformanceblog.com/2009/09/19/multi-column-indexes-vs-index-merge/ it would appear that for join tables, indexes with both keys would be best, rather than a single key per column. Good tip for the day that :)

paginator generates wrong url.

2009-09-22 Thread Mal
Hi all, the following problem manifests itself in both cake 1.2.4 and 1.2.5. I have a requirement to pass an ID into the index action of a controller that uses the cake paginator. The url would look something like this http://server/path/controller/ index/135. I can generate the url easily for

Re: paginator generates wrong url.

2009-09-22 Thread Mal
On further investigation, the following bit of code fixes this issue. Please put it in the next release. File cake/libs/view/helpers/paginator.php line 318 change from: $url = array_merge(array('page' = $paging['page'] + ($which == 'Prev' ? $step * -1 : $step)), $url); to: if (

Re: Missing Controller

2009-09-22 Thread Bert Van den Brande
The directory is app/controllers , not app/controller :) On Tue, Sep 22, 2009 at 1:58 PM, Selva manickaraja mavle...@gmail.comwrote: Hi, I just got CakePhp up and running. To learn the functionality I created sample php code. I followed the instruction in the book that I bought few days

Re: Missing Controller

2009-09-22 Thread Ma'moon
The class name should be ItemsController controller NOT ItemController On Tue, Sep 22, 2009 at 7:58 AM, Selva manickaraja mavle...@gmail.comwrote: Hi, I just got CakePhp up and running. To learn the functionality I created sample php code. I followed the instruction in the book that I bought

Problem with Ajax.autocomplete and Internet Explorer

2009-09-22 Thread Bs
Hi, I'm using the Ajax Helper for some fields in my app and it works flawlessly from the backend side. The only problem is Internet Explorer where the popup DIV is displayed totally dispositioned, several pixels to the right and lower than it's displayed in Firefox, Opera and any other browser.

Configure Cake under Nginx with ssl

2009-09-22 Thread Martin Westin
If you are running your CakePHP app under Nginx, this might interest you. Cake relies on the php environment variable HTTPS (as in $_SERVER ['HTTPS']) for SSL to be considered by RequestHandler and SecurityComponent. This is a problem for anyone running nginx. HTTPS is not mentioned as a

Localization, using multiple pot files

2009-09-22 Thread Crazy
Is it possible to use multiple po files? I have not started with localization yet, so I was wondering if it was possible. What we need is a general translation file, then one that contains all the errors and another one that contains all the help text. So my question is can I switch files

Re: Localization, using multiple pot files

2009-09-22 Thread Miles J
Of course you can! __('textString'); // Uses default.po __d('errors', 'textString'); // Uses errors.po __d('help', 'textString'); // Uses help.po On Sep 22, 8:00 am, Crazy crazy...@gmail.com wrote: Is it possible to use multiple po files? I have not started with localization yet, so I was

Re: get all models in app

2009-09-22 Thread Miles J
App::objects('model'); On Sep 21, 5:41 pm, brian bally.z...@gmail.com wrote: I'd like to get--from a shell--the names of all models that are in app/models dir (NOT Cake's models). I realise that I could scan the dir and use Inflector and App:import(), but is there already some way to do

Re: how can I pass variable from app_controller to a component?

2009-09-22 Thread Miles J
Why don't you just set the component? $this-Menu-data = $this-data; Or within the component, grab the data from the controller. function setup($Controller) { $this-data = $Controller-data; } --~--~-~--~~~---~--~~ You received this message because you are

Re: Missing Controller

2009-09-22 Thread AD7six
On 22 sep, 17:57, Selva manickaraja mavle...@gmail.com wrote: Hi Guys, Sorry, made a typo in the email. I did put the file in the correct directory app/controllers and the class name is ItemsController. I'm attaching screenshots of path to both class file and the class defined in each

Re: Multiple forms in the same view not working

2009-09-22 Thread ramanujan
Hi John, thanks for your answer. I've taken your second advice and it worked. --~--~-~--~~~---~--~~ 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

Re: Missing Controller

2009-09-22 Thread John Andersen
Correct also your model class to Item, not Items! Singular in models, plural in controllers. Enjoy, John [snip] 2. Wrote a script called item.php and placed it in app\models directory to define a class called Items. [/snip] --~--~-~--~~~---~--~~ You received

Using AuthComponent Within a View or Layout

2009-09-22 Thread walkerfx
Ok, I tore my hair out over this for a while and then figured out an easy solution. I just wanted to share it for others who run into the same problem. And maybe somebody has an even better solution that I overlooked. Problem: Control accessibility to certain parts of a view or layout using

i18n table with 180 000+ entrys

2009-09-22 Thread chrispie
hei list! I was wondering if the i18n table is still state of the art for about 30 000 entrys (cities) in a model (=180 000 entrys in i18n). Or is there a better solution like using a table prefix for different languages (de_cities, en_cities,)? thankYouVeryMuch chris!

Simple Acl controlled application

2009-09-22 Thread Chippo
Hi I was wondering if any of you could help me, I have been trying to follow the tutorial in the book... http://book.cakephp.org/view/641/Simple-Acl-controlled-Application But I've run into some problems and its pecking my head lol. Is there any chance one of you has a working copy of the

Re: get all models in app

2009-09-22 Thread brian
On Tue, Sep 22, 2009 at 12:33 PM, Miles J mileswjohn...@gmail.com wrote: App::objects('model'); Nope. I think that's from an old version. You did jog my memory, though. It's Configure::listObjects('model'). Thanks. --~--~-~--~~~---~--~~ You received this

Re: Using AuthComponent Within a View or Layout

2009-09-22 Thread brian
Use this in your view: if ($session-read('Auth.User.whatever')) { ... Use debug($session-read('Auth')) to see what it looks like. On Tue, Sep 22, 2009 at 12:19 PM, walkerfx st...@walkerfx.com wrote: Ok, I tore my hair out over this for a while and then figured out an easy solution. I just

Re: One to Many

2009-09-22 Thread kicaj
Hmm... Maybe nobody can't understand me, but i show You: My table 'tags' fields: id, name, foreign_key, model, created, modified (table simlar to 'i18n'), and i want adding tags with some content (add event, add post, add article, etc.) - this is simple, but I want automatically fill in the

Where to put function needed in multiple models?

2009-09-22 Thread kdubya
I'm trying to follow the structure of CakePHP but I don't know where to put a utility function that I would like to call to filter certain fields in more than one Model. The utility function filters most HTML tags, but allows some safe ones like b etc. and replaces newlines with br. I want to

Re: Where to put function needed in multiple models?

2009-09-22 Thread brian
If calling from beforeSave(), the best place might be AppModel. If you don't already have one of those, copy the file at cake/libs/models/app_model.php to your app directory (not app/models) and modify that. You would then call the function from within your own model as $this-yourFunction(...).

Re: Where to put function needed in multiple models?

2009-09-22 Thread kdubya
Thank you, Brian. Sounds like an excellent suggestion! (Why didn't I think of that?) On Sep 22, 4:54 pm, brian bally.z...@gmail.com wrote: If calling from beforeSave(), the best place might be AppModel. If you don't already have one of those, copy the file at cake/libs/models/app_model.php to

Re: One to Many

2009-09-22 Thread brian
Use TagBehavior. It does exactly that. http://bakery.cakephp.org/articles/view/simple-tagging-behavior On Tue, Sep 22, 2009 at 4:28 PM, kicaj ki...@kdev.pl wrote: Hmm... Maybe nobody can't understand me, but i show You: My table 'tags' fields: id, name, foreign_key, model, created,

Simple SQL Query that i just cant get right

2009-09-22 Thread Steppio
Hi everybody, this ones been doing my head in for some time now, hope you can help me out, im sure its very simple but i just cant get it working. Firstly the table structure is like this: CREATE TABLE pil ( id int(11) unsigned NOT NULL auto_increment primary key, user_id int(11)

Re: Simple SQL Query that i just cant get right

2009-09-22 Thread brian
The first param for find() should be one of 'first', 'all', 'list', etc. But, if all you want is a single value, use field(): function newpil() { $pilid = $this-Pil-field( 'pilid', array( 'Pil.user_id' =

Re: get all models in app

2009-09-22 Thread Miles J
Well no its actually not, Configure::listObjects('model') calls App::objects('model') internally though. But I forget which one will be deprecated :P On Sep 22, 12:45 pm, brian bally.z...@gmail.com wrote: On Tue, Sep 22, 2009 at 12:33 PM, Miles J mileswjohn...@gmail.com wrote:

Re: Where to put function needed in multiple models?

2009-09-22 Thread Jon Bennett
Hi kdubya, I'm trying to follow the structure of CakePHP but I don't know where to put a utility function that I would like to call to filter certain fields in more than one Model. The utility function filters most HTML tags, but allows some safe ones like b etc. and replaces newlines with

Re: Simple SQL Query that i just cant get right

2009-09-22 Thread Steppio
Thanks for the response. Basically its a bit like a shopping cart. I need a primary key just to keep each entry into the Product Inquiry List seperate, for example some of the lines i have in the database at the moment are: ID | User ID |Pilid|pcode| quantity | ... 13

Optimizing pagination COUNT(*) query

2009-09-22 Thread DanielMedia
I've been working on trying to optimize my code for a client before we decide to throw more hardware at the problem. One thing that I have noticed is the way that COUNT(*) queries are generated for pagination where the controller FIND method includes a JOIN table. For example here's one of the

Re: Optimizing pagination COUNT(*) query

2009-09-22 Thread Dave kurak
You can unbind the referenced table before you run your query and it will not be included... http://book.cakephp.org/view/78/Associations-Linking-Models-Together http://book.cakephp.org/view/78/Associations-Linking-Models-Together // This fetches Leaders, and their associated Followers

Re: Optimizing pagination COUNT(*) query

2009-09-22 Thread DanielMedia
Thanks for the reply Dave. I should have been more clear. I still need the JOIN to happen on the data returned but the JOIN should not happen on the paginator's COUNT(*) query. Seems to be adding overhead that is not necessary since the left join will not affect the count returned by that query.

Re: Optimizing pagination COUNT(*) query

2009-09-22 Thread Miles J
Not sure how you would edit the query for that, but you can create your own paginationCount() method and rewrite the conditions and call the parent. http://book.cakephp.org/view/249/Custom-Query-Pagination --~--~-~--~~~---~--~~ You received this message because

Re: Optimizing pagination COUNT(*) query

2009-09-22 Thread DanielMedia
Thanks Miles. I was avoiding having to do that but I guess that's the only approach right now. I'm actually in the middle of testing if this is a Cake issue or something weird in my custom App Model. I will report back if the same issue occurs in a default Cake install. If that's the case, maybe

Re: Simple SQL Query that i just cant get right

2009-09-22 Thread Martin Radosta
On 09/22/2009 07:30 PM, Steppio wrote: Thanks for the response. Basically its a bit like a shopping cart. I need a primary key just to keep each entry into the Product Inquiry List seperate, for example some of the lines i have in the database at the moment are: ID | User ID |

Element question

2009-09-22 Thread Dave Maharaj :: WidePixels.com
I am trying to use an element inside a foreach loop. I have the same code in 3 places and figured it would be easier to put the duplicated code into an element and just render the 1 where needed. I put the element inside the foreach because the $award is is different how it is obtained, its not

Re: Element question

2009-09-22 Thread brian
That's because the element relies on $viewVars. $award is outside the element's scope because you created it in your view. At least, I believe that's the case. Do this instead: echo $this-element('users/block_awards', array('award' = $award)); That should pass your var to the element. On Tue,

RE: Element question

2009-09-22 Thread Dave Maharaj :: WidePixels.com
Right on thanks. Found it too after doing a little digging in the cookbook. Thanks again, Dave -Original Message- From: brian [mailto:bally.z...@gmail.com] Sent: September-22-09 10:44 PM To: cake-php@googlegroups.com Subject: Re: Element question That's because the element relies

Re: Missing Controller

2009-09-22 Thread Selva manickaraja
Yes, I had corrected that all the first time I sent the email. According to the book tutorial, I should be getting the view. But I am still stuck with the error message Missing Controller. Could it be environment setup? Please advice Thank you. On Wed, Sep 23, 2009 at 1:17 AM, John Andersen

Re: Advanced setup

2009-09-22 Thread The Roman
Thanks for the response. As you say, the setup was overly complicated, and going back to square one certainly helped. I had followed advice (as I read it, anyway) from the an article on the bakery and moved webroot/index down a level into app, which just confused the situation even if it was

Model update problems

2009-09-22 Thread Matias_castro
Hi everyone! I had a running simple application in wich you were able to see images in an image gallery. The problem started when I tried to add a Thumb image. I changed the model in my database by adding a new column 'thumb_url' so I could save the thumb address of an image. The thing is that I

Paginate - order clause is ambiguous!

2009-09-22 Thread mig_akira
Hello everyone! I'm having a problem here. I have a table Pages, which belongsTo Categories. I'm using an ordenable behaviour, and so both pages and categories have a field called index. Problem is, in my pages_controller, i wrote this: var $paginate = array ('order' = 'index'); And as

Re: how can I pass variable from app_controller to a component?

2009-09-22 Thread mig_akira
Well, problem solved...don't know if I did it the right way, though... Since the variable I was trying to use in my component was an array of data from a table, I had to import the model in the component using: $Category = ClassRegistry::init('Category'); So I set the array

Re: Paginate - order clause is ambiguous!

2009-09-22 Thread Andras Kende
Did you try like: var $paginate = array ('order' = 'Pages.index'); Andras Kende On Sep 23, 2009, at 12:33 AM, mig_akira wrote: Hello everyone! I'm having a problem here. I have a table Pages, which belongsTo Categories. I'm using an ordenable behaviour, and so both pages and

Multiple belongsTo relations to the same table fails

2009-09-22 Thread Laran Evans
This is the error I get: Missing Database Table Error: Database table to_users for model ToUser was not found. Here's the code that prompts it: ?php class Mail extends AppModel { var $actsAs = array('Containable'); var $name = 'Mail'; var $validate = array(

Re: Model update problems

2009-09-22 Thread John Andersen
Try changing this line: $this-data['new']['thumb_url'] = $thumb_url;). into: $this-data['YourModelNameHere']['thumb_url'] = $thumb_url;). In case it doesn't change anything, please provide more information, code (controller and model), table definitionsetc. so we have a chance of

Re: Multiple belongsTo relations to the same table fails

2009-09-22 Thread Amit Rawat
check your model User what is the table name that you have define in it. --~--~-~--~~~---~--~~ 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

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 behaviour, and so both pages and categories have a field called index.