Re: error for send email
On May 13, 2011, at 08:34, hoss7 wrote: i want send email,but i have this error: Warning (2): getmypid() has been disabled for security reasons [CORE/ cake/libs/string.php, line 89] where is my problem Your problem is that in the version of PHP you're running, getmypid() has been disabled for security reasons, and CakePHP uses getmypid() in its uuid() function in CORE/cake/libs/string.php on line 89. And the uuid() function appears to be used in several places in CakePHP, including the generation of email headers. Either run a version of PHP that has not disabled the getmypid() function, or I guess the alternative is for you to modify the uuid() function so that it doesn't use getmypid(). The purpose of uuid() is just to return a Universally Unique IDentifier, so you could rewrite it to pick some other forms of entropy besides the current process id. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: CakePHP App - server switch causing phpMySQL extreme query speed/results variants (but my query IS returning results as expected)
On May 14, 6:23 am, OldWest ja...@jasonwydro.com wrote: AD, I've probably overlooked a lot of things in my scramble to resolve this. I checked the specs on the new server which is running a Pentium III w/ 1 GB RAM. My dev server is running a dual core 3GB RAM ... So that's my first true realization. CakePHP seems to rely on the RAM and processor.. Is your pentium III in a beige box? Beige computers are slower than black ones IME. But seriously - how would you expect a computer which is an order of magnitude slower than the other to respond in the same time? It terms of the timer waterfall. Are you referring to the Took MS column to see which query is hogging the resources? no. Let's put your question in perspective. You go for a 90 minute drive to pick a place and wonder if you can make the journey faster. So you spend 2 days analyzing the time it takes for you and your passengers to get into the car - which represents about 0.5% of your overall journey time. Even if you get it to 0 it's still going to take you 90 minutes to complete your journey. I am using the join option as part of the Cake find() .. and the join does not seem to be natively optimized: SELECT `Zip`.`id`, `Zip`.`title`, `PlansZip`.`id`, `PlansZip`.`plan_id`, `PlansZip`.`zip_id` FROM `zips` AS `Zip` JOIN `plans_zips` AS `PlansZip` ON (`PlansZip`.`plan_id` IN (253, 774, 137, 505, 114, 260, 501, 841, 268, 239, 497, 762, 768, 246, 123, 750, 756, 130, 886, 836, 839, 315, 331, 299) AND `PlansZip`.`zip_id` = `Zip`.`id`) ORDER BY `Zip`.`title` ASC NUM ROWS: 10563105635 So. you don't know what debug kit is - it'll help you to install it, or run xdebug profiles - it's pretty pointless guessing why your app is slow (3s is very slow in the first place...) without looking at real numbers - and right now I think you're fruitlessly focussing on the db log because it's the only thing you've seen with times in it. See liks below AD https://github.com/cakephp/debug_kit http://blog.japanesetesting.com/wp-content/uploads/2009/11/debug_timer.jpg (randomly googled) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: languages flags
Something like this should work: http://book.cakephp.org/view/1441/image http://www.famfamfam.com/lab/icons/flags/ $links[] = $this-Html-image(/img/flags/ . $code . .gif', array( alt = $language, url = array('controller' = '.', 'action' = '..', $code) )); Andras Kende http://www.kende.com On May 14, 2011, at 12:47 AM, pedrosas wrote: I have internationalized application, and I would like to know how I can add a picture flag to each language as I can do to make is seen in an array as an example of http://book.cakephp.org config/bootstrap.php ?php Configure::write('Config.language', 'spa'); Configure::write('Config.languages', array( 'spa' = __('Spanish', true), 'cat' = __('Catalan', true), 'eng' = __('English', true), 'ger' = __('German', true), 'fre' = __('French', true), 'ita' = __('Italian', true) )); views/layauts/default.ctp ?php $links = array(); $currentLanguage = Configure::read('Config.language'); foreach (Configure::read('Config.languages') as $code = $language) { if ($code == $currentLanguage) { $links[] = $language; } else { $links[] = $this-Html-link($language, array('lang' = $code)); } } echo implode(' - ', $links); ? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: ajax pagination cakephp 1.3 - day two cannot get this working.. any tips please
On May 13, 6:32 pm, OldWest ja...@jasonwydro.com wrote: Here is my source code snippets:http://bin.cakephp.org/view/327226811 When you tried the example exactly as shown in the book, did it work? However, you don't need anything like IMO - js belongs in a js file, not your php source. The best way to do ajax pagination (IMO) is do _nothing_ relevant in your view/controller files. and just add something like this to a js file: addPaging(scope) { $('.paging a:not[href^=#]), th a[href*=/page:]', scope).click(function(e) { e.preventDefault(); $('.container').load($(this).attr('href')); addPaging('.container'); }); } Or something of the likes. AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: languages flags
On May 14, 7:47 am, pedrosas pdrsas...@gmail.com wrote: I have internationalized application, and I would like to know how I can add a picture flag to each language as I can do to make is seen in an array as an example ofhttp://book.cakephp.org That's actually a pretty well known mistake. http://www.google.es/search?sourceid=chromeie=UTF-8q=langauge+flags I mean, what flag are you going to use for catalan :) http://es.wikipedia.org/wiki/Idioma_catal%C3%A1n (I assume the relevance of that example isn't lost on the author) AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: CakePHP App - server switch causing phpMySQL extreme query speed/results variants (but my query IS returning results as expected)
On May 14, 9:27 am, AD7six andydawso...@gmail.com wrote: On May 14, 6:23 am, OldWest ja...@jasonwydro.com wrote: AD, I've probably overlooked a lot of things in my scramble to resolve this. I checked the specs on the new server which is running a Pentium III w/ 1 GB RAM. My dev server is running a dual core 3GB RAM ... So that's my first true realization. CakePHP seems to rely on the RAM and processor.. Is your pentium III in a beige box? Beige computers are slower than black ones IME. But seriously - how would you expect a computer which is an order of magnitude slower than the other to respond in the same time? It terms of the timer waterfall. Are you referring to the Took MS column to see which query is hogging the resources? no. Let's put your question in perspective. You go for a 90 minute drive to pick a place and wonder if you can make the journey faster. So you spend 2 days analyzing the time it takes for you and your passengers to get into the car - which represents about 0.5% of your overall journey time. Even if you get it to 0 it's still going to take you 90 minutes to complete your journey. I am using the join option as part of the Cake find() .. and the join does not seem to be natively optimized: SELECT `Zip`.`id`, `Zip`.`title`, `PlansZip`.`id`, `PlansZip`.`plan_id`, `PlansZip`.`zip_id` FROM `zips` AS `Zip` JOIN `plans_zips` AS `PlansZip` ON (`PlansZip`.`plan_id` IN (253, 774, 137, 505, 114, 260, 501, 841, 268, 239, 497, 762, 768, 246, 123, 750, 756, 130, 886, 836, 839, 315, 331, 299) AND `PlansZip`.`zip_id` = `Zip`.`id`) ORDER BY `Zip`.`title` ASC NUM ROWS: 10563105635 ^ That's got nothing to do with optimization. Native or otherwise. You are asking for 10563105635 rows of data - which is an E-normous amount of data. If your app is using all 10 billion rows you're asking for - why, if it's not - why are you asking for them? AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Cake 1.2: Containable problem with model alias
Hello everybody, I try to use a containable search in a CakePHP legacy project using Cake 1.2. I have often uses containable, but never togeterh with aliases. So no idea if that might be the poblem ore something else. The model relations are as follows: Group__ hasMany Members alias Users belongsTo |__ GroupOwner alias User |__ LastPost alias ForumPost___belongsTo |__ PostAuthor alias User As you can see we use model aliases. I have the following containment array: $containment = array( 'GroupOwner' = array( 'fields'= array('GroupOwner.nickname','GroupOwner.id') ), 'LastPost' = array( 'fields'= array('LastPost.user_id', 'LastPost.created'), 'PostAuthor' = array( 'fields' = array( 'PostAuthor.id', 'PostAuthor.firstname', 'PostAuthor.nickname', 'PostAuthor.lastname') ) ) ); The strange behaviour is that I get all model data on the second level e.g. all my GroupMembers which I don't want, but not my PostAuthor which I want. If I add a field condition to my find e.g.: $groups = $this-Group-find('all', array('contain' = $containment, 'fields' = array('GroupOwner.id'), 'limit' = 2)); my result looks like following: GroupOwner (Array, 5 elements) id (String, 2 characters ) 14 nickname (String, 11 characters ) Helfenstein avatar (Array, 4 elements) is_online (Integer) 0 name (String, 12 characters ) Helfenstein LastPost (Array, 3 elements) user_id (String, 6 characters ) 878781 created (String, 10 characters ) 1237332851 id (String, 10 characters ) 1009713631 GroupCategory (Array, 0 elements) Member (Array, 0 elements) Tags (Array, 0 elements) so Members are still there, though luckily empty, but still no PostAuthor. *sigh* Has anybody an idea what might be the problem? Of course var $actsAs = array('Containable'); is set in the app_model.php I find this a very strange behaviour (no pun intended). Thanks in advance for any help! Anja -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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 attachment: anja_liebermann.vcf
Re: Cake 1.2: Containable problem with model alias
Forgot to mention: My complete Information from the Group model is missing, too Anja Am 13.05.2011 16:11, schrieb Anja Liebermann: Hello everybody, I try to use a containable search in a CakePHP legacy project using Cake 1.2. I have often uses containable, but never togeterh with aliases. So no idea if that might be the poblem ore something else. The model relations are as follows: Group__ hasMany Members alias Users belongsTo |__ GroupOwner alias User |__ LastPost alias ForumPost___belongsTo |__ PostAuthor alias User As you can see we use model aliases. I have the following containment array: $containment = array( 'GroupOwner' = array( 'fields'= array('GroupOwner.nickname','GroupOwner.id') ), 'LastPost' = array( 'fields'= array('LastPost.user_id', 'LastPost.created'), 'PostAuthor' = array( 'fields' = array( 'PostAuthor.id', 'PostAuthor.firstname', 'PostAuthor.nickname', 'PostAuthor.lastname') ) ) ); The strange behaviour is that I get all model data on the second level e.g. all my GroupMembers which I don't want, but not my PostAuthor which I want. If I add a field condition to my find e.g.: $groups = $this-Group-find('all', array('contain' = $containment, 'fields' = array('GroupOwner.id'), 'limit' = 2)); my result looks like following: GroupOwner (Array, 5 elements) id (String, 2 characters ) 14 nickname (String, 11 characters ) Helfenstein avatar (Array, 4 elements) is_online (Integer) 0 name (String, 12 characters ) Helfenstein LastPost (Array, 3 elements) user_id (String, 6 characters ) 878781 created (String, 10 characters ) 1237332851 id (String, 10 characters ) 1009713631 GroupCategory (Array, 0 elements) Member (Array, 0 elements) Tags (Array, 0 elements) so Members are still there, though luckily empty, but still no PostAuthor. *sigh* Has anybody an idea what might be the problem? Of course var $actsAs = array('Containable'); is set in the app_model.php I find this a very strange behaviour (no pun intended). Thanks in advance for any help! Anja -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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 attachment: anja_liebermann.vcf
query inside model
I know I must be missing something very simple... This works in the controller: function indexadvertising($id = null) { $this-set('image_id', $this-Workpiece-query(SELECT * FROM `workpieces` WHERE work_id = 3 ORDER BY `adorder`) ); } I am trying to move the SQL out of the controller and into the model but this just returns a SQL error that my syntax is incorrect (even though the query statement is the same in both places.) This fails: In Model: function returnAdvertising() { $this-query(SELECT * FROM `workpieces` WHERE work_id = 3 ORDER BY `adorder`); } In Controller: function indexadvertising($id = null) { $this-set('image_id', $this-Workpiece-returnAdvertising() ); } Warning (512): SQL Error: 1064: You have an error in your SQL syntax; Any advice is very much appreciated. Thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: query inside model
Why don't you use the Cakephp ORM ? -- Thanks, Bogdan Bursuc! I know I must be missing something very simple... This works in the controller: function indexadvertising($id = null) { $this-set('image_id', $this-Workpiece-query(SELECT * FROM `workpieces` WHERE work_id = 3 ORDER BY `adorder`) ); } I am trying to move the SQL out of the controller and into the model but this just returns a SQL error that my syntax is incorrect (even though the query statement is the same in both places.) This fails: In Model: function returnAdvertising() { $this-query(SELECT * FROM `workpieces` WHERE work_id = 3 ORDER BY `adorder`); } In Controller: function indexadvertising($id = null) { $this-set('image_id', $this-Workpiece-returnAdvertising() ); } Warning (512): SQL Error: 1064: You have an error in your SQL syntax; Any advice is very much appreciated. Thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: query inside model
In that SQL error usually says where the error starts. Can u post that too ? -- Thanks, Bogdan Bursuc! I know I must be missing something very simple... This works in the controller: function indexadvertising($id = null) { $this-set('image_id', $this-Workpiece-query(SELECT * FROM `workpieces` WHERE work_id = 3 ORDER BY `adorder`) ); } I am trying to move the SQL out of the controller and into the model but this just returns a SQL error that my syntax is incorrect (even though the query statement is the same in both places.) This fails: In Model: function returnAdvertising() { $this-query(SELECT * FROM `workpieces` WHERE work_id = 3 ORDER BY `adorder`); } In Controller: function indexadvertising($id = null) { $this-set('image_id', $this-Workpiece-returnAdvertising() ); } Warning (512): SQL Error: 1064: You have an error in your SQL syntax; Any advice is very much appreciated. Thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Earn $1000-$2500 per month
Earn $1000-$2500 per month If you Register your name You Get Sign-up bonus $5 AND Get $.20 cent for each referral. Further details http://www.earnbyforex.com/index.php?id=35678365 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Force redirect to be SSL
Oh yeah! I tried that once too and ended up writing a helper to extend HtmlHelper and override the behavior of link based on, in one case, extra passed params, and, in another, a record in the DB for records to be pushed into SSL. What the hell did I do with that thing?? MM On Fri, May 13, 2011 at 11:49 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Just a thought... So ideally you want the link on the page to be https/http, so that it goes straight there when clicked? Could you extend the Html helper to achieve this so that when you use $this-Html-link it does the logic and issues either a secure or an insecure link? This would avoid the logic + redirect on arrival at the target page...I think. Jeremy Burns *Class Outfit* * * jeremybu...@classoutfit.com jeremybu...@mac.com http://www.classoutfit.com On 14 May 2011, at 04:44, Krissy Masters wrote: Thanks for your detailed help but still not what I am referring to. I have a force / unforce ssl for urls but that usually is forced by general surfing on the site if user is on a page requiring SSL then the function redirects….pretty simple. What I am saying is in the controller, in an action itself you have redirect() for whatever reason so send user to another url, now if this url your sending them to requires SSL for example your redirecting them once with the controller redirect…..and beforeRender hits them with a second redirect to force the ssl. It would be easier to simply say in the controller redirect that im sending you to a https url if needed rather than double redirects. Look at firebug to inspect the requests and the way you mention you get 2 requests fired off resulting in 302 redirects. Controller sends to http://site.com/page (302 redirect #1) Gets to http://site.com/page hit with the second redirect 302 since it should be ssl for this example So finally after the second redirect you end up at https://site.com/page. All I was asking is there was a way to simply call the redirect() in the controller to force the ssl right there and then. *From:* cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] *On Behalf Of *Matt Murphy *Sent:* Saturday, May 14, 2011 12:21 AM *To:* cake-php@googlegroups.com *Subject:* Re: Force redirect to be SSL I've done this before with a component which i'd include in relevant controllers and call in needed methods. ?php class SslComponent extends Object { var $controller; function startup($controller) { $this-controller = $controller; } function force() { if(!$this-__isSSL()) { $this-controller-redirect('https://'.$this-__url()); } } function unforce($path = '') { if($this-__isSSL()) { $this-controller-redirect('http://'.$this-__url($path)); } } function __url( $path = '') { $path = $path ? $path : env('REQUEST_URI'); return env('SERVER_NAME').$path; } function __isSSL() { if (env('SERVER_PORT')==443) { return true; } else { return false; } } } -- In my controllers, I htink I'd call $this-Ssl-force(); on the methods I wanted to be in SSL and -unforce() in the rest (which is grossly inferior to using the .htaccess method!). Warning: It was not possible, using this, to go from ssl to non-ssl or visa versa with POST values intact (something this shares with the .htaccess rewrite method.). Sorry if the above is off , but the idea should be clear enough. Er, this is also old as hell. Written for 1.1, I think. MM On Fri, May 13, 2011 at 6:43 PM, Krissy Masters naked.cake.ba...@gmail.com wrote: Not using any htaccess files. I only have 2 redirects that I need to force to SSL I was just curious if there was a way. Maybe this is something future versions of cake might incorporate? Allow an additional param for SSL = true to force the redirect to be ssl rather than a double redirect. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help
Radio Group Label
Hi I'm looking for a way how to change a label of Radio Buttons Group, because the name of group is still visible as name of field ?php echo $this-Form-input('choice', array( 'label'='Opt', 'type' = 'radio' , 'default' = '1', 'options' = array( '1'='option1', '2'='option2' ))); ? I create it like that, and Label is visible as Choice not Opt. What i should do to change it? -- Pozdrawiam Dominik Gajewski -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Radio Group Label
Would you post the HTML that your statement generates? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Force redirect to be SSL
Apologies! You were very detailed in your first email, to which I did not read down. :( MM On Fri, May 13, 2011 at 11:44 PM, Krissy Masters naked.cake.ba...@gmail.com wrote: Thanks for your detailed help but still not what I am referring to. I have a force / unforce ssl for urls but that usually is forced by general surfing on the site if user is on a page requiring SSL then the function redirects….pretty simple. What I am saying is in the controller, in an action itself you have redirect() for whatever reason so send user to another url, now if this url your sending them to requires SSL for example your redirecting them once with the controller redirect…..and beforeRender hits them with a second redirect to force the ssl. It would be easier to simply say in the controller redirect that im sending you to a https url if needed rather than double redirects. Look at firebug to inspect the requests and the way you mention you get 2 requests fired off resulting in 302 redirects. Controller sends to http://site.com/page (302 redirect #1) Gets to http://site.com/page hit with the second redirect 302 since it should be ssl for this example So finally after the second redirect you end up at https://site.com/page. All I was asking is there was a way to simply call the redirect() in the controller to force the ssl right there and then. *From:* cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] *On Behalf Of *Matt Murphy *Sent:* Saturday, May 14, 2011 12:21 AM *To:* cake-php@googlegroups.com *Subject:* Re: Force redirect to be SSL I've done this before with a component which i'd include in relevant controllers and call in needed methods. ?php class SslComponent extends Object { var $controller; function startup($controller) { $this-controller = $controller; } function force() { if(!$this-__isSSL()) { $this-controller-redirect('https://'.$this-__url()); } } function unforce($path = '') { if($this-__isSSL()) { $this-controller-redirect('http://'.$this-__url($path)); } } function __url( $path = '') { $path = $path ? $path : env('REQUEST_URI'); return env('SERVER_NAME').$path; } function __isSSL() { if (env('SERVER_PORT')==443) { return true; } else { return false; } } } -- In my controllers, I htink I'd call $this-Ssl-force(); on the methods I wanted to be in SSL and -unforce() in the rest (which is grossly inferior to using the .htaccess method!). Warning: It was not possible, using this, to go from ssl to non-ssl or visa versa with POST values intact (something this shares with the .htaccess rewrite method.). Sorry if the above is off , but the idea should be clear enough. Er, this is also old as hell. Written for 1.1, I think. MM On Fri, May 13, 2011 at 6:43 PM, Krissy Masters naked.cake.ba...@gmail.com wrote: Not using any htaccess files. I only have 2 redirects that I need to force to SSL I was just curious if there was a way. Maybe this is something future versions of cake might incorporate? Allow an additional param for SSL = true to force the redirect to be ssl rather than a double redirect. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Radio Group Label
Instead of using 'label'='Opt,' - try 'legend'='Opt.' -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Radio Group Label
div class=input radiofieldsetlegendChoice/legendinput type=radio name=data[Epicrisis][choice] id=EpicrisisChoice1 value=1 checked=checked /label for=EpicrisisChoice1option 1/labelinput type=radio name=data[Epicrisis][choice] id=EpicrisisChoice2 value=2 /label for=EpicrisisChoice2option 2/label/fieldset/div 2011/5/14 kdubya kenwin...@winanstech.com: Instead of using 'label'='Opt,' - try 'legend'='Opt.' -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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 -- Pozdrawiam Dominik Gajewski -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Radio Group Label
Thanks. With 'legend' it works :D 2011/5/14 Dominik Gajewski dominikgajews...@gmail.com: div class=input radiofieldsetlegendChoice/legendinput type=radio name=data[Epicrisis][choice] id=EpicrisisChoice1 value=1 checked=checked /label for=EpicrisisChoice1option 1/labelinput type=radio name=data[Epicrisis][choice] id=EpicrisisChoice2 value=2 /label for=EpicrisisChoice2option 2/label/fieldset/div 2011/5/14 kdubya kenwin...@winanstech.com: Instead of using 'label'='Opt,' - try 'legend'='Opt.' -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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 -- Pozdrawiam Dominik Gajewski -- Pozdrawiam Dominik Gajewski -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: error for send email
thank you -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Cake 1.2: Containable problem with model alias
Hello everybody, I try to use a containable search in a CakePHP legacy project using Cake 1.2. I have often uses containable, but never togeterh with aliases. So no idea if that might be the poblem ore something else. The model relations are as follows: Group__ hasMany Members alias Users belongsTo |__ GroupOwner alias User |__ LastPost alias ForumPost |___belongsTo |__ PostAuthor alias User As you can see we use model aliases. I have the following containment array: $containment = array( 'GroupOwner' =array( 'fields'=array('GroupOwner.nickname', 'GroupOwner.id') ), 'LastPost' =array( 'fields'=array( 'LastPost.user_id', 'LastPost.created'), 'PostAuthor' =array( 'fields' =array( 'PostAuthor.id', 'PostAuthor.firstname', 'PostAuthor.nickname', 'PostAuthor.lastname') ) ) ); The strange behaviour is that I get all model data on the second level e.g. all my GroupMembers which I don't want, but not my PostAuthor which I want. If I add a field condition to my find e.g.: $groups = $this-Group-find('all', array('contain' =$containment, 'fields' =array('GroupOwner.id'), 'limit' =2)); my result looks like following: GroupOwner (Array, 5 elements) id (String, 2 characters ) 14 nickname (String, 11 characters ) Helfenstein avatar (Array, 4 elements) is_online (Integer) 0 name (String, 12 characters ) Helfenstein LastPost (Array, 3 elements) user_id (String, 6 characters ) 878781 created (String, 10 characters ) 1237332851 id (String, 10 characters ) 1009713631 GroupCategory (Array, 0 elements) Member (Array, 0 elements) Tags (Array, 0 elements) so Members are still there, though luckily empty, but still no PostAuthor. My complete Information from the Group model is missing, too *sigh* Has anybody an idea what might be the problem? Of course var $actsAs = array('Containable'); is set in the app_model.php I find this a very strange behaviour (no pun intended). Thanks in advance for any help! Anja -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: query inside model
Bogdan, thanks for the reply. I agree... Probably should rethink all of it to avoid any custom queries. Still curious why it isn't working. Here is more info: $sql= returnAdvertising $error = 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'returnAdvertising' at line 1 $out= null [CORE/cake/libs/model/datasources/dbo_source.php, line 681] thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: languages flags
/* CSS */ select option{ padding: 4px 0px 0px 24px; background-repeat: no-repeat; background-position: 4px center; } /*flags*/ select option[value=cat] { background-image: url(../img/admin/flags/catalonia.png); } select option[value=esp] { background-image: url(../img/admin/flags/es.png); } . /*cakephp form select elements*/ ?php echo $this-Form-input('languages', array( 'options'=array( 'esp'='ESP', 'cat'='CAT', 'por'='POR'), 'label'=__('Languages',true))); ? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: query inside model
erikober, I wonder if there is a syntax error higher up in the code. Getting your function name returned as bad SQL is weird... but not unusual. I've definitely seen it more than once in my pages. Anyhoo... this is such a simple query, GO NATIVE! In you're Model, try: $this-find('all', array( 'conditions' = array('WorkPiece.work_id' = 3), 'order' = 'adorder' ); Regards, Don On May 14, 7:09 am, erikober upperho...@gmail.com wrote: Bogdan, thanks for the reply. I agree... Probably should rethink all of it to avoid any custom queries. Still curious why it isn't working. Here is more info: $sql = returnAdvertising $error = 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'returnAdvertising' at line 1 $out = null [CORE/cake/libs/model/datasources/dbo_source.php, line 681] thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Cake 1.2: Containable problem with model alias
Anja, There is a parenthesis misplacement in your sample code. If that exists in your real code it's probably your problem. The array for LastPost doesn't get its closing paren until after PostAuthor. Here's the correction: $containment = array( 'GroupOwner' = array( 'fields' = array('GroupOwner.nickname', 'GroupOwner.id') ), 'LastPost' = array( 'fields' = array('LastPost.user_id', 'LastPost.created'), ), 'PostAuthor' = array( 'fields' = array( 'PostAuthor.id', 'PostAuthor.firstname', 'PostAuthor.nickname', 'PostAuthor.lastname' ) ) ); Regards Don On May 14, 7:05 am, acl68 c...@anjaliebermann.de wrote: Hello everybody, I try to use a containable search in a CakePHP legacy project using Cake 1.2. I have often uses containable, but never togeterh with aliases. So no idea if that might be the poblem ore something else. The model relations are as follows: Group__ hasMany Members alias Users belongsTo |__ GroupOwner alias User |__ LastPost alias ForumPost |___belongsTo |__ PostAuthor alias User As you can see we use model aliases. I have the following containment array: $containment = array( 'GroupOwner' =array( 'fields'=array('GroupOwner.nickname', 'GroupOwner.id') ), 'LastPost' =array( 'fields'=array( 'LastPost.user_id', 'LastPost.created'), 'PostAuthor' =array( 'fields' =array( 'PostAuthor.id', 'PostAuthor.firstname', 'PostAuthor.nickname', 'PostAuthor.lastname') ) ) ); The strange behaviour is that I get all model data on the second level e.g. all my GroupMembers which I don't want, but not my PostAuthor which I want. If I add a field condition to my find e.g.: $groups = $this-Group-find('all', array('contain' =$containment, 'fields' =array('GroupOwner.id'), 'limit' =2)); my result looks like following: GroupOwner (Array, 5 elements) id (String, 2 characters ) 14 nickname (String, 11 characters ) Helfenstein avatar (Array, 4 elements) is_online (Integer) 0 name (String, 12 characters ) Helfenstein LastPost (Array, 3 elements) user_id (String, 6 characters ) 878781 created (String, 10 characters ) 1237332851 id (String, 10 characters ) 1009713631 GroupCategory (Array, 0 elements) Member (Array, 0 elements) Tags (Array, 0 elements) so Members are still there, though luckily empty, but still no PostAuthor. My complete Information from the Group model is missing, too *sigh* Has anybody an idea what might be the problem? Of course var $actsAs = array('Containable'); is set in the app_model.php I find this a very strange behaviour (no pun intended). Thanks in advance for any help! Anja -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: query inside model
You are getting that error because it seems like your model is not found. Its using the AppModel in its place. Try debugging it. debug($this-Workpiece); On May 14, 7:13 pm, dreamingmind dreamingmin...@gmail.com wrote: erikober, I wonder if there is a syntax error higher up in the code. Getting your function name returned as bad SQL is weird... but not unusual. I've definitely seen it more than once in my pages. Anyhoo... this is such a simple query, GO NATIVE! In you're Model, try: $this-find('all', array( 'conditions' = array('WorkPiece.work_id' = 3), 'order' = 'adorder' ); Regards, Don On May 14, 7:09 am, erikober upperho...@gmail.com wrote: Bogdan, thanks for the reply. I agree... Probably should rethink all of it to avoid any custom queries. Still curious why it isn't working. Here is more info: $sql = returnAdvertising $error = 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'returnAdvertising' at line 1 $out = null [CORE/cake/libs/model/datasources/dbo_source.php, line 681] thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Future Development Planning
I am working on a rather large project that will expand overtime as the site grows. So as I have never done this with Cake I was wondering how does one go about this. I know in 3 months we will be adding some new features once there are more users (10k Users) Now there is no way to test the functionality of these new features without the users / db records so we need to wait until we actually have this to start testing these new site options. But how? Once we have the base membership goal reached how do we add in new features / controllers and so on in an already live environment. We need to test it using the database yet also allow only developers to be able to see it as if it were a live account but not to actual live users? Thanks, K -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Accessing other model not working
Parts hasMany Prices. Parts belongsTo Prices The idea is a part can have many prices but Part will have one Price ID that will indicate the default price. In the Prices controller, how would I go about updating the Parts field? I searched around and it seems to be a common problem, but the answers didn't get me anywhere. One of my attempts that doesn't work.. this code is if the Price Add form is submitted and the user indicated it was the default (prime): $this-Part-id = $this-data['Price']['part_id']; $partdata = $this-Part-read(); $partdata['Part']['prime_price_id'] = $this-Price-getLastInsertId(); $this-Part-save($this-data); -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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