Re: URL rewriting is not properly configured on your server
On Tue, Jan 13, 2015 at 1:31 AM, Anchit Jindal anchitjindal1...@gmail.com wrote: The thing which look suspicious to me is that the following files in root folder are named incorrectly: .htaccess is named as _htaccess When I tried to rename these files according to their correct name, it gave 'Internal Server Error'. Probably your host does not allow Apache dir based configuration. Ask your provider about it. Regards. -- MARCELO F ANDRADE | Belem, Amazonia, Brazil | http://marceloandrade.info -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: can any body suggest me to create cms in cakephp from scratch
On Thu, Apr 24, 2014 at 3:34 PM, Ankit balyan ankit.kr.bal...@gmail.com wrote: i have start using cakephp recent and much friendly with its important api's, but now i want to create a simple cms with cakephp, so that my most of the basics and doublts clear and so develop large projects. thank you. Start with the CakePHP blog tutorial. After finished, write us your next impressions and needs. http://book.cakephp.org/2.0/en/getting-started.html Regards. MARCELO F ANDRADE | Belem, Amazonia, Brazil | http://about.me/mfandrade -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: Missing Database Table, two models are joined and asking new table
On Fri, Apr 25, 2014 at 3:25 AM, mdv mdv...@gmail.com wrote: I have 2 models - Issue and Publication But cakePHP is showing Error: Table issue_publications for model IssuePublication was not found in datasource default Give us more details. How these two models are related? Regards. MARCELO F ANDRADE | Belem, Amazonia, Brazil | http://about.me/mfandrade -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: not loading js and css !!!
On Mon, Sep 9, 2013 at 4:09 AM, Lilit lilitbaku...@gmail.com wrote: how should i enabled url rewrite ? 1) Be sure if you have mod_rewrite enabled in your webserver 2) In your httpd.conf, set the option AllowOverride all for your website 3) Check if you have .htaccess in the CakePHP root, app and webroot folders Regards. MARCELO F ANDRADE | Belem, Amazonia, Brazil | http://about.me/mfandrade -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out.
Re: Is make desktop application in cakephp
On Tue, Aug 20, 2013 at 3:23 PM, Ankur Chauhan ankurchauhan4...@gmail.com wrote: Is make desktop application in cakephp? Years ago, I tried that using a tiny embedded webserver, Sqlite database and an interface with Mozilla Prism. Regards, MARCELO F ANDRADE | Belem, Amazonia, Brazil | http://about.me/mfandrade -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out.
Re: Cakephp blog tutorial, SQL error when INSERTING into posts.
On Mon, Aug 5, 2013 at 11:51 AM, Greg Sarpy on.const...@gmail.com wrote: (..) I am trying to *INSERT INTO POSTS* exactly as it is in the manual: INSERT INTO posts (title,body,created) VALUES ('The title', 'This is the post body.', NOW()); (..) It immediately outputs the following error: (..) MySQL said: #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 'title’, ’This is the post body.’, NOW())' at line 2 I'm not sure about what is going on. But I can suppose the command is using the typographic quotes (“) instead of normal double quotes () to delim text. Did you typed the SQL insert in a Mysql client or just copy- and-paste the command from the cookbook? Additionally, check if this tip can help. http://markmcb.com/2011/11/07/replacing-ae%E2%80%9C-ae%E2%84%A2-aeoe-etc-with-utf-8-characters-in-ruby-on-rails/ Regards. MARCELO F ANDRADE | Belem, Amazonia, Brazil | http://about.me/mfandrade -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out.
Re: hasMany / belongsTo not working
On Tue, Jul 30, 2013 at 6:50 AM, WhyNotSmile sharongilmor...@gmail.com wrote: I have a pretty simple pair of objects, Photo and Album, defined as follows: class Album extends Model { public $name = 'Album'; public $hasMany = array( 'Photo' = array( 'className' = 'Photo', 'order' = 'Photo.order ASC' ) ); } class Photo extends Model { public $name = 'Photo'; public $belongsTo = array('Album'); } I currently have 3 albums, one with 0 photos, one with 1 photo, and one with 2 photos. When I do the following in the controller, I expect to get 3 albums back: $albumlist = $this-Album-find('all'); debug($albumlist); But in fact, I get 4 - the one with 2 photos is shown twice. If I had another photo, I get the album back 3 times. I'm absolutely stumped as to what's causing this, and have a feeling it must be something really stupid that I've done. I've set up much more complex models than this in the past, with no problems. Did you inserted the records using those CakePHP models? Is your database modeled properly? How the related SQL queries looks like in debug mode? Check if you get the same information querying the database directly with something like this (assuming the standard conventions) in your SGBD query prompt. SELECT p.* FROM photos p INNER JOIN albums a ON (p.album_id=a.id) Assuming you followed the standard conventions and just for a debugging purpose, try to simplify your associations and redo the tests. // Album public $hasMany = 'Photo'; // Photo public $belongsTo = 'Album'; Hope it helps. MARCELO DE FREITAS ANDRADE https://mailstrom.co/mfandrade -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out.
Re: language problem in database cake1.3
On Tuesday, December 11, 2012 10:36:01 AM UTC-8, Chris wrote: anyone,...? why do I see this crap in a view with cake1.3,? ›Ð°Ñ ковый май- Розовый вечер where it used to work in 1.2 thanks Em 11/12/2012 23:59, Chris chris...@yahoo.com escreveu: the problem is solved,... Please, share with us how did you fix it. MARCELO DE FREITAS ANDRADE Minha alma é maior do que eu. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: CakePHP in Production throws odd error when inside a folder
Em 12/12/2012 07:19, Athan Clark athan.cl...@gmail.com escreveu: Hi everyone, I'm having a bit of trouble getting my app installed properly on my server. I have it inside a folder, yet CakePHP sees it as a request to a controller when I try to view it... it's a weird bug. The app is inside a folder called /safetytraining-2/ and when I view it in development, it works just fine. However, when I try to view it in production, it throws a Error: The requested address '/safetytraining-2/' was not found on this server.. But, the request is still sent to CakePHP! Do you think it has something to do with the .htaccess inside my folder? Maybe the .htaccess inside my root folder? I could really use the help :S You can view the error at athanclark.com/safetytraining-2/ Also, my tmp directory is fully writable, and I know that my server has mod_rewrite fully installed. This is also a fresh install of cakephp, right out of the zip file. Thanks in advance!! Check the permissions/ownership of this and related folders. Also look he Apache logs forany tips. Cheers. MARCELO DE FREITAS ANDRADE Minha alma é major do que eu. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Cake PHP v 2.2.4 - Newbie, blog tutorial does not work?
Em 11/12/2012 00:42, Paul Marriott paulmarrio...@googlemail.com escreveu: I have installed and run through the Blog tutorial and am getting the error http://localhost/cakephp-cakephp-b2812f2/posts/index Error: PostsController could not be found The file definitely exists, I have tried the tutorial twice now so must have something wrong. Are you sure about the CakePHP version? Double check the name of your posts_controller or PostsController file. If you're in doubt, try to generate this file with cake bake. Cheers. MARCELO DE FREITAS ANDRADE Minha alma é maior do que eu. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: can anyone help me how to print the data in new window with the controller action.
On Tue, Nov 27, 2012 at 4:23 AM, nama venkatesh nama@gmail.com wrote: Subject: can anyone help me how to print the data in new window with the controller action. I'm not sure about what you need exactly. But if you're trying to print a content opened in a new window, you can just do it with JavaScript code like window.opener.print(). Cheers. -- MARCELO F ANDRADE Belem, Amazonia, Brazil I took the red pill -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: find and display groups by higher ranking
On Fri, Nov 23, 2012 at 12:18 AM, Chris chris...@yahoo.com wrote: $groups = $this-Group-find('all', array('conditions' = array('Group.rank' = how to display group with higher ranking on top of others ))); $this-Group-find('all', array('order' = 'Group.rank')) Always check the documented API: http://api.cakephp.org/class/model#method-Modelfind Regards. -- MARCELO F ANDRADE Belem, Amazonia, Brazil I took the red pill -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Showing selected values in a HABTM
Arak, Would you mind posting your solution, I´m stuck in the same problem as you Thks! On Monday, March 1, 2010 12:42:02 AM UTC-3, Arak Tai'Roth wrote: Nevermind, I got it figured out, thank you for your help. On Feb 28, 9:24 pm, Arak Tai'Roth nielsen.dus...@gmail.com wrote: I'm not sure I am following. I see where you are setting the data that you have, but I am not seeing where you are using that data in the view at all? Or do you not need to use it anywhere, cake just does? On Feb 28, 4:11 am, John Andersen j.andersen...@gmail.com wrote: This is what I do, a small view example: [code] ?php echo $form-create('Permit',array('action' = 'add')); ? ?php echo $form-input('Activity',array('multiple' = 'checkbox', 'label' = 'Activity')); ? ?php echo $form-end('Save'); ? [/code] and to ensure that the Activity field is filled with the possible values and the chosen ones are checked, here is the small controller code example: [code] $permits = $this-Permit-find( 'first', array( 'conditions' = array( 'Permit.id' = 1 ), 'contain' = array( 'Leader' = array('Country','ProvState'), 'User', 'RegistrationLocation', 'Activity' ) ) ); $this-data = $permits; $this-set('activities',$this-Permit-Activity-find('list',array('contain' = false))); [/code] Hope this helps you on the way ;) Enjoy, John On Feb 28, 10:37 am, Arak Tai'Roth nielsen.dus...@gmail.com wrote: Hey everyone, I did try looking around here and on google for this issue, however I can only find data that relates to problems 3 years ago, which doesn't help as much as I'd like it to. I could likely use it, but I figured that by now, Cake must have a more elegant way of doing this. I want to show the data that was selected in a HABTM in my edit form. I can see that the data is populated in $this-data when I do a read(), however it doesn't seem to be populating the multi-select box I have created. This is the code for the multi-select box: echo $form-input('Activity', array('label' = false, 'type' = 'select', 'options' = $dbactivities, 'multiple' = true)); Can anyone tell me how to display what items are selected? -- 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
Could not describe table Error: An Internal Error Has Occurred.
Hey guys, I am using cake 2.0 alpha. (I don't know why I chose this for something I needed to work consistently, but I haven't had any trouble until now.). I didn't make any changes to my database or code in the last day, and am suddently getting this error. Could not describe table for SimilarDebater Error: An Internal Error Has Occurred. With a stack trace of: #0 /home/fantas53/public_html/ranking_systems/round_parser/lib/Cake/ Model/Model.php(989): Mysql-describe(Object(SimilarDebater), false) #1 /home/fantas53/public_html/ranking_systems/round_parser/lib/Cake/ Model/Model.php(1160): Model-schema() #2 /home/fantas53/public_html/ranking_systems/round_parser/app/ controllers/statistics_controller.php(410): Model-create() #3 /home/fantas53/public_html/ranking_systems/round_parser/app/ controllers/statistics_controller.php(389): StatisticsController- calculate_associations_between_debaters() #4 /home/fantas53/public_html/ranking_systems/round_parser/lib/Cake/ Routing/Dispatcher.php(151): StatisticsController- calculate_associations_between_all_names() #5 /home/fantas53/public_html/ranking_systems/round_parser/lib/Cake/ Routing/Dispatcher.php(102): Dispatcher-_invoke(Array, Array) #6 /home/fantas53/public_html/ranking_systems/round_parser/app/webroot/ index.php(80): Dispatcher-dispatch(Object(StatisticsController), Object(CakeRequest)) #7 {main} Obviously, there is something wrong with the creation of a new object, but I can't figure out for the life of me why the describe query is failing. I have manually described the table in question with no problems. Any help would be greatly appreciated! Thanks, Jon -- 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: When Testing controllers, what should I be testing?
On 25 ago, 10:58, j.blotus j.blo...@gmail.com wrote: (..) I would like to get code coverage going for my controllers, but since they do not return anything, what exactly am I going to be testing for? (..) Basically, you can use the testAction method to test the variables an action set to the view (my choice) or even the HTML code rendered. http://book.cakephp.org/view/1210/Testing-controllers#The-testAction-method-1212 -- MARCELO F ANDRADE Belem, Amazonia, Brazil I took the red pill Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: save() omitted
On Thu, Jul 1, 2010 at 1:57 PM, Andrei Mita andrei.m...@gmail.com wrote: I am unbelievably stupid some times. I have lost two days trying to figure this one out and it never crossed my mind to check the validation rules in the model. And everything was right there in the manual: If for some reason your data isn't saving, be sure to check to see if some validation rules aren't being broken. Thanks for the help. That's extremely common. Nice suggest. Best regards. -- MARCELO F ANDRADE Belem, Amazonia, Brazil I took the red pill Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Internationalizing the Application
On Tue, Jun 22, 2010 at 2:08 AM, Narendra Padala crazycake...@gmail.com wrote: (..) I dont know wat to use. i18n, p28n or l10n. I even dont the difference between them. i18n and l10n are acronyms for the words internacionalization (letter i, 18 letters, letter n) and localization (you guess it). Internacionalization is a term referent to language, while localization is related to other specific locale stuffs, like numbers, currency, etc. p28n is the name of a component to help you to get persistent internacionalization. (Personally, as you are new to Cake, I don't recomend you to use it for now). I was read the below articles but i didn't get, http://book.cakephp.org/view/163/Localization-in-CakePHP Well, to get a multilanguage site, start with the article in the link above. Enclose all text messages in your code with gettext functions (for now I mean, use __('My message') instead of 'My message'), save a .po file in the proper local and set you default language in the Config.language configuration entry. Cake can generate .po files for you when you run: cake i18n extract Best regards. -- MARCELO F ANDRADE Belem, Amazonia, Brazil I took the red pill Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Email component
On Wed, Jun 16, 2010 at 2:19 PM, Daniel daniel.g...@gmail.com wrote: (..) but when i include in my controller a config.php file: ?php define('EMAIL', 'exam...@domain.com'); ? and try to use EMAIL to set the destination, it doesn't work :-(. Not sure, but maybe you should try this: !defined('EMAIL') define('EMAIL', 'exam...@domain.com'); Or even define constants in your bootstrap.php. Atts. -- MARCELO F ANDRADE Belem, Amazonia, Brazil I took the red pill Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Problem with form creation after upgrade to 1.2.7
On Wed, Jun 16, 2010 at 5:53 PM, syra...@googlemail.com syra...@googlemail.com wrote: The index.ctp has this line : ?php echo $form- create('CautareProduseVechi',array('action'='cautareProduseVechi'));? This generated html code is : form id=CautareProduseVechiCautareProduseVechiForm method=post action=/new_admin/cautare_produse_vechis/cautareProduseVechi The old 1.2.0 was generating : form id=CautareProduseVechiAddForm method=post action=/new_admin/ intretinere/cautareProduseVechi A tip: don't bother with that. Let Cake abstract this for you. If you really really want, you can set attribs for your form. ?php echo $form-create('CautareProduseVechi',array('action'='cautareProduseVechi', 'id' = 'CautareProduseVechiAddForm')); Best regards. -- MARCELO F ANDRADE Belem, Amazonia, Brazil I took the red pill Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Format date with span classes
On Thu, Jun 17, 2010 at 4:56 AM, jnjn jn.nor...@gmail.com wrote: Hello, On my cake blog i output dates on my posts with this line: ?php echo date('jF,Y',strtotime($post['Post']['date']));? outputs: 19March,2010 How can i output this: 19 March 2010 This way? ?php echo date('j',strtotime($post['Post']['date']));?br / ?php echo date('F',strtotime($post['Post']['date']));?br / ?php echo date('Y',strtotime($post['Post']['date']));? Best regards. -- MARCELO F ANDRADE Belem, Amazonia, Brazil I took the red pill Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: How i can increase session time in cakephp,
On Mon, Jun 14, 2010 at 8:15 AM, arif hossen arifhossen2...@gmail.com wrote: Dear Experts, How i can increase session time in cakephp, You can change Security.level in app/config/core.php and there is a Session.timeout entry too. Atts. -- MARCELO F ANDRADE Belem, Amazonia, Brazil I took the red pill Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Strange form helper output I can't understand: divs after input
On Tue, May 18, 2010 at 8:48 PM, madcousinphil_ madcousinp...@gmail.com wrote: (..) 1st Question: What is with the very first input before the opening of the form? I don't think it is hurting, but why is it there? Look at the opening form tag Cake creates for you. Where the information about the method the form uses came from? The default method is post. That hidden field is only a control field Cake uses to retain this information internally in the views and in the rendered html code. 2nd question: You can see that the div which is supposed to be wrapping the input is actually output after the input, and is empty. eg: input type=submit value=Save Category / div class=submit/ div This is a problem for me because I would like to use this to style the label and input field. I can't understand what I did wrong. Has this happened to anyone before? How can I make it wrap the input like this div class=submitinput type=submit value=Save Category // div I'm not sure, but I think this additional div is used for validation messages. You can omit it this way echo $form-input('name', array('div' = false)); Best regards. -- MARCELO F ANDRADE Belem, Amazonia, Brazil I took the red pill Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: User errors and fat model, skinny controller
On Mon, May 17, 2010 at 8:27 PM, calvin cal...@rottenrecords.com wrote: (..) The essence of the problem is that the upload() method in your model is returning a boolean value while, in fact, it can sinalize more than just two opposite situations. A better solution would be return some kind of status code or even throw exceptions for each expected situation in your case. Best regards. -- MARCELO F ANDRADE Belem, Amazonia, Brazil I took the red pill Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Multiple controller for 1 layout
I'd like to know how to display in a single layout, the result of 2 or more controllers ? Thanks for your help Franck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
View this page CakePHP In The Wild
I noticed i forgot to add my links in alphabetical order, also moved another link i saw mas misplaced Click on http://groups.google.com/group/cake-php/web/cakephp-in-the-wild - or copy paste it into your browser's address bar if that doesn't work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
View this page CakePHP In The Wild
Just put in some of my cakephp pages Click on http://groups.google.com/group/cake-php/web/cakephp-in-the-wild - or copy paste it into your browser's address bar if that doesn't work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Tools for merging directories
I use piston for my vendor branching needs, really works perfectly. http://piston.rubyforge.org/ On Jun 6, 8:25 am, David Zentgraf [EMAIL PROTECTED] wrote: Oh, of course, deleting them in the Finder shouldn't be too hard. I was too fixated on the CLI. I'll try it when I get home. On 6/6/08, Grant Cox [EMAIL PROTECTED] wrote: I was about to reply with something glib - since all you want to do is list all files in the folder (recursively), select them and delete (trivial with Windows Explorer). However I had a chat with one of our Mac guys here, and we couldn't figure it out in Finder / Spotlight. How do you list all files in spotlight? Similarly, the next step requires you copy (or export) into this skeleton folder structure, so you can re-commit. However, on a Mac it will not insert these files into the tree - it'll delete the existing tree and replace it completely. Again, coming from Windows this is very surprising, and annoying behaviour. I'm a bit short of time to experiment, as I'm sure you'd be able to use the command line del in a similar manner (delete all files, leave all folders). And of course you can use the tar/untar method to insert files into a tree. But I agree, on a Mac this method is far more tedious than it needs to be. On Jun 5, 6:17 pm, David C. Zentgraf [EMAIL PROTECTED] wrote: HiGrant, I read the SVN book vendor branching article in the meantime and agree with your points. Quite a lot of dilemmas that can pop up. What I'm still not sure about is how to best update the /vendors/ current directory. Your article only covers the Windows del command. Are there equivalent flags for UNIX' rm to remove all files throughout a directory tree, excluding .svn dirs? I guess I could come up with a script for that, but my shell foo is just limited enough to repeatedly shoot myself in the foot before getting it right. Maybe. ;o) I guess I'd still have to use a Merge utility for that. Is anybody using the svn_load_dirs.pl script? On 5 Jun 2008, at 16:52,GrantCoxwrote: Yes, with vendor branching you basically create a diff of the changes to the CakePHP core, then apply that to your own copy. Do you have a File/Folder merge utility that can do this - compare between the original core, the new core, and your application core? Because just comparing between the new core and your application core will not make your own changes obvious - if you have made any changes to the core (what about /app/config/core.php, or /app/webroot/index.php ?). Using vendor branching, I can update the cake core in my application within 60 seconds (SVN update to newest core, replace into my own repository, commit my own repository, perform merge on application). And my core changes (of which I have about a dozen, generally associated to outstanding enhancement tickets), are safe - I only have to look at conflicts if there are any. Without vendor branching, I imagine you have to view a list of every single changed file (usually many dozens, probably hundreds for your RC1 update), and decide for yourself how these are merged. Sure, if you are 100% sure you have no changes of your own you can just replace across - but then why use a merge tool at all and not just overwrite the files? Otherwise you'd have to examine every change in every file to decide which are merged - sounds fairly tedious. Unless you do have an app that can do a three-way merge - basically making the diff of the core and previewing the merge onto your application? Because that would be very neat. On Jun 5, 2:38 pm, David C. Zentgraf [EMAIL PROTECTED] wrote: Hmm, that strategy still seems pretty messy and manual. Basically to summarize, you're still manually merging/replacing the cake folder in a sandbox directory , and then apply the resulting Diff to your actual working copy? Doesn't seem a whole lot better than going through your working copy with a decent File/Folder Merger utility. I might give it a shot once next time, not sure if I'll stick with it though. And unfortunately WinMerge won't work for me, I'm on a Mac. :o) On 5 Jun 2008, at 12:46,GrantCoxwrote: I use Subversion vendor branching (http://bakery.cakephp.org/articles/view/vendor-branching ) to maintain all third party code, as you really need something that can compare three targets. But if you do want to do it manually, WinMerge works well for me on Windows, using the CVS/SVN Loose filter and with include subfolders ticked. But this is quite tedious for something as large as the Cake core, and you still have to manage adds/deletes manually. And of course it won't understand your own modifications, if you have any. If you're already using Subversion for your own application, just spend the 30 minutes trying out vendor branching, it really is the
Re: Having problems with javascript.
El mar, 05-02-2008 a las 11:12 -0800, Ithaka escribió: No... i don't have any anything on my site yet except a default layout, how would i make a controller for the layout? I suggest you start reading the manual (http://manual.cakephp.org/), and try to complete the tutorial (http://manual.cakephp.org/appendix/blog_tutorial) to get used with the framework. --~--~-~--~~~---~--~~ 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: Having problems with javascript.
El mar, 05-02-2008 a las 08:43 -0800, Ithaka escribió: Hi, Hello? I'm having a problem with javascript in cakephp 1.2. As if that wasn't obvious enough. The Problem: I wish to load javascript in the layout for my buttons and other little functions i will implement later on. I've been looking for the past 2 days and i always see the same thing. $javascript-link('script') and $_scripts_for_layout. So i try doing these in my layout yet the javascript does not load. I keep getting the error: undefined function: javascript and call to a member function link() on a non object in... Another small problem i found was that there are so many js folders in place, i don't know which one to put them in. I assumed it was in webroot/js/ but to make sure, i put them everywehre i could. Thank you in advance to everyone that leaves a positive response and/ or solution. Are you loading the JavaScript Helper on the controller? -- No a la matriculación obligatoria: http://noalamatricula.wordpress.com Se libre usando Software Libre: http://www.gnu.org/ Mi Blog: http://juanfgs.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: how to create sorting links ?
El lun, 04-02-2008 a las 01:22 -0800, ITBiNus escribió: Dear all, somebody can help me ? I want to make a link, when the link clicked then the contains of fields will be sorted (in 1 page). ascending or descending like ... title sorted by alphabet or sorted date. Regards, Angel echo $paginator-sort('id'); ? also you might want to take a look at the API documentation of the PaginatorHelper (http://api.cakephp.org/1.2/class_paginator_helper.html), to set pagination options. --~--~-~--~~~---~--~~ 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 to do just a view ?
El lun, 04-02-2008 a las 02:21 -0800, zeugme escribió: Hi, Hello (also, hello to all bakers!), I'm new in CakePHP, amazingly, I choose CakePHP for the power of MVC, SQL mapping ... It's nice to hear that, I'm pretty much a newbie too. but I need to deal with my home page witch have no model. This page however is not purely static, it contains PHP, SQL ... Where do I put such files ? /app/webroot ? or /app/view.pages ? I think the easiest way to do that would be to create a controller with a home() action that uses (see the $uses variables) the models where you need to get the data for the home page. That way you can create methods on the models involved to return the data, so, no need for SQL at all. What are the differences between those 2 folders ? This page also rely on some javascript framework (JQuery). Where do I put my jquery.js file ? If I put it inside app/webroot/js it doesn't appears to be taken into account ... It's like if I had to put that general js files at the physical root, the folder that contains /app. No, you have to put it in app/webroot/js, and load it using the JavaScript Helper, remember to load the helper on the appropiate controller. Maybe there is some doc I should read ? I read the manual, tuto, browse the bakery and did not found, but that do not mean it doesn't exists :-) Thanks for your help ! I hope that helps! --~--~-~--~~~---~--~~ 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: New record without form
try $this-Modelname-create(); $this-Modelname-save($product); assuming $product has the right cakey structure: array('Model' = array('field1' = 'val1', 'field2' = 'value2')) regards, f. On 28 Jan., 20:34, dandreta [EMAIL PROTECTED] wrote: I have a function that receives an array of data($product). How can I create a new record in the database with the information received without using a form? Thanks and regards --~--~-~--~~~---~--~~ 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 cake extract in command line
Hi, you can run the command locally. Get something like XAMPP on your computer, install your cake app and execute the command. You can use the resulting .po file in your production environment. Greets, f. On 13 Sep., 00:30, Igurpi [EMAIL PROTECTED] wrote: I'm working in the translation of mi cake app withi18nand i've read that the way to insert all the traductions ids (eg: __('word id')) in the po files is to run ./cake extract from the command line. I have not permissions in my server to execute anything from CL, so how could i get all the keys in my local files automatically, without typing every word id (I'm using Windows...) 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 -~--~~~~--~~--~--~---
setTitle dentro do método ele não funciona
Eu estava adicionando dentro dos métodos a variável setTitle para que cada método apresentasse um título de pagina diferente e pra minha surpresa o título não muda. Alguém sabe por que isso acontece? eu adicionei $this-setTitle = meu título; no inicio de cada método. Falopa! -- Você não recebe emails dos seus amigos? Conheça o www.BemHumorado.comcadastre-se e receba piadas, vídeos engraçados e muito mais. --- John-Henrique F. Silva 65 8403-4456 --~--~-~--~~~---~--~~ Recebeu esta mensagem porque está inscrito em Grupo Cake PHP Português do Grupos Google. Para enviar mensagens para este grupo, envie um email para cake-php-pt@googlegroups.com Para anular a inscrição neste grupo, envie um email para [EMAIL PROTECTED] Para mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-PT -~--~~~~--~~--~--~---
Image Submit Buttons with AJAX Helper
Hello, I have just been getting more acquainted with Cake in the last couple of weeks - it is quite a difference to being used to code everything by foot. I am looking for a workaround to be able to use Image-Submit- Buttons to initiate AJAX calls. In the API Description (1.2.x Alpha) it mentions I can pass on options. I tried passing on a value for src and type = image, but that does not produce the requested result. Is there a workaround so that I can use the AJAX Helper's submit() function with an image, instead of a standard submit button? Thanks Casper --~--~-~--~~~---~--~~ 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: Sessions on production server with cookies disabled
Well, I'll answer my question... Since I didn't want to hack the core files, i put this in my app_controller: function redirect($url, $status = null, $exit = false) { if (!empty($_REQUEST[CAKE_SESSION_COOKIE])) { $url .= (strpos($url, '?') !== false) ? 'amp;':'?'; $url .= CAKE_SESSION_COOKIE . '=' . $_REQUEST[CAKE_SESSION_COOKIE]; } parent::redirect($url, $status, $exit); } Seems to work. Thx anyway, have a nice day, f. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Sessions on production server with cookies disabled
Hi group, an app I developed (successfully) is about to go in production on a server that doesn't support cookies (dont ask...;) Some sections require authentication (modified dAuth), everything works fine in development. The server appends the CAKEPHP SID nicely to all links and even adds hidden fields in forms. The problem arises from my extensive use of Controller::redirect() which doesn't seem to honor the session id. Anyone ever faced such restrictions? And found a workaround? I don't feel like stepping through all my code adding if(! empty(SID_IN_POST_OR_GET)) echo SID.. or the like. Thanks in advance, f. --~--~-~--~~~---~--~~ 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: Navigation element
foreach($menus['Section']['Menu'] as $menu) { Hi, it' hard to read code in the google layout... especially pr() output...;) looks like the array is numeric... try: foreach($menus as $menu) { echo $menu['Section']['id']; pr($menu['Menu']); ... } greets, f. Array ( [0] = Array ( [Section] = Array ( [id] = 1 [name] = topnav ) [Menu] = Array ( [0] = Array ( [id] = 1 [name] = Home [path] = / ) [1] = Array ( [id] = 2 [name] = News [path] = /posts/ ) ) ) ) --~--~-~--~~~---~--~~ 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 access from a Vendor?
I have a nice little vendor package that locates places within a radius of a zipcode among other things. But currently it needs to run a query against a zipcode table in my database. I was wondering if anyone knows how I could access the model so that I could run a query? I know that I can modify my code so that it will return a query instead of an array that could be ran by the controller but I would really like to leave it to the vendor if possible. Any help would be appreciated. --~--~-~--~~~---~--~~ 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: Lightbox + Cake
Hi, http://img88.imageshack.us/img88/5099/77614616od5.png I think string concatenation is done with '+' in Javascript. Maybe a PHP habit, the dot...;) greets, f. --~--~-~--~~~---~--~~ 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: Pure Flex
Hi, I only once did a test with Flex, and I used Cake as the backend to supply XML responses. It worked fine... Provide an appropriate layout like this: ?php header('Content-type: text/xml'); ? ?php echo '?xml version=1.0 encoding=utf-8 ?'; ? ?php echo $content_for_layout; ? and generate the XML in your view, just like you would do with HTML. Never used AMFPHP... greets, f. On Mar 2, 8:41 pm, randomblink [EMAIL PROTECTED] wrote: Alrighty... I am designing an app that is 100% flex on the client side. The only HTML will be the Flex Holder Page... EVERYTHING else will be Flex talking to AMFPHP through the Gateway and CakePHP being the framework on the server-side. I have printed out the CakePHP manual, the CakeAMFPHP manual, and I am still rather lost... Does anyone know of a good example of a CakePHP setup that doesn't use Views? --~--~-~--~~~---~--~~ 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: Pass an array as a parameter
Hi zipman but if I have $arr=array('key1'='value1','key2','value2') and I want to pass that as an argument of foo I cannot use the code above. Why not do button onclick=update_div('http://localhost/cake/tests/foo/ some_string?key1=value1key2=value2','main') Click me /button In fact I have an app with drag and drop article sorting where I POST the new order of items via AJAX and the url looks like: /admin/articles/sort/2?sortlist[]=1sortlist[]=11 then the receiving function admin_sort($id) in my articles controller gets the id (of the category, in the example 2) and inside that function I have access to my sortlist via: $this-params['url']['sortlist'] (which turns out to be an array;) greets, frank --~--~-~--~~~---~--~~ 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: Creating links a la Html helper in a component
psychic, I don't think you're really understanding my problem/ question. If the data was corrected by the controller (via a component or whatever) before it hit the view, you'd have to do nothing to the HtmlHelper. That's what I'm doing. I'm correcting the data at the controller. I don't want to change the HTML Helper. I want to use it at the controller level for a few things. This sort of flexibility is contrary to the fundamental idea behind CakePHP. The MVC programming pattern is well tested and well used. Its benefits are well documented not only in theory but in practice and experience. Gentle hints toward these benefits are built in the guts of CakePHP. You can override, extend, load and move things around however you want, but in doing so, you lose benefits proven by years and years of experience. With respect, I don't need to be preached at about MVC. I've been doing MVC and object-oriented applications for years in a variety of languages and frameworks -- Ruby on Rails, ColdFusion/Fusebox, Java, C+ +. Where we disagree is what is considered data manipulation and what is considered presentation. In my case, in the course of manipulating data, where the data is of a presentational nature, I need some tools that will allow me to construct HTML tags with proper paths at any level of my app. I'm not *outputting* the tags at that point. I'm simply manipulating them. I 100% do not agree that handling HTML at the controller level violates the spirit of MVC. If data stored in database = HTML, then tools for manipulating data = tools for manipulating HTML. Why is it so hard to grasp that HTML is not only present in the views? That some people store it in the database and need to validate it or verify it at the controller or model level? I am indeed storing 90% of my HTML in the database, I've created my own layout/templating system for the CMS, with blocks and main content areas all manipulated by end-users. When it comes to building content management systems, which is 90% of what I do, presentation IS my data. I need to be able to massage the data, which is presentation, from anywhere within the application. If you're coding presentational information in at every level of the application, there is no need for the MVC separation at all. The drawbacks from doing this kind of coding are well documented. First you tell me that MVC is a well documented reliable way of architecting with many benefits. Now you tell me that using MVC to create an application that handles a lot of presentational information isn't the right way to go. Which one is true? If using MVC for content management systems isn't appropriate, then what is? The urlconverter callback for TinyMCE doesn't do what I need it to do b/c I actually do not want the paths to change while the content is still within the WYSIWYG. As I stated before, if I change the path to the data in the WYSIWYG then the images are broken within the WYSIWYG. I need to store the data with the bad path, but change all the paths when I go to view the data. Well, the responses here have been irksome and not helpful. Through my own research I found this, in case anyone else needs it: http:// rossoft.wordpress.com/2006/02/11/cool-flash-effect-3/ Rosie --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Creating links a la Html helper in a component
Hello all, I have a need to create links (both regular and images) from within the controller/component side of things. Normally of course we would use the Html helper to make links. But for this particular need I have, the links must be created before sending to the view. Is there a component analogous to the Html helper that i can use to create links and image tags? Thanks Rosie --~--~-~--~~~---~--~~ 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: Creating links a la Html helper in a component
This is part of a content management system in which I allow my users to upload images and files and create links to internal pages using tinyMCE. The problem is that I have to fix the paths for much of the stuff that they are uploading/linking to because tinyMCE creates the links to images and files uploaded starting with ../../app/webroot -- and obviously that has to change because those links won't work. If I change the way tinyMCE does the links, then the assets won't appear correctly in the WYSIWYG editor. So - I wrote a helper to fix all the paths, basically replacing ../../app/webroot where appropriate, and that helper uses the Html helper to ensure that the links to images, files, and other links to internal pages of the site have the correct path every time. However that path fixing, IMO, should be part of the business logic and not part of the views. I don't want to call my path fixer every time I output user-submitted content in the view. I would rather prepare all the user-submitted content before sending it to the view, because then I can put it in a loop and not have a million calls to the path-fixing method scattered throughout the view code. I'm faced with basically writing my own version of the Html-link and Html-image methods that can be used in a component, which I really don't want to do, unless someone here has any other ideas. -Rosie On Jan 17, 12:46 pm, John David Anderson (_psychic_) [EMAIL PROTECTED] wrote: On Jan 17, 2007, at 10:17 AM, Rosie F. wrote: Hello all, I have a need to create links (both regular and images) from within the controller/component side of things. Normally of course we would use the Html helper to make links. But for this particular need I have, the links must be created before sending to the view. Is there a component analogous to the Html helper that i can use to create links and image tags?This is hard, mostly because any sort of presentational stuff (i.e. HTML) should be done in the views. Is there a reason you're not just making the links in the views? -- 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: Creating links a la Html helper in a component
Of course, you could also try to fix TinyMCE so the paths are correct from the source... ;) That would be my preferred method, but if I change the paths in TinyMCE, then it will not display the images in WYSIWYG mode. It needs the physical path to preview assets in WYSIWYG mode. So if the paths are correct, the images appear broken in the WYSIWYG. Correcting the URLs is the goal here. The way I am doing it, with regular expressions, I am finding each anchor and img tag that contains one of the problematic paths, exploding all the attributes, fixing the src or href attribute, and then re-assembling the tag with all its attributes. I was relying on the Html helper to rebuild each tag with all of its attributes and the new path. But now I am going to have to basically re-write the exact thing that the Html helper does, which is dumb. I really liked cakePHP up to this point. But there needs to be a bit more flexibility in this area. When it comes to building content management systems, which is 90% of what I do, presentation IS my data. I need to be able to massage the data, which is presentation, from anywhere within the application. Preferably *without* rewriting functionality that is already written. -Rosie --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Suggestions on a multi-app installation
Hey everyone, I've been lurking on the list for some time now, and thought I'd send of my first message. I have two extra files (one component and one helper) that I've put into my /cake/libs. At first I told myself I shouldn't do this, as it's not really convention to mess around with the core, but it's only two files, and only two apps using them. Rather than updating them independently, I just let them stay. Now those classes are getting rather big, and need to be branched off. Other files want to jump in as well. I could keep throwing them into /cake/libs/whatever, making a mess. I could add them to my individual projects. This sounds more appealing, as it would require that I stop FTPing and start using a deploy script to copy these extra files. But it still doesn't seem the *best* way. Inituition tells me there ought to be a folder created just for these files, but no such mechanism exists in Cake. I guess I'm just wondering what suggestions everyone has on how to solve this. Thanks! -Rob --~--~-~--~~~---~--~~ 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 to use $ajax-sortable and update in a db?
Hi, Should I creat a field called order in my, such as topics table? Yes, you should. What worked for me: In my view, I have a div with the sortable items: div id=sortlist ?php foreach ($data as $data): ? div id=artdiv_?php echo $data['Article']['id']; ? class=sortablediv pwhatever.../p /div ?php endforeach; ? /div I create the sortable js-code with ?php echo $ajax-sortable('sortlist', array( 'tag' = 'div', 'onUpdate' = 'submit_sort' )); ? You need to define the function to submit the data: script type=text/javascript charset=utf-8 function submit_sort() { var u = new Ajax.Updater('col4', /* i update a div with the results,,, */ '?php echo $html-url('/admin/articles/sort/'.$catid).'?' ?' + Sortable.serialize('sortlist'), { onLoading:function(request){$('indicator').show()}, onLoaded:function(request){$('indicator').hide()}, asynchronous:true, evalScripts:true, requestHeaders:['X-Update', 'col4'] }, false); } /script the important part is to append the serialized list to the URL. Later in your controller you can access the data with $this-params['url']['sortlist']: if (!empty($this-params['url']['sortlist'])) { for ( $i=0; $i count($this-params['url']['sortlist']); $i++ ) { $this-Article-id = $this-params['url']['sortlist'][$i]; $this-Article-saveField('sort', $i); } } hope this helped, f. --~--~-~--~~~---~--~~ 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 to use $ajax-sortable and update in a db?
BUT i am confused where should I put the submit_sort? Creat a new js file? or PUT them in the index.thtml? I was created a new function in my controlloer called submit_sort( ), and paste your code. It was wrongl I put in my view (note the wrapping script) It is plain Javascript. There might be more elegant ways to do it, or more generic, but basically thats it. Use Firefox for development, there is a very nice extension called firebug, which shows headers and responses to ajax-calls, amongst others... greets, f. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---