Re: AssetPackager for CakePHP
On Jul 30, 12:53 am, Grant Cox [EMAIL PROTECTED] wrote: Indeed. I've put some comments on your blog, but perhaps you should consider a Bakery article for this? Grant - Already done, just waiting approval from the head chefs :) Also, I responded to your comment on my blog... Brad --- Brad Daily Developer, SlideShowPro Director [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Newbie Introduction Book ... reviews anyone?
I would like to take a look. Please send a copy as soon as possible On Jul 27, 11:14 pm, Dave [EMAIL PROTECTED] wrote: I'm working on a Newbie's Introduction to CakePHP book and would like to invite anyone who would like to review it for errors or considerations I may have overlooked. Let me know, and I'll send you a PDF copy of the current edition. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Using models in app controller for default.thtml ???
Thanks for you replies friends, i am new to cakephp can you tell me how can i load component in it. Also stil i have develop an component but i will try and create it and let u know. but pls tell me how can i load a compnent and how can i include it in the default.thtml. Thanks On Jul 30, 7:26 am, Tulio Faria [EMAIL PROTECTED] wrote: Or you can try create a component, and load it with loadComponent or anything else. I think it's better... On 29 jul, 21:54, Geoff Ford [EMAIL PROTECTED] wrote: I believe $uses is overwritten by the actual controller that is invoked. I suggest you use loadModel() and creat your own instances of the models you need. Geoff --http://lemoncake.wordpress.com On Jul 29, 8:27 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello Friends, I am new to Cakephp. I am having an problem in it. The scenario is :- i have categories and subcategories. i want to show them as menus so i put them in the default.thtml file. To extract them from the database i have used var $uses =array('Category',Subcategory) in app_controller.php in app directory. and uses this coding :- function beforeFilter() { $maincatmenu=$this-Category-findAll(); //rest of the coding On the basis of $maincatmenu i am extracting categories from the subcategories etc. } It is working fine and menus are showing. But somehow when i try to access some other controllers as categories views etc It is showing the ERROR such as Notice: Undefined property: AppController::$Category in mypath\app \app_controller.php on line 52 Fatal error: Call to a member function findAll() on a non-object in mypath\app\app_controller.php on line 52 and for subcategory as well. I have tried to use var $uses in other controllers such as articles (as i am storing articles on the basis of categories and subcategories) as var $uses=array('Category','Subcategory'); But still when i access the articles action such as mypath/articles/ view/2 etc. it is showing the same Error mentioned above. Pls help. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Newbie Introduction Book ... reviews anyone?
Looks great! As the books grows it would be useful to have a table of content. Another point I think is missing are the naming conventions (e.g. that table names are plural by convention). HTH -- Daniel Hofstetter http://cakebaker.42dh.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Newbie Introduction Book ... reviews anyone?
Hi David, looks good just flicking through it quickly now. I develop on a Mac - you should mention XAMPP (MAMPP) which is also free and is easy enough to install. Also the free Mac-only CocoaMySQL is my new love with CakePHP designing - so much better than using PHPMyadmin. Also TextMate is ideal text editor because of the many files used in CakePHP and it is the preferred editor for Rails on Macs (there is plenty on the web for this) There is even a cake bundle, although a bit old now it can be altered. Editor / mysql admin and server are important choices with Cake as they enhance the whole rapid app build experience. A wiki page for this and cake in general would be great - how to set up on diff platforms easily for many-app developing. If done right, you could have a popular book on your hands as I think people want a good quickstart guide, which can consolidate the manual. I'd be interested in any more chapters if you can add me to a list of beta testers :) regards Luke On Jul 30, 9:27 am, Daniel Hofstetter [EMAIL PROTECTED] wrote: Looks great! As the books grows it would be useful to have a table of content. Another point I think is missing are the naming conventions (e.g. that table names are plural by convention). HTH -- Daniel Hofstetterhttp://cakebaker.42dh.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Newbie Introduction Book ... reviews anyone?
sorry I see you did briefly mention CocoaMYsql and also I see the excellent HeidiSQL later on, apologies! luke On Jul 30, 10:51 am, luke BAKING barker [EMAIL PROTECTED] wrote: Hi David, looks good just flicking through it quickly now. I develop on a Mac - you should mention XAMPP (MAMPP) which is also free and is easy enough to install. Also the free Mac-only CocoaMySQL is my new love with CakePHP designing - so much better than using PHPMyadmin. Also TextMate is ideal text editor because of the many files used in CakePHP and it is the preferred editor for Rails on Macs (there is plenty on the web for this) There is even a cake bundle, although a bit old now it can be altered. Editor / mysql admin and server are important choices with Cake as they enhance the whole rapid app build experience. A wiki page for this and cake in general would be great - how to set up on diff platforms easily for many-app developing. If done right, you could have a popular book on your hands as I think people want a good quickstart guide, which can consolidate the manual. I'd be interested in any more chapters if you can add me to a list of beta testers :) regards Luke On Jul 30, 9:27 am, Daniel Hofstetter [EMAIL PROTECTED] wrote: Looks great! As the books grows it would be useful to have a table of content. Another point I think is missing are the naming conventions (e.g. that table names are plural by convention). HTH -- Daniel Hofstetterhttp://cakebaker.42dh.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cake PHP running dead slow !-- 60.6669s --
i think that he ment to use the bindmodel() instead of loading a new model.. user-profile-func(); instead of loadModel('user'); loadModel('profile'); i wondered what's the performance difference. On Jul 30, 1:30 am, Grant Cox [EMAIL PROTECTED] wrote: On Jul 29, 4:45 pm, housebolt [EMAIL PROTECTED] wrote: $uses is evil and should be sparsely used. Do you have any benchmarks to back this up, or any comments from the core Cake developers (ie PHPNut or Nate) to this effect? I have not heard this before, and it sounds like FUD. I use loadModel heavily in my code and do not notice any particular performance hit (and afaik loadModel is basically the same as $uses). Cake model instances are cached in the ClassRegistry, and I was under the impression these existing instances were used for associations and $uses where possible. Certainly there is some performance hit to loading in Model classes (and it shouldn't be done unnecessarily), but unless you have some further proof I don't believe this is any worse whether they are loaded through associations, through $uses, or through loadModel. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: inserting controller view into another view
i see, is there some documentation somewhere so i can read more about this? On Jul 30, 5:13 am, Grant Cox [EMAIL PROTECTED] wrote: Using AJAX, quite easily - just populate an area of your page with the remote index action. If you can't use AJAX, not so easily (but more efficiently). You will need to retrieve the appropriate data for the foreign model in the main index action, and display it appriopriately. To get pagination / searching / sorting on both index lists you will need to have some funky named url parameters (to keep the two lists separate). On Jul 30, 8:29 am, rtanz [EMAIL PROTECTED] wrote: hi i have a view pertaining to a particular model and associations. in the index page of this model i would also like to display the index view of another model. can i do this? thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Newbie Introduction Book ... reviews anyone?
On 7/28/07, Dave [EMAIL PROTECTED] wrote: I'm working on a Newbie's Introduction to CakePHP book and would like to invite anyone who would like to review it for errors or considerations I may have overlooked. Let me know, and I'll send you a PDF copy of the current edition. Hi Dave, I'd like to take a look too. My email is cakep-php at phi-integration.com. Thanks ! Feris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: So many queries for a belongsTo association...
I found someone who has quite the same problem : http://groups.google.com/group/cake-php/browse_thread/thread/b97c38e4c36fc781/5ec8f3b72282ce69?lnk=gstq=queriesrnum=3#5ec8f3b72282ce69 https://trac.cakephp.org/ticket/2448 But in my case, there are not join at all, that makes me unhappy because it could be faster, and I could sort all my stuff On 26 juil, 21:06, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: On Jul 26, 8:12 pm, Saymons [EMAIL PROTECTED] wrote: Hi everyone, I am using CakePHP 1.1.last_version_here and PostgreSQL 8.0.12 I have a question about the belongsTo association : My models are the following : Asset-HABTM Composer Composer - BelongsTo Composite(Asset) and Component(Asset) snip FWIW, http://groups.google.com/group/cake-php/web/frequent- discussions -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: So many queries for a belongsTo association...
Why ? It is just a BelongsTo association, Cake joins this on other cases... On 26 juil, 20:27, majna [EMAIL PROTECTED] wrote: cake cant join this. try with raw query. On Jul 26, 7:14 pm, Saymons [EMAIL PROTECTED] wrote: Thanks for your answer, but that's not my problem, I need $this-Asset- recursive = 2; else, I won't get all the data I need about the Asset. I don't understand why when my model gets the Composer, it does : SELECT ... FROM tbl_composer WHERE component_id=12 - gives me every composite_id (let's say 15,17 and 21) SELECT ... FROM tbl_asset WHERE id=15 SELECT ... FROM tbl_asset WHERE id=17 SELECT ... FROM tbl_asset WHERE id=21 And not something that looks more like : SELECT ... FROM tbl_composer LEFT JOIN ... as Component ON... LEFT JOIN ... as Composite ON ... WHERE component_id=12; because the Composite and the Component belongsTo the Composer. On 26 juil, 18:27, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: $this-Model-recursive = 0; ---try to put that beofre the findAll()... it will limit how manyqueriesare made and how much data is returned. Does this answer your question? On Jul 26, 8:12 am, Saymons [EMAIL PROTECTED] wrote: Hi everyone, I am using CakePHP 1.1.last_version_here and PostgreSQL 8.0.12 I have a question about the belongsTo association : My models are the following : Asset-HABTM Composer Composer - BelongsTo Composite(Asset) and Component(Asset) So an Asset can have many sons and many parents of the same type. When I'm loading an Asset, the models reads well the data about the Asset himself, but when looking to the HABTM, it reads the Composer table, and then for each row of the table, it reads the Composite and the Component : SELECT ... FROM tbl_asset WHERE id=12 - gives me data about the asset SELECT ... FROM tbl_composer WHERE component_id=12 - gives me every composite_id (let's say 15,17 and 21) but then SELECT ... FROM tbl_asset WHERE id=15 SELECT ... FROM tbl_asset WHERE id=17 SELECT ... FROM tbl_asset WHERE id=21 Is there a way that the Composer could join on the Asset table, not to have so manyqueries? Thx PS : excuse my English, i'm french --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Using models in app controller for default.thtml ???
Components are loaded with var $components = array(MyComponent); and used similar to models i.e. $this-MyComponent-function(); See http://manual.cakephp.org/chapter/components for more details. Geoff On 7/30/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks for you replies friends, i am new to cakephp can you tell me how can i load component in it. Also stil i have develop an component but i will try and create it and let u know. but pls tell me how can i load a compnent and how can i include it in the default.thtml. Thanks On Jul 30, 7:26 am, Tulio Faria [EMAIL PROTECTED] wrote: Or you can try create a component, and load it with loadComponent or anything else. I think it's better... On 29 jul, 21:54, Geoff Ford [EMAIL PROTECTED] wrote: I believe $uses is overwritten by the actual controller that is invoked. I suggest you use loadModel() and creat your own instances of the models you need. Geoff --http://lemoncake.wordpress.com On Jul 29, 8:27 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello Friends, I am new to Cakephp. I am having an problem in it. The scenario is :- i have categories and subcategories. i want to show them as menus so i put them in the default.thtml file. To extract them from the database i have used var $uses =array('Category',Subcategory) in app_controller.php in app directory. and uses this coding :- function beforeFilter() { $maincatmenu=$this-Category-findAll(); //rest of the coding On the basis of $maincatmenu i am extracting categories from the subcategories etc. } It is working fine and menus are showing. But somehow when i try to access some other controllers as categories views etc It is showing the ERROR such as Notice: Undefined property: AppController::$Category in mypath\app \app_controller.php on line 52 Fatal error: Call to a member function findAll() on a non-object in mypath\app\app_controller.php on line 52 and for subcategory as well. I have tried to use var $uses in other controllers such as articles (as i am storing articles on the basis of categories and subcategories) as var $uses=array('Category','Subcategory'); But still when i access the articles action such as mypath/articles/ view/2 etc. it is showing the same Error mentioned above. Pls help. Thanks -- http://lemoncake.wordpress.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Reusing view code
This seems like the thing to do. I have one issue... only the first $this-render(...,'ajax'); Is actually rendered, the rest arent? In my controller i got for each action: ... if ($this-RequestHandler-isAjax()) $this-RequestHandler-renderAs($this, 'ajax'); ... So the action works on It's own with default layout, and the first action i request is rendered inline so what am i missing here? On Jul 29, 12:05 am, rtconner [EMAIL PROTECTED] wrote: I think this would be likely best case $this-viewPath = 'anothercontrollers_folder'; // not needed if file is in controllers viewPath already $this-render('view_file', 'ajax'); // don't use extention ('ajax' is the layout name) Also read up on RequestHandler, it might help you automate this, maybe overwrite beforeRender in app_controller. On Jul 28, 12:16 pm, safl [EMAIL PROTECTED] wrote: Hello, I'm struggling with my views. I can't seem to find the proper way to reuse view code so what i am doing now is a very nasty: ?php require_once(VIEWS .$this-viewPath.'/set_setting.ctp'); ? I am guessing that this is not the intended way to do It but i can't seem to figure out how i am supposed to resuse my views. The thing is, I got a the controller action - user_settings/ mySettings'. The view my_settings.ctp, contains several ajax forms, each with different actions ('setSetting', 'changePassword', 'setInformation' etc.). These actions need a view to display the form after perform the user submission of data and reload the form properly afterwards. So If i don't do the above include of my forms i would be forces to have the code in both my_settings.ctp and in each individual action view. Does anybody have a better solution than the above require/include? regards, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: inserting controller view into another view
How about request action (http://api.cakephp.org/ class_object.html#c40a38b60a3748b9cf75215b92ee3db1). There's a parameter that specifies if an action is being called by another page (though it's name escapes me at the moment). You could use that to send a different layout when it's inside another page. Also, check out elements (http://manual.cakephp.org/chapter/views), they have a very similar function. On Jul 30, 6:49 am, rtanz [EMAIL PROTECTED] wrote: i see, is there some documentation somewhere so i can read more about this? On Jul 30, 5:13 am, Grant Cox [EMAIL PROTECTED] wrote: Using AJAX, quite easily - just populate an area of your page with the remote index action. If you can't use AJAX, not so easily (but more efficiently). You will need to retrieve the appropriate data for the foreign model in the main index action, and display it appriopriately. To get pagination / searching / sorting on both index lists you will need to have some funky named url parameters (to keep the two lists separate). On Jul 30, 8:29 am, rtanz [EMAIL PROTECTED] wrote: hi i have a view pertaining to a particular model and associations. in the index page of this model i would also like to display the index view of another model. can i do this? thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Using models in app controller for default.thtml ???
Thanks Ford, should i add var $components = array(MyComponent); in the app_controller.php ? Also instead of creating component what u think of creating an helper ? I think it can be used as component ? Please let me know. Thanks On Jul 30, 4:58 pm, Geoff Ford [EMAIL PROTECTED] wrote: Components are loaded with var $components = array(MyComponent); and used similar to models i.e. $this-MyComponent-function(); Seehttp://manual.cakephp.org/chapter/componentsfor more details. Geoff On 7/30/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks for you replies friends, i am new to cakephp can you tell me how can i load component in it. Also stil i have develop an component but i will try and create it and let u know. but pls tell me how can i load a compnent and how can i include it in the default.thtml. Thanks On Jul 30, 7:26 am, Tulio Faria [EMAIL PROTECTED] wrote: Or you can try create a component, and load it with loadComponent or anything else. I think it's better... On 29 jul, 21:54, Geoff Ford [EMAIL PROTECTED] wrote: I believe $uses is overwritten by the actual controller that is invoked. I suggest you use loadModel() and creat your own instances of the models you need. Geoff --http://lemoncake.wordpress.com On Jul 29, 8:27 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello Friends, I am new to Cakephp. I am having an problem in it. The scenario is :- i have categories and subcategories. i want to show them as menus so i put them in the default.thtml file. To extract them from the database i have used var $uses =array('Category',Subcategory) in app_controller.php in app directory. and uses this coding :- function beforeFilter() { $maincatmenu=$this-Category-findAll(); //rest of the coding On the basis of $maincatmenu i am extracting categories from the subcategories etc. } It is working fine and menus are showing. But somehow when i try to access some other controllers as categories views etc It is showing the ERROR such as Notice: Undefined property: AppController::$Category in mypath\app \app_controller.php on line 52 Fatal error: Call to a member function findAll() on a non-object in mypath\app\app_controller.php on line 52 and for subcategory as well. I have tried to use var $uses in other controllers such as articles (as i am storing articles on the basis of categories and subcategories) as var $uses=array('Category','Subcategory'); But still when i access the articles action such as mypath/articles/ view/2 etc. it is showing the same Error mentioned above. Pls help. Thanks --http://lemoncake.wordpress.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Use finderQuery in HABTM associations
HI I 'm newbie of cake. I would ask a help. Can someone make me an example of the use of the finderQuery in a HABTM association? Many Thanks Marco --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: $this-action = images ??
THANK YOU! On Jul 30, 12:08 am, Grant Cox [EMAIL PROTECTED] wrote: Or, are you referring to any images in your view that have a relative path (and you aren't using the HTML helper image() function)? If you view localhost/users/index, and there is a relative image images/yourimage.jpg, then your browser will actually request localhost/users/images/yourimage.jpg. This is why you should always use a full path, or preferably use the HTML helper image() function, which does this for you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: AssetPackager for CakePHP
Looks like the Bakery article is live: http://bakery.cakephp.org/articles/view/assetpackager-for-cakephp Brad --- Brad Daily Developer, SlideShowPro Director [EMAIL PROTECTED] On Jul 30, 2:52 am, Brad Daily [EMAIL PROTECTED] wrote: On Jul 30, 12:53 am, Grant Cox [EMAIL PROTECTED] wrote: Indeed. I've put some comments on your blog, but perhaps you should consider a Bakery article for this? Grant - Already done, just waiting approval from the head chefs :) Also, I responded to your comment on my blog... Brad --- Brad Daily Developer, SlideShowPro Director [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Updating Div with ajax
In a view, I would like to be able to click on a button and have the index displayed in a div. I accomplish this by doing the following in a view: div onclick=new Ajax.Updater('main_div', '/admin/groups/ index');GROUP VIEW/div span onclick=new Ajax.Updater(''main_div', '/admin/users/ index');USER VIEW/div ? echo $ajax-div('main_div'); ? ? echo $ajax-divEnd('main_div'); ? However, the index.thtml is displayed in the div with the information generated by default.thtml. In other words, index.thml is displayed the same as it would if I went directly to the address. So, it looks like a page is displayed in my div. How do I prevent this? How would I only display the code that is in the specified index.thtml without the default.thtml it is wrapped in? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Updating Div with ajax
On Jul 30, 2007, at 9:36 AM, madmike210 wrote: In a view, I would like to be able to click on a button and have the index displayed in a div. I accomplish this by doing the following in a view: div onclick=new Ajax.Updater('main_div', '/admin/groups/ index');GROUP VIEW/div span onclick=new Ajax.Updater(''main_div', '/admin/users/ index');USER VIEW/div ? echo $ajax-div('main_div'); ? ? echo $ajax-divEnd('main_div'); ? However, the index.thtml is displayed in the div with the information generated by default.thtml. In other words, index.thml is displayed the same as it would if I went directly to the address. So, it looks like a page is displayed in my div. How do I prevent this? How would I only display the code that is in the specified index.thtml without the default.thtml it is wrapped in? In your controller action: $this-layout = 'ajax'; -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Updating Div with ajax
You can also integrate the component 'RequestHandler' in your controller, that should handle the ajax layout automatically :-) On Jul 30, 5:51 pm, John David Anderson (_psychic_) [EMAIL PROTECTED] wrote: On Jul 30, 2007, at 9:36 AM, madmike210 wrote: In a view, I would like to be able to click on a button and have the index displayed in a div. I accomplish this by doing the following in a view: div onclick=new Ajax.Updater('main_div', '/admin/groups/ index');GROUP VIEW/div span onclick=new Ajax.Updater(''main_div', '/admin/users/ index');USER VIEW/div ? echo $ajax-div('main_div'); ? ? echo $ajax-divEnd('main_div'); ? However, the index.thtml is displayed in the div with the information generated by default.thtml. In other words, index.thml is displayed the same as it would if I went directly to the address. So, it looks like a page is displayed in my div. How do I prevent this? How would I only display the code that is in the specified index.thtml without the default.thtml it is wrapped in? In your controller action: $this-layout = 'ajax'; -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Usinf DATE_FORMAT Expression in findAll()
Hi folks, maybe somone can help me. I want to convert a date field (mySql) in german date format. The mysql query would be: ...DATE_FORMAT(validity_date, '%d.%m.%Y') as formatted_date I tried the following as test without formatting inside the controller and index() - function $this-set( 'events', $this-Event-findAll(NULL, array(*,Event.validity_date as validity_date_fmt)) ); It works fine as expected: Array ( [0] = Array ( [Event] = Array ( [id] = 3 [title] = Testevent #1 [description] = Longdesc . [category_id] = 1 [user_id] = 1 [validity_date] = 2007-10-01 [created] = 2007-07-30 [validity_date_fmt] = 2007-10-01 ) .. And now the formatting: $this-set( 'events', $this-Event-findAll(NULL, array(*,DATE_FORMAT(Event.validity_date, '%d.%m.%Y') as validity_date_fmt)) ); Giving the following results: Array ( [0] = Array ( [Event] = Array ( [id] = 3 [title] = Testevent #1 [description] = Longdesc . [category_id] = 1 [user_id] = 1 [validity_date] = 2007-10-01 [created] = 2007-07-30 ) [0] = Array ( [validity_date_fmt] = 01.10.2007 ) ) .. What do i have to change to get the validity_date_fmt as array-key to the Event-Array ? Thanks in advance, Robert --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Reusing view code
Are you trying to use more one view for an action? That kid of goes against the MVC concept. You might want to rethink how you handle your view. On Jul 30, 7:19 am, safl [EMAIL PROTECTED] wrote: This seems like the thing to do. I have one issue... only the first $this-render(...,'ajax'); Is actually rendered, the rest arent? In my controller i got for each action: ... if ($this-RequestHandler-isAjax()) $this-RequestHandler-renderAs($this, 'ajax'); ... So the action works on It's own with default layout, and the first action i request is rendered inline so what am i missing here? On Jul 29, 12:05 am, rtconner [EMAIL PROTECTED] wrote: I think this would be likely best case $this-viewPath = 'anothercontrollers_folder'; // not needed if file is in controllers viewPath already $this-render('view_file', 'ajax'); // don't use extention ('ajax' is the layout name) Also read up on RequestHandler, it might help you automate this, maybe overwrite beforeRender in app_controller. On Jul 28, 12:16 pm, safl [EMAIL PROTECTED] wrote: Hello, I'm struggling with my views. I can't seem to find the proper way to reuse view code so what i am doing now is a very nasty: ?php require_once(VIEWS .$this-viewPath.'/set_setting.ctp'); ? I am guessing that this is not the intended way to do It but i can't seem to figure out how i am supposed to resuse my views. The thing is, I got a the controller action - user_settings/ mySettings'. The view my_settings.ctp, contains several ajax forms, each with different actions ('setSetting', 'changePassword', 'setInformation' etc.). These actions need a view to display the form after perform the user submission of data and reload the form properly afterwards. So If i don't do the above include of my forms i would be forces to have the code in both my_settings.ctp and in each individual action view. Does anybody have a better solution than the above require/include? regards, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
ACL needs modification for Oracle
Just a note for future generations... ACL in cake_1.1 uses table column names starting with an underscore. Oracle does not allow columns starting with '_' so you will need to modify the classes. When I'm done testing I'll append them to this post (or somewhere more appropriate?). Regards, Shawn --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: ACL needs modification for Oracle
On Jul 30, 2007, at 11:58 AM, starkey wrote: Just a note for future generations... ACL in cake_1.1 uses table column names starting with an underscore. Oracle does not allow columns starting with '_' so you will need to modify the classes. When I'm done testing I'll append them to this post (or somewhere more appropriate?). https://trac.cakephp.org/ -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Use finderQuery in HABTM associations
You could try to look aroudn a bit first. http://groups.google.com/group/cake-php/browse_thread/thread/5ac2bdec0cc6115b/f008cdcaf77a5c80#f008cdcaf77a5c80 On Jul 30, 8:28 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: HI I 'm newbie of cake. I would ask a help. Can someone make me an example of the use of the finderQuery in a HABTM association? Many Thanks Marco --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Help with project design
Hello, I am designing a database to hold scientific observations of animals in the field. The database will be used for several different projects. The basic unit for all projects is the observation, and observations across projects will store the same basic information (and use the same logic), but projects may also need to store some additional information. My plan is to have one main observations table/model/controller, and then additional project specific tables. Each project then hasMany observations and each observation belongsTo one project, and in the observation view I will then find the appropriate project specific table and adjust my forms/displays appropriately. Any thoughts or critiques of this approach? Secondly, I need to store a hierarchical species taxonomy (kingdom, order, genus, etc) in the database and allow users to update it (species classifications are changed frequently). The logic and view for each level is nearly identical, and I would like to avoid creating separate models and controllers for each. The best approach for me would be to dynamically change the table used by a model. My search suggests that this is not possible, but does anyone know for sure? I could also create a new class and inherit from it, but this would still involve creating a separate model and controller file for each level, which is less than ideal. Any suggestions? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Newbie Introduction Book ... reviews anyone?
Hey all-- This thread is getting a little packed with all the requests. Wonderful! However, we don't want to cram up this thread with requests and all relating to the book. I'm therefore urging you to visit me directly at my forum thread dedicated to the book: http://www.davidgoldingdesign.com/forum There, we can discuss everything you want, get as detailed as you want, without providing a disservice to our fellows here on these boards. Also, I feel we would need more threads to keep the conversation going, and I'd like to move that to a different avenue. Any objections, I hope not! But let me know either way. Thanks all-- Dave On Jul 30, 4:52 am, Feris Thia [EMAIL PROTECTED] wrote: On 7/28/07, Dave [EMAIL PROTECTED] wrote: I'm working on a Newbie's Introduction to CakePHP book and would like to invite anyone who would like to review it for errors or considerations I may have overlooked. Let me know, and I'll send you a PDF copy of the current edition. Hi Dave, I'd like to take a look too. My email is cakep-php at phi-integration.com. Thanks ! Feris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
visit counter
any sugestion about the best place to embed to code for visit counter like google analytics or something like that? thank you Óscar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: visit counter
I would suggest the footer of your layout (cake/app/views/layouts). Have fun. On Jul 30, 3:06 pm, Oscar Burgos [EMAIL PROTECTED] wrote: any sugestion about the best place to embed to code for visit counter like google analytics or something like that? thank you Óscar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 do I make a Behavior?
I'm trying to make a behavior for my site, but I can not make it work. I'm using cakePHP 1.2 This is what I have so far: Model: // apple.php ?php class Apple extends AppModel { var $name = 'Apple'; var $actAs = array('A'); ... etc ... Behavior // a.php ?php class ABehavior extends ModelBehavior { function setup($model, $config = array ()) { $this-settings[$model-name] = $settings; } function test($model) { return test; } } ? And in the controller, where I added the model, in a function: print $this-Apple-test(); If I have debugging on, I get an error with one query with output 'test'. What is the thing I'm doing wrong? Greetz, Bob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Updating Div with ajax
Thanks for the help, and suggestions. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: AssetPackager for CakePHP
Brad I've got this up and running, it appears to work well and does what it say!! However on the current download linked from the bakery, i think there is a superfluous 'app' string. In vendors/shells/asset_packager, lines 49 and 54 you construct the path as APP . 'app' and when I use the cake console I get error messages (doubled up app dir in paths). Remove the 'app' string in both cases and it works perfectly. I presume APP provides this subdir for you. HTH, Howard On 7/30/07, Brad Daily [EMAIL PROTECTED] wrote: Looks like the Bakery article is live: http://bakery.cakephp.org/articles/view/assetpackager-for-cakephp Brad --- Brad Daily Developer, SlideShowPro Director [EMAIL PROTECTED] On Jul 30, 2:52 am, Brad Daily [EMAIL PROTECTED] wrote: On Jul 30, 12:53 am, Grant Cox [EMAIL PROTECTED] wrote: Indeed. I've put some comments on your blog, but perhaps you should consider a Bakery article for this? Grant - Already done, just waiting approval from the head chefs :) Also, I responded to your comment on my blog... Brad --- Brad Daily Developer, SlideShowPro Director [EMAIL PROTECTED] -- -- Howard Glynn - Edinburgh, UK [EMAIL PROTECTED] - email, google talk, facebook --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Using models in app controller for default.thtml ???
If you need the component in your default layout put it in the app_controller.php Helpers are for pure presentation logic, such as looping an array and creating a tree. A component is used whenever there may be business logic, such as if this is the main cat then these are the subcats. You probably should be using both. The component to always set the menu data in the template, and a helper to render that menu data as a menu. Geoff On 7/31/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks Ford, should i add var $components = array(MyComponent); in the app_controller.php ? Also instead of creating component what u think of creating an helper ? I think it can be used as component ? Please let me know. Thanks On Jul 30, 4:58 pm, Geoff Ford [EMAIL PROTECTED] wrote: Components are loaded with var $components = array(MyComponent); and used similar to models i.e. $this-MyComponent-function(); Seehttp://manual.cakephp.org/chapter/componentsfor more details. Geoff On 7/30/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks for you replies friends, i am new to cakephp can you tell me how can i load component in it. Also stil i have develop an component but i will try and create it and let u know. but pls tell me how can i load a compnent and how can i include it in the default.thtml. Thanks On Jul 30, 7:26 am, Tulio Faria [EMAIL PROTECTED] wrote: Or you can try create a component, and load it with loadComponent or anything else. I think it's better... On 29 jul, 21:54, Geoff Ford [EMAIL PROTECTED] wrote: I believe $uses is overwritten by the actual controller that is invoked. I suggest you use loadModel() and creat your own instances of the models you need. Geoff --http://lemoncake.wordpress.com On Jul 29, 8:27 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello Friends, I am new to Cakephp. I am having an problem in it. The scenario is :- i have categories and subcategories. i want to show them as menus so i put them in the default.thtml file. To extract them from the database i have used var $uses =array('Category',Subcategory) in app_controller.php in app directory. and uses this coding :- function beforeFilter() { $maincatmenu=$this-Category-findAll(); //rest of the coding On the basis of $maincatmenu i am extracting categories from the subcategories etc. } It is working fine and menus are showing. But somehow when i try to access some other controllers as categories views etc It is showing the ERROR such as Notice: Undefined property: AppController::$Category in mypath\app \app_controller.php on line 52 Fatal error: Call to a member function findAll() on a non-object in mypath\app\app_controller.php on line 52 and for subcategory as well. I have tried to use var $uses in other controllers such as articles (as i am storing articles on the basis of categories and subcategories) as var $uses=array('Category','Subcategory'); But still when i access the articles action such as mypath/articles/ view/2 etc. it is showing the same Error mentioned above. Pls help. Thanks --http://lemoncake.wordpress.com -- http://lemoncake.wordpress.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Paginating results of custom queries?
Is there any way to just pass an array into 1.2's paginate function and have it paginate the data? Essentially, I have an array that is a set of search results returned by some custom queries and a bit of manipulation. I couldn't generate the results I needed by going through $this-paginate because it wouldn't let me join tables, so I'm stuck with using the custom queries. I've seen other topics on this, but there didn't seem to be a clear answer (in fact I'm still not even sure this is possible after reading them all). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Idea about bin
so maybe cake team can add option to code's comment in http://bin.cakephp.org/saved/20450 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Idea about bin
On 7/30/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: so maybe cake team can add option to code's comment in http://bin.cakephp.org/saved/20450 Perhaps there is a language barrier here, but I don't quite understand the question? As far as I can tell the bin is only for temporary code pastes you want to share with people. It's not meant as a permanent location for your code to be commented on by people. Yes, I know that pastes to the bin can be saved but in my opinoin code you want to stick around forever to be commented on should go on your own blog or in the bakery. -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: Just build it, damnit! @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: AssetPackager for CakePHP
Good catch Howard. I just realized that since we store the cake directory in a non-standard location in our application, I had gotten my wires crossed when setting up those paths. I've just updated the package with the fix and a few others I found this morning. If you store cake in a non-standard location like I do (we keep it in ROOT/app/), the recommended solution is to pass the full path to your javascript and CSS folders like so: ./cake asset_packager -js /path/to/webroot/js -css /path/to/webroot/ css Thanks! Brad On Jul 30, 4:34 pm, Howard Glynn [EMAIL PROTECTED] wrote: Brad I've got this up and running, it appears to work well and does what it say!! However on the current download linked from the bakery, i think there is a superfluous 'app' string. In vendors/shells/asset_packager, lines 49 and 54 you construct the path as APP . 'app' and when I use the cake console I get error messages (doubled up app dir in paths). Remove the 'app' string in both cases and it works perfectly. I presume APP provides this subdir for you. HTH, Howard On 7/30/07, Brad Daily [EMAIL PROTECTED] wrote: Looks like the Bakery article is live: http://bakery.cakephp.org/articles/view/assetpackager-for-cakephp Brad --- Brad Daily Developer, SlideShowPro Director [EMAIL PROTECTED] On Jul 30, 2:52 am, Brad Daily [EMAIL PROTECTED] wrote: On Jul 30, 12:53 am, Grant Cox [EMAIL PROTECTED] wrote: Indeed. I've put some comments on your blog, but perhaps you should consider a Bakery article for this? Grant - Already done, just waiting approval from the head chefs :) Also, I responded to your comment on my blog... Brad --- Brad Daily Developer, SlideShowPro Director [EMAIL PROTECTED] -- -- Howard Glynn - Edinburgh, UK [EMAIL PROTECTED] - email, google talk, facebook --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Is this not a security issue?
Hi What if my table is named User and there are three fields called Username, Password, Secretvalue. I present the user a form to change the username and password and use the $this-User-save($this-data) function in the controller to save the form data to the database. I managed to use firefox to create another input element for the Secretvalue and changed the Secretvalue in the User table. Is this not a serious security issue? How can I avoid this? Should I validate before saving data to the database? Thanks morecakepls --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Is this not a security issue?
No it is not... http://api.cakephp.org/class_model.html#ebe42ae387be89985b5a35dd428f5c81 The third param in the save method is what you are looking for in 1.1 same goes for 1.2 but version 1.2 also has the security class that does a little more magic. -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ On 7/30/07, morecakepls [EMAIL PROTECTED] wrote: Hi What if my table is named User and there are three fields called Username, Password, Secretvalue. I present the user a form to change the username and password and use the $this-User-save($this-data) function in the controller to save the form data to the database. I managed to use firefox to create another input element for the Secretvalue and changed the Secretvalue in the User table. Is this not a serious security issue? How can I avoid this? Should I validate before saving data to the database? Thanks morecakepls --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cake PHP running dead slow !-- 60.6669s --
Well, sort of, if your model is set up like this: ?php class User extends AppModel { var $name = 'User'; var $hasOne = array('Profile'); } ? You should be able to use the model Profile in your controller like this: if($this-User-save($this-data['User'])) { $this-User-Profile-save($this-data['Profile']); } But you can use bindModel for this as well. Same concept, just a different way of doing it. I haven't seen any benchmarks on this subject. I just know that it works. I wish I had time to do it because a ton people would be interested in the subject (and thus I'd get a ton of traffic to my website). Anyone out there want to take this on? I'll have time to do it in about 2 months : ). On Jul 30, 3:20 am, phpjoy [EMAIL PROTECTED] wrote: i think that he ment to use the bindmodel() instead of loading a new model.. user-profile-func(); instead of loadModel('user'); loadModel('profile'); i wondered what's the performance difference. On Jul 30, 1:30 am, Grant Cox [EMAIL PROTECTED] wrote: On Jul 29, 4:45 pm, housebolt [EMAIL PROTECTED] wrote: $usesiseviland should be sparsely used. Do you have any benchmarks to back this up, or any comments from the core Cake developers (ie PHPNut or Nate) to this effect? I have not heard this before, and it sounds like FUD. I use loadModel heavily in my code and do not notice any particular performance hit (and afaik loadModel is basically the same as $uses). Cake model instances are cached in the ClassRegistry, and I was under the impression these existing instances were used for associations and $useswhere possible. Certainly there is some performance hit to loading in Model classes (and it shouldn't be done unnecessarily), but unless you have some further proof I don't believe this is any worse whether they are loaded through associations, through $uses, or through loadModel. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cake PHP running dead slow !-- 60.6669s --
I've read discussions from people in the cake core group to this affect, and I've seen it in my own work as well, especially with many large models, which is usually the case for me since I try to keep my controllers as lite as possible. It may not be as large an issue since 1.11 (i think that's when they introduced lazy loading?), but it still does affect load times on shared servers, especially overloaded shared servers. On Jul 29, 4:30 pm, Grant Cox [EMAIL PROTECTED] wrote: On Jul 29, 4:45 pm, housebolt [EMAIL PROTECTED] wrote: $usesiseviland should be sparsely used. Do you have any benchmarks to back this up, or any comments from the core Cake developers (ie PHPNut or Nate) to this effect? I have not heard this before, and it sounds like FUD. I use loadModel heavily in my code and do not notice any particular performance hit (and afaik loadModel is basically the same as $uses). Cake model instances are cached in the ClassRegistry, and I was under the impression these existing instances were used for associations and $useswhere possible. Certainly there is some performance hit to loading in Model classes (and it shouldn't be done unnecessarily), but unless you have some further proof I don't believe this is any worse whether they are loaded through associations, through $uses, or through loadModel. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Is this not a security issue?
Hmm... well usually what you'd want to do is put the secret value into a session variable, $this-Session-write('secretvalue', 'whateverthesecretvalueis'); Once the person has posted the value from the hidden input tag, you can then check it against the secret value to make sure that they're the same. if($this-Session-check('secretvalue') { if ($this-Session-read('secretvalue') == $this-data['Model'] ['secretvalue']) { // everything's a ok }else{ // bad hacker... bad! } }else{ // session value not set, do a redirect } You can also look at the Security component in the CakePHP manual for more security helpers, like requirePost to require a POST rather than a GET request. I also recommend that you buy 'Esential PHP Security' by Chris Shiflett, http://www.oreilly.com/catalog/phpsec/. Hope this helps : ). On Jul 30, 2:42 pm, morecakepls [EMAIL PROTECTED] wrote: Hi What if my table is named User and there are three fields called Username, Password, Secretvalue. I present the user a form to change the username and password and use the $this-User-save($this-data) function in the controller to save the form data to the database. I managed to use firefox to create another input element for the Secretvalue and changed the Secretvalue in the User table. Is this not a serious security issue? How can I avoid this? Should I validate before saving data to the database? Thanks morecakepls --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Cake PHP running dead slow !-- 60.6669s --
There are two reasons to avoid $uses and loadModel in your code. 1. performance: Extra memory will be consummed if you have var $uses and the association in your model. loadModel simply checks if the class exists and includes it if it does not, so the overhead here is minimal. But then you need to create the instance so memory is increased. If you go this route, use the ClassRegistry. By using the registry when you need to gain access to an object you can be assured that you are not adding any extra overhead. 2. maintainability everyone knows we are concerned with maintainable code. We provide var $uses for the exceptions to the rule (ie: contact form, search, etc) These are cases where there is generally no model for that controller and so there is a need to override the default behavior. On the other hand, loadModel can create spaghetti plain and simple. Using loadModel can be likened to using sql in your templates, albeit a little more elegantly. But this is really off topic, because I doubt the site is running slow because of the model loading. It is most likely an issue with server load and/or max clients on apache. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Model::saveField not updating
Using cakePHP 1.1.13.4450 and PHP 4.4.4 This code snippet: $recordIDofPrevious = 1; $sequence = 2; $this-ResumeCredit-recordID = $recordIDofPrevious; $this-ResumeCredit-saveField('sequence', $sequence, false); produces a SQL INSERT instead of an UPDATE; a new record is created in the table with the 'sequence' field set to '2'!! (debug level 3) Per a posting on this group, '$this-ResumeCredit-id = $recordIDofPrevious;' was tried with the same result. Peter - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Home Page?
Quick question that I can't seem to find an answer for. The home page of my site needs to have a lot of dynamic content generated on it. Is there a way to generate this content in some kind of controller? Or is there a way to redirect users to the index of another controller/ view from the home page? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Is this not a security issue?
Thanks, that answered my question! Perfect On Jul 30, 10:48 pm, Larry E. Masters aka PhpNut [EMAIL PROTECTED] wrote: No it is not... http://api.cakephp.org/class_model.html#ebe42ae387be89985b5a35dd428f5c81 The third param in the save method is what you are looking for in 1.1 same goes for 1.2 but version 1.2 also has the security class that does a little more magic. -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ On 7/30/07, morecakepls [EMAIL PROTECTED] wrote: Hi What if my table is named User and there are three fields called Username, Password, Secretvalue. I present the user a form to change the username and password and use the $this-User-save($this-data) function in the controller to save the form data to the database. I managed to use firefox to create another input element for the Secretvalue and changed the Secretvalue in the User table. Is this not a serious security issue? How can I avoid this? Should I validate before saving data to the database? Thanks morecakepls --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Reducing prototype?
On Jul 30, 2007, at 4:13 PM, Howard Glynn wrote: snip Before I go diving into the prototype src components tomorrow, has anyone got any advice / experience / downloads on thinning out a recent up to date prototype for use with cake [1.2] and ajaxhelper?? I use these: http://www.stevekallestad.com/blog/scriptaculous_17_compressed.html http://alex.dojotoolkit.org/shrinksafe/ (smart compression based on Rhino). -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Home Page?
YOu need to set a default Route in app/config/routes.php Geoff -- http://lemoncake.wordpress.com On Jul 31, 8:13 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Quick question that I can't seem to find an answer for. The home page of my site needs to have a lot of dynamic content generated on it. Is there a way to generate this content in some kind of controller? Or is there a way to redirect users to the index of another controller/ view from the home page? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: AssetPackager for CakePHP
I would suggest using the console as I have it setup in the screencasts. This allows you to do everything from the current working directory, which in most cases is the app. From there you can figure out relative paths. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Model::saveField not updating
it would be $this-ResumeCredit-id and if there is no record found then saveField will do an insert. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Model::saveField not updating
Per a posting on this group, '$this-ResumeCredit-id = $recordIDofPrevious; Well then try it again, you did something wrong. All you need is to set Model-id to a non empty value. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Best Practice for Views
I'm curious to know what you all would do in this situation. I have some data that needs to be in several different views but it only has one controller action. What would you do? Right now I have a switch statement in my view and in my controller action I set the variable $var['View'] to whatever page view I need the view.thtml to show. I'm thinking this isn't the best solution and was wondering what you all would do and suggest. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Reducing prototype?
Brad's recent post ( http://tinyurl.com/3bxj9s ) on asset packager has helped a lot, but I'm still struggling with response time on a large intranet app. Before I get jumped on, even though my database relationships are fairly complex, I don't believe the (cake)php page is the problem. Crude measurement with firebug shows the 72k of prototype sticking out like a sore thumb. It represents a large chunk of overall time before the browser request cycle finishes. Essentially, I only need to use ajax helper+prototype for stuff like div remote loads, links and form submissions (which is probably quite a lot now I think about it) This rather dated blog posting ( http://tinyurl.com/yyw5kd ) describes a method by which to vastly reduce the size. i dropped the download into my app but things stopped. I followed the method suggested to roll my own but it didn't work (probably incompatible versions) and I've run out of time tonight to pursue further. Before I go diving into the prototype src components tomorrow, has anyone got any advice / experience / downloads on thinning out a recent up to date prototype for use with cake [1.2] and ajaxhelper?? -- Howard Glynn - Edinburgh, UK [EMAIL PROTECTED] - email, google talk, facebook --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Best Practice for Views
Are you talking about several different skins, but really the same data and presentation? Or are you talking about some non-trivial data calculation, then you want to show the result in several independent areas of your site? I'm just not sure of the reason for the several views on a single action. For the former, have a variable (perhaps session) that determines which layout to use, or even to choose another view file to render (if the structure needs to be quite different). For the latter, you should move the functionality into the appropriate model or component file, so that it can be called from any number of controller actions without duplication. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Model::saveField not updating
If recordID is your primary key in the database table (not id), then you should have var $primaryKey = 'recordID'; in your model file. Then you can have $this-ResumeCredit-id = $recordIDofPrevious; $this-ResumeCredit-saveField( ... ); The -id attribute always means the models primary key, which by default is set to the field id. Changing the $primaryKey var will change what this -id attribute points to in the database, but you still should not use -recordID. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Newbie Introduction Book ... reviews anyone?
Way to go Dave... you certainly have a good writing style. This would be very useful to all. Farez On Jul 27, 7:14 pm, Dave [EMAIL PROTECTED] wrote: I'm working on a Newbie's Introduction to CakePHP book and would like to invite anyone who would like to review it for errors or considerations I may have overlooked. Let me know, and I'll send you a PDF copy of the current edition. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Is this not a security issue?
Oh, hehe I get it now. Sorry, I was assuming you were trying to add a value that you actually did want to add/change in your database. Larry's right (as usual), you can limit the fields can get changed by the third param in $this-Model-save(). On Jul 30, 3:24 pm, morecakepls [EMAIL PROTECTED] wrote: Thanks, that answered my question! Perfect On Jul 30, 10:48 pm, Larry E. Masters aka PhpNut [EMAIL PROTECTED] wrote: No it is not... http://api.cakephp.org/class_model.html#ebe42ae387be89985b5a35dd428f5c81 The third param in the save method is what you are looking for in 1.1 same goes for 1.2 but version 1.2 also has the security class that does a little more magic. -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ On 7/30/07, morecakepls [EMAIL PROTECTED] wrote: Hi What if my table is named User and there are three fields called Username, Password, Secretvalue. I present the user a form to change the username and password and use the $this-User-save($this-data) function in the controller to save the form data to the database. I managed to use firefox to create another input element for the Secretvalue and changed the Secretvalue in the User table. Is this not a serious security issue? How can I avoid this? Should I validate before saving data to the database? Thanks morecakepls --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
A little (and maybe silly) problem
Hey guys, I'm a happy user of cake 1.1 and I'm going to get used to 1.2 now, but I ran into a little problem and hope you can help me out. When I checkout the 1.1.x.x branch and test the cake installation everything runs as it should. But when I checkout the 1.2.x.x branch in the default/welcome instead of: href=/css/cake.generic.css (the way cake 1.1.x.x does) it generates href=\/css/cake.generic.css and that goes for the favicon and js. It seems a bit of a silly problem but I can't get around it gracefully. Hope you guys can help me. I'm using XAMPP, WINDOWS XP. mod_rewrite and vhosts (everything tested and working with cake 1.1.x.x) Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Model::saveField not updating
Well, Grant, you tip is the solution and it worked perfectly! Thanks a million!! On Jul 30, 4:16 pm, Grant Cox [EMAIL PROTECTED] wrote: If recordID is your primary key in the database table (not id), then you should have var $primaryKey = 'recordID'; in your model file. Then you can have $this-ResumeCredit-id = $recordIDofPrevious; $this-ResumeCredit-saveField( ... ); The -id attribute always means the models primary key, which by default is set to the field id. Changing the $primaryKey var will change what this -id attribute points to in the database, but you still should not use -recordID. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Reducing prototype?
I'd also recommend taking a look at the jQuery library. http://jquery.com You can't use Cake's helpers, but the ajax is basically all the same. I haven't used jquery yet, but I've looked at the documentation and it's very impressive, and it's just as easy to use as scriptaculous (maybe even easier). I'm hoping the Cake core group will build a secondary jquery ajax helper someday. On Jul 30, 3:13 pm, Howard Glynn [EMAIL PROTECTED] wrote: Brad's recent post (http://tinyurl.com/3bxj9s) on asset packager has helped a lot, but I'm still struggling with response time on a large intranet app. Before I get jumped on, even though my database relationships are fairly complex, I don't believe the (cake)php page is the problem. Crude measurement with firebug shows the 72k of prototype sticking out like a sore thumb. It represents a large chunk of overall time before the browser request cycle finishes. Essentially, I only need to use ajax helper+prototype for stuff like div remote loads, links and form submissions (which is probably quite a lot now I think about it) This rather dated blog posting (http://tinyurl.com/yyw5kd) describes a method by which to vastly reduce the size. i dropped the download into my app but things stopped. I followed the method suggested to roll my own but it didn't work (probably incompatible versions) and I've run out of time tonight to pursue further. Before I go diving into the prototype src components tomorrow, has anyone got any advice / experience / downloads on thinning out a recent up to date prototype for use with cake [1.2] and ajaxhelper?? -- Howard Glynn - Edinburgh, UK [EMAIL PROTECTED] - email, google talk, facebook --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Home Page?
http://manual.cakephp.org/chapter/configuration - See section 3 Routes Configuration Also checkout the pages folder in /app/views/pages/. Anything you put in there can be accessed from the browser at /pages/your_page/ (which is equal to /app/views/pages/your_page.thtml [or .ctp]) and anything you create there can be routed in your routes.php file (in app/config/routes.php) On Jul 30, 3:13 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Quick question that I can't seem to find an answer for. The home page of my site needs to have a lot of dynamic content generated on it. Is there a way to generate this content in some kind of controller? Or is there a way to redirect users to the index of another controller/ view from the home page? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
Calling functions in a Controller
CakePHP 1.13.4450, PHP 4.4.4 Controller A includes multiple functions, two of which are function build_resume() { . . . } and later in the code, function move_up($sequence) { . . . $this-function build_resume(); } When move_up is called from a view, a notice that sequence is not defined in line 1 of function move_up()!! function build_resume() does not call function move_up() , ever! What am I doing wrong? I tried just function build_resume(); instead of $this- function ... and got a message that function build_resume() was not defined even though it precedes function move_up() in the code. Peter - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Reducing prototype?
I'd also recommend implementing gzip[1] where possible. When I use AssetPackager to combine Prototype, Scriptaculous and my other custom javascripts, then tell my web server to gzip any javascript documents, it results in about 52k for that single file. [1] http://developer.yahoo.com/performance/rules.html#gzip Brad On Jul 30, 6:13 pm, Howard Glynn [EMAIL PROTECTED] wrote: Brad's recent post (http://tinyurl.com/3bxj9s) on asset packager has helped a lot, but I'm still struggling with response time on a large intranet app. Before I get jumped on, even though my database relationships are fairly complex, I don't believe the (cake)php page is the problem. Crude measurement with firebug shows the 72k of prototype sticking out like a sore thumb. It represents a large chunk of overall time before the browser request cycle finishes. Essentially, I only need to use ajax helper+prototype for stuff like div remote loads, links and form submissions (which is probably quite a lot now I think about it) This rather dated blog posting (http://tinyurl.com/yyw5kd) describes a method by which to vastly reduce the size. i dropped the download into my app but things stopped. I followed the method suggested to roll my own but it didn't work (probably incompatible versions) and I've run out of time tonight to pursue further. Before I go diving into the prototype src components tomorrow, has anyone got any advice / experience / downloads on thinning out a recent up to date prototype for use with cake [1.2] and ajaxhelper?? -- Howard Glynn - Edinburgh, UK [EMAIL PROTECTED] - email, google talk, facebook --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Home Page?
With the Pages controller I find that routes don't really help me the way I want. This is what I usually have to do: RewriteRule ^(.*)htm$ pages/$1 [L] so that I can then access pages like: example.com/about_us.htm - example.com/pages/about_us/ Works like a dream, if you don't have any other HTM pages anywhere else. -- Baz L Day In The Life of Baz http://www.LifeOfBaz.com On 7/30/07, housebolt [EMAIL PROTECTED] wrote: http://manual.cakephp.org/chapter/configuration - See section 3 Routes Configuration Also checkout the pages folder in /app/views/pages/. Anything you put in there can be accessed from the browser at /pages/your_page/ (which is equal to /app/views/pages/your_page.thtml [or .ctp]) and anything you create there can be routed in your routes.php file (in app/config/routes.php) On Jul 30, 3:13 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Quick question that I can't seem to find an answer for. The home page of my site needs to have a lot of dynamic content generated on it. Is there a way to generate this content in some kind of controller? Or is there a way to redirect users to the index of another controller/ view from the home page? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Home Page?
Live example: http://www.3hndesigns.com/about_us.htm -- Baz L Day In The Life of Baz http://www.LifeOfBaz.com On 7/30/07, Baz [EMAIL PROTECTED] wrote: With the Pages controller I find that routes don't really help me the way I want. This is what I usually have to do: RewriteRule ^(.*)htm$ pages/$1 [L] so that I can then access pages like: example.com/about_us.htm - example.com/pages/about_us/ Works like a dream, if you don't have any other HTM pages anywhere else. -- Baz L Day In The Life of Baz http://www.LifeOfBaz.com On 7/30/07, housebolt [EMAIL PROTECTED] wrote: http://manual.cakephp.org/chapter/configuration - See section 3 Routes Configuration Also checkout the pages folder in /app/views/pages/. Anything you put in there can be accessed from the browser at /pages/your_page/ (which is equal to /app/views/pages/your_page.thtml [or .ctp]) and anything you create there can be routed in your routes.php file (in app/config/routes.php) On Jul 30, 3:13 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Quick question that I can't seem to find an answer for. The home page of my site needs to have a lot of dynamic content generated on it. Is there a way to generate this content in some kind of controller? Or is there a way to redirect users to the index of another controller/ view from the home page? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: Calling functions in a Controller
I would recommend learning the basics of PHP before getting into CakePHP. Many people already experienced with PHP find a steep learning curve. When you want to call another function from inside the same object, use $this-function_name(), not $this-function function_name(); eg: $this-build_resume() The error about sequence is not defined is because you have not provided a default value for the $sequence parameter, and you are not passing one one from the request. Change it to function move_up( $sequence=null ) and it will fix the error. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: A little (and maybe silly) problem
By testing a little further I discovered that cake is setting: $this-webroot to \/ when it should be just /. I don't know what can be causing that though, rnning in Zend Debugger shows everything running normally. Could someone bring some light into this? On Jul 30, 9:00 pm, Rafael Barbosa [EMAIL PROTECTED] wrote: Hey guys, I'm a happy user of cake 1.1 and I'm going to get used to 1.2 now, but I ran into a little problem and hope you can help me out. When I checkout the 1.1.x.x branch and test the cake installation everything runs as it should. But when I checkout the 1.2.x.x branch in the default/welcome instead of: href=/css/cake.generic.css (the way cake 1.1.x.x does) it generates href=\/css/cake.generic.css and that goes for the favicon and js. It seems a bit of a silly problem but I can't get around it gracefully. Hope you guys can help me. I'm using XAMPP, WINDOWS XP. mod_rewrite and vhosts (everything tested and working with cake 1.1.x.x) Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---
which IDE is better for cakephp develop
i am doing a project using cakephp,, try to find a better ide. thx --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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: which IDE is better for cakephp develop
see http://groups.google.com/group/cake-php/web/frequent-discussions or search the group at http://groups.google.com/group/cake-php this has been asked and answered. Thanks Sam D ps. the short answer is all of them, or which ever one the person who answers uses On 7/30/07, Wimg [EMAIL PROTECTED] wrote: i am doing a project using cakephp,, try to find a better ide. thx -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 do I make a Behavior?
On 7/31/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: If I have debugging on, I get an error with one query with output 'test'. What is the thing I'm doing wrong? What is the error? T -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP 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 -~--~~~~--~~--~--~---