Re: How to deploy cakephp app on production server?
Thanks for fast reply! These informations are very helpful. Piotr On Jan 26, 10:53 am, Martin Westin wrote: > The manual entry is short but that is all that is needed for a basic > setup. > Describe commands stop as soon as you go into debug 0. > > General performance advice (Not things you do in your app. Things you > do in deployment): > Compiling php and the web server specifically if the added boost is > worth the extra work on updates. > Lookup information about improving the speed of your database server. > You will often gain some speed by using a php accelerator. They all > install a little differently and also require work on each update of > php. > Leaving the safety of Apache for Lighty of one of the other new kinds > can give further improved performance. But these need to be compared > and tested to make sure which is best for you and how much you > actually gain. > > In your application I can only suggest that you find a way to really > overload your database with data to find bottlenecks in your code. > With only a few thousand rows in every table any problem areas should > be very obvious. Whenever I don't do this I always have to revisit > code a few weeks (or hours) later and optimize. It is noce to catch it > before going public. > > On Jan 26, 10:38 am, Hipnotik wrote: > > > > > Hi > > Could you give me some instructions how to deploy cakephp application > > on production server? > > I know I have to disable debugging and enable cache engine... but what > > else? > > Maybe some performance tips? > > Is it any way to disable 'describe' command? > > > Thanks for help! --~--~-~--~~~---~--~~ 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, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How to deploy cakephp app on production server?
Hi Could you give me some instructions how to deploy cakephp application on production server? I know I have to disable debugging and enable cache engine... but what else? Maybe some performance tips? Is it any way to disable 'describe' command? Thanks for help! --~--~-~--~~~---~--~~ 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, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Is it possible to use helper in model?
Hi Is it possible to use helper (in example number helper) in model? I would like to use it in example in beforeValidate method. Thanks! --~--~-~--~~~---~--~~ 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, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to validate 2 linked models created from one form?
On Dec 24, 11:13 am, "sijo jose" wrote: > Hi, > > Since u have created the form for the model Order, > > The field title should be referred like > > $form->input("Customer.title"); directly. > > Now when u r saving use saveAll > > $this->Order->saveAll($this->data,array('validate' => 'first')); > > All the validation rules can be in ur model itself. > > The array('validate' => 'first') specifies that all the models must be > validated first before saving recursively. > > Also u have to take into consideration that at present cakePHP supports > recursive saving for first level only. > > Think I was helpful. > Regards > Sijo > Thanks for you reply! I'll check your solution when I back to work, but I think it make sense :) > > On Mon, Dec 22, 2008 at 2:42 PM, Hipnotik wrote: > > > Hello again ;) > > I have 2 models: > > > Order: > > hasOne = "Customer" > > > Customer: > > belongsTo = "Order" > > var $validate = array(lot of rules) > > > I would like to create a form to provide data for Customer object then > > send form to OrdersController and validate. > > > How to create proper form? > > > I have this: > > $form->create("Order", array("action" => "send")); > > $form->input("Order.Customer.title"); > > // more fileds > > $form->end("Send") > > > It sends data to "send" action of OrdersController, but how to create > > Customer object, validate and display errors on the form if occur? > > > Thanks for help > > -- > Sijo Jose Chakramakkil --~--~-~--~~~---~--~~ 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, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How to validate 2 linked models created from one form?
Hello again ;) I have 2 models: Order: hasOne = "Customer" Customer: belongsTo = "Order" var $validate = array(lot of rules) I would like to create a form to provide data for Customer object then send form to OrdersController and validate. How to create proper form? I have this: $form->create("Order", array("action" => "send")); $form->input("Order.Customer.title"); // more fileds $form->end("Send") It sends data to "send" action of OrdersController, but how to create Customer object, validate and display errors on the form if occur? Thanks for help --~--~-~--~~~---~--~~ 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, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How to validate form if url is specified in $form->create?
Hello I have a problem, I would like to validate a model which does not have a controller. I'm showing form in EntriesController (not PostsController) so I have to add _persistValidation to my app_controller. 1. If I use: $form->create("Post"); then form will be send to /posts/add. It works correct but I don't want to create PostsController and add action. 2. If I use: $form->create("Post", array("action"=>"add_post")); The same problem, but I can change target action now ;-) 3.And finally I found this in cake's book: http://book.cakephp.org/view/186/options-url It says: $form->create(null, array('url' => array('controller' => 'posts', 'action' => 'add_post'))); It is good solution, it works, but... how to display validation's error on the form? Thanks for help --~--~-~--~~~---~--~~ 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, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How to pass data to javascript from cake's controller?
Hi I would like to build 2 javascript arrays in the view from data loaded in controller. Solution 1: use getJSON in $(document.ready) ... not good for me Solution 2: set 2 php arrays in controller's method as available in the view: $this->set("arr1", $arr1); $this->set("arr2", $arr2); and the build js arrays in myview.ctp file ... not good too... Is it possible to pass data from controller to js file placed in webroot/js/ folder? Without ajax offcourse. Any other ideas? Thanks ;) --~--~-~--~~~---~--~~ 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, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to add line break in text mail layout?
On 6 Gru, 17:32, majna <[EMAIL PROTECTED]> wrote: > Just write "\n" > Examples: > > Wow! It works! I don't know why, but it works correct. The only thing I had to do was moving "\n" into inside of echo function. Does not work directly in template: Something: \n but this code works correct: Something: Thanks all for help ;) > On Dec 5, 1:44 pm, "dr. Hannibal Lecter" <[EMAIL PROTECTED]> wrote: > > > > > Well...that's not supposed to happen. Can you check the mail source > > and mime headers? Maybe you're not sending your email in plain text..? > > > On Dec 5, 1:11 pm, Hipnotik <[EMAIL PROTECTED]> wrote: > > > > On 5 Gru, 12:35, "dr. Hannibal Lecter" <[EMAIL PROTECTED]> wrote: > > > > > What about simply hitting the enter key? :) > > > > Doesn't work... displays all lines in one :( > > > > > On Dec 5, 12:14 pm, Hipnotik <[EMAIL PROTECTED]> wrote: > > > > > > How to add line break in text mail layout? > > > > > > It's in elements/email/text/default.ctp file. > > > > > I tried to use: > > > > > \n > > > > > \r\n > > > > > \r > > > > > and still it doesn't work correct. > > > > > It breaks the lines but new line character (i.e. \n) appears in the > > > > > received message too. > > > > > > How to do that? > > > > > Thanks for help ;) --~--~-~--~~~---~--~~ 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, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to add line break in text mail layout?
On 6 Gru, 17:32, majna <[EMAIL PROTECTED]> wrote: > Just write "\n" > Examples: > > Wow! It works! I don't know why, but it works correct. The only thing I had to do was moving "\n" into inside of echo function. Does not work directly in template: Something: \n but this code works correct: Something: \n Thanks all for help ;) > On Dec 5, 1:44 pm, "dr. Hannibal Lecter" <[EMAIL PROTECTED]> wrote: > > > > > Well...that's not supposed to happen. Can you check the mail source > > and mime headers? Maybe you're not sending your email in plain text..? > > > On Dec 5, 1:11 pm, Hipnotik <[EMAIL PROTECTED]> wrote: > > > > On 5 Gru, 12:35, "dr. Hannibal Lecter" <[EMAIL PROTECTED]> wrote: > > > > > What about simply hitting the enter key? :) > > > > Doesn't work... displays all lines in one :( > > > > > On Dec 5, 12:14 pm, Hipnotik <[EMAIL PROTECTED]> wrote: > > > > > > How to add line break in text mail layout? > > > > > > It's in elements/email/text/default.ctp file. > > > > > I tried to use: > > > > > \n > > > > > \r\n > > > > > \r > > > > > and still it doesn't work correct. > > > > > It breaks the lines but new line character (i.e. \n) appears in the > > > > > received message too. > > > > > > How to do that? > > > > > Thanks for help ;) --~--~-~--~~~---~--~~ 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, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to add line break in text mail layout?
On 5 Gru, 12:35, "dr. Hannibal Lecter" <[EMAIL PROTECTED]> wrote: > What about simply hitting the enter key? :) Doesn't work... displays all lines in one :( > On Dec 5, 12:14 pm, Hipnotik <[EMAIL PROTECTED]> wrote: > > > > > How to add line break in text mail layout? > > > It's in elements/email/text/default.ctp file. > > I tried to use: > > \n > > \r\n > > \r > > and still it doesn't work correct. > > It breaks the lines but new line character (i.e. \n) appears in the > > received message too. > > > How to do that? > > Thanks for help ;) --~--~-~--~~~---~--~~ 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, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How to add line break in text mail layout?
How to add line break in text mail layout? It's in elements/email/text/default.ctp file. I tried to use: \n \r\n \r and still it doesn't work correct. It breaks the lines but new line character (i.e. \n) appears in the received message too. How to do that? Thanks for help ;) --~--~-~--~~~---~--~~ 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, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Set different background colour for each row in tag
Hi I would like to generate form field with multiple option with each row with other background colour. Rows colours should be taken from database. Example table schema: id name background_colour // in example: #f0f0f0 #controller code $colours = $this->Colour->find('list'); $this->set("colours", $colours); #view code // form initialization code ... echo $form->input("Colour.id", array( "type"=>"select", "options"=>$colours, "multiple"=>true) ); How to set different colours for each row? Thanks for help --~--~-~--~~~---~--~~ 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, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to add colour to product? [Models associations/relations, habtm?]
On 17 Lis, 15:03, Joel Perras <[EMAIL PROTECTED]> wrote: > http://teknoid.wordpress.com/2008/07/11/notes-on-cakephp-habtm-part-2... It's not the same :( I have products and colours defined and I need "only" to bind these models, such as "select product, select colour and click save". > -J. > > On 17 Nov, 07:00, Hipnotik <[EMAIL PROTECTED]> wrote: > > > Hi Anja, > > thanks for your reply. > > > My first idea how to do that was same as your... but I started to > > think of it and there should be "a more clever" way, I think. > > > On 17 Lis, 12:04, "Liebermann, Anja Carolin" > > > <[EMAIL PROTECTED]> wrote: > > > Hi Hipnotik, > > > > You would need a controller and model for the realtion also. > > > > I have the same situation with some of my models and work woth a third > > > model which gives me the connection between then like > > > Conncolourproduct.php and conncolourproducts_controller.php > > > > Maybe someone has a more clever solution? > > > > Anja > > > > -Ursprüngliche Nachricht- > > > Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von > > > Hipnotik > > > Gesendet: Montag, 17. November 2008 11:13 > > > An: CakePHP > > > Betreff: How to add colour to product? [Models associations/relations, > > > habtm?] > > > > I have problem. > > > I have 3 tables: > > > 1. products > > > 2. colours > > > 3. colours_products > > > > There are also 2 models: > > > 1. Product > > > 2. Colour > > > with set up associations > > > Product model: var $hasAndBelongsToMany = array("Colour"); Colour model: > > > var $hasAndBelongsToMany = array("Product"); > > > > I created a view with form with 2 select boxes where the first one > > > contain products list and second available colours. I would like to > > > select a product then select a colour and click on Save button to save > > > product->colour relation. I have a controller to display data but I > > > don't know how to create proper add action. > > > > How to save data from form like this? > > > How form initialization line should be looking (I mean echo $form- > > > > >create("Colour", array("action"=>"add"));)? > > > > Thanks for help --~--~-~--~~~---~--~~ 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, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to add colour to product? [Models associations/relations, habtm?]
Hi Anja, thanks for your reply. My first idea how to do that was same as your... but I started to think of it and there should be "a more clever" way, I think. On 17 Lis, 12:04, "Liebermann, Anja Carolin" <[EMAIL PROTECTED]> wrote: > Hi Hipnotik, > > You would need a controller and model for the realtion also. > > I have the same situation with some of my models and work woth a third model > which gives me the connection between then like Conncolourproduct.php and > conncolourproducts_controller.php > > Maybe someone has a more clever solution? > > Anja > > -Ursprüngliche Nachricht- > Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von > Hipnotik > Gesendet: Montag, 17. November 2008 11:13 > An: CakePHP > Betreff: How to add colour to product? [Models associations/relations, habtm?] > > I have problem. > I have 3 tables: > 1. products > 2. colours > 3. colours_products > > There are also 2 models: > 1. Product > 2. Colour > with set up associations > Product model: var $hasAndBelongsToMany = array("Colour"); Colour model: var > $hasAndBelongsToMany = array("Product"); > > I created a view with form with 2 select boxes where the first one contain > products list and second available colours. I would like to select a product > then select a colour and click on Save button to save > product->colour relation. I have a controller to display data but I > don't know how to create proper add action. > > How to save data from form like this? > How form initialization line should be looking (I mean echo $form- > > >create("Colour", array("action"=>"add"));)? > > Thanks for help --~--~-~--~~~---~--~~ 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, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How to add colour to product? [Models associations/relations, habtm?]
I have problem. I have 3 tables: 1. products 2. colours 3. colours_products There are also 2 models: 1. Product 2. Colour with set up associations Product model: var $hasAndBelongsToMany = array("Colour"); Colour model: var $hasAndBelongsToMany = array("Product"); I created a view with form with 2 select boxes where the first one contain products list and second available colours. I would like to select a product then select a colour and click on Save button to save product->colour relation. I have a controller to display data but I don't know how to create proper add action. How to save data from form like this? How form initialization line should be looking (I mean echo $form- >create("Colour", array("action"=>"add"));)? Thanks for help --~--~-~--~~~---~--~~ 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, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to exclude a field from inserts and updates
Interesting subject... On Oct 8, 7:26 am, "Paolo Stancato" <[EMAIL PROTECTED]> wrote: > Maybe you're not passing those fileds but someone else. > It's quiete easy to inject new fields in a form. How adding process should be done correctly? Is 'cake bake'-way incorrect? Working but incorrect? > Cheers > > 2008/10/7 teknoid <[EMAIL PROTECTED]>: > > > > > > > While this works fine, and makes your app more secure... the real > > question is why are you passing fields that do not need saving to the > > controller? or why do you even have them in the form? --~--~-~--~~~---~--~~ 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, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---