Re: count no of rows.
Your brackets aren't balanced. One of the earlier replies had the correct syntax though. Try: $count = $this-Project-Message-find('count', array ('Message.project_id' = $MyProjectId)); On Dec 29, 6:09 am, piyushsharmajec piyushsharma...@gmail.com wrote: Hai, Thanks for your help however i find error as unexpected T_DOUBLE_ARROW when i paste code $count = $this-Project-Message-findCount(array('Message.project_id')=$MyProjectId); Thanks Piyush -- View this message in context:http://www.nabble.com/count-no-of-rows.-tp21183253p21199435.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to remove ugly markup from helper? ( fieldset style=display: none; )
This is in there because Cake's forms can support the additional methods such as PUT and DELETE that are needed for RESTful applications, but that aren't supported by browsers as yet. Originally the input field was not inside a fieldset, however that (according to the W3C validator, amongst others) is not valid XHTML Strict. I requested this change so I could validate my forms correctly. But because including a fieldset, even one that contains only a hidden input, adds additional spacing to the form, I suggested display: none to get around it. Rather than add an extra line to the stylesheet, and risk confusing people, I believe an inline style is the correct way to do this. So, the inline style is a web standards issue - but it comes down on the right side of the fence - it's there to make complying with the standards possible. On Sep 13, 9:21 pm, Action [EMAIL PROTECTED] wrote: Form helper inserts the following code in every form: fieldset style=display:none;input type=hidden name=_method value=POST //fieldset Is there any way to remove the fieldset tag or the inline style? I'd rather have the entire form inside a single fieldset instead of having an invisible input field inside its own fieldset. Also, the inline style is a web standards issue. How can I fix this? --~--~-~--~~~---~--~~ 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: Sharing tmp with other applications
I can't be the only one thinking this while reading this thread - but it sounds like the server operator is excessively paranoid, keeping the system locked down far beyond what it needs to be. I'd suggest finding an alternate place to host your sites, it just sounds like this is going to cause nightmares in future. On Jun 19, 12:00 pm, acoustic_overdrive [EMAIL PROTECTED] wrote: Well I asked and no symlinks allowed unfortunately. He says symlinks can be used to gain access to the root of the machine. On Jun 19, 11:02 am, acoustic_overdrive [EMAIL PROTECTED] wrote: Hi Marcin, Sorry I'm not that up to speed with linux filesystems but I'll have a go at explaining... The files are stored on an NFS server which has two mountpoints on the webserver, one of which is writable (where my tmp stuff is) and the other is read-only (where the rest of my application code and webroot is). I'm not allowed any more mountpoints and so I need the shared writable folder to be outside this cake application as it is going to be shared by several cake applications, not just one. Otherwise I would have asked him to mount it as app/tmp inside my app and keep the file structure as intended. so my structure on the NFS server is: docroot/app1 docroot/app2 docroot/app3 sharedtmp/app1 sharedtmp/app2 sharedtmp/app3 and on the webserver it looks like this: docroot/app1 docroot/app2 docroot/app3 docroot/sharedtmp/app1 docroot/sharedtmp/app2 docroot/sharedtmp/app3 I think the whole point in this exercise is so he can separate readable and writable folders without having to add more mountpoints in future. He also disabled symlinks for security reasons so I can't use mod_rewrite either :-( But what you're suggesting could be interesting actually. Can I create three symbolic links from the sharedtmp to put my tmp folders back where they should be inside each app? On Jun 19, 10:33 am, Marcin Domanski [EMAIL PROTECTED] wrote: can't you just symlink the directories ? On Thu, Jun 19, 2008 at 10:02 AM, acoustic_overdrive [EMAIL PROTECTED] wrote: Hi Dave, Thanks for the tip - I didn't realise that. I will give that a try. If I set that do you think the TMP constant is ignored? or is it still used for logs? Jamie On Jun 17, 9:05 pm, DaveMahon [EMAIL PROTECTED] wrote: Actually, there's an even easier way - and the official one to boot! Edit the cache command at app/core/config.php to look like Cache::config('default', array('engine' = 'File', 'path' = '/custom/ tmp/path')); Full notes for this command are in config.php. On Jun 16, 1:03 pm,acoustic_overdrive[EMAIL PROTECTED] wrote: Hi Dave thanks for checking. I'm not using mod_rewrite, and I've just realised this means that it will actually get its folder structure set up by the index.php in the root of the installation, not the bootstrap or index.php in webroot. Which also means I think I've solved my problem because definingTMP in that index.php file seems to work fine. -- Marcin Domanskihttp://kabturek.info --~--~-~--~~~---~--~~ 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: 503 5.5.2 Send hello first (email component)
I think the thinking is that, by not including external solutions wherever possible, it keeps the licensing clean, making it easier for bigger companies to adopt for their own projects. The trouble with including most external libraries is that they're GPLed, which tends to mean that the entire source code to the application needs to be released under GPL as well. The MIT license Cake is released under is just a little more friendly... SwiftMailer is good though! By the way, Zend have similar rules with the Zend Framework libraries. On Jun 12, 1:31 am, villas [EMAIL PROTECTED] wrote: Same here. I struggled with the Cake component but then put my trusty phpMailer in vendors and bingo, my emails were soon flying again. I now cannot see the point in Cake developers spending their time on this Email component when there are such robust, fully-featured solutions available to be 'wrapped'. It goes completely against the DRY principle. How on earth are they expecting to write, update and support anything better than phpMailer or SwiftMailer? Sorry about the rant, but I hope the Team will review the real point of this component. And, when they do, I hope the conclusion isn't, Other email libraries are just as good and better, but they weren't invented here. Once the Team goes down that route, we'll next be having a homegrown Cake alternative to JQuery. On Jun 10, 8:49 pm, ianmcn [EMAIL PROTECTED] wrote: While waiting for replys to this, I tried using the Pear mail script as a Vendor and got it working within about 30 seconds! Thanks for the replies, they have confirmed that it's probably best for now to stick with a more mature mail system. On Jun 10, 3:09 pm, BrendonKoz [EMAIL PROTECTED] wrote: You could also use the Zend framework's email classes as a vendor if need be. Before the Cake email component was created, that was what my original plan was for sending email. There are plenty of tutorials on using the Zend Framework's email class. (Don't think of the Zend Framework as a competitor if you've already chosen Cake. Cake is a full stack framework, Zend is a skeletal framework, you can and should use it where and when you can.) On Jun 10, 9:46 am, Jonathan Snook [EMAIL PROTECTED] wrote: I am trying to use the new email component in cake 1.2, but am having problems using it with an authenticated SMTP server. I am getting the following error: 503 5.5.2 Send hello first Not to knock the core developers but the email component still needs some work, especially in support for SMTP extensions like AUTH. My recommendation would be to use SwiftMailer (there are CakePHP components which a google search is likely to uncover but I'm too lazy to do myself). --~--~-~--~~~---~--~~ 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: Admin section without using admin routing
Or you could do what I've done in the past on several occasions and create a plugin called 'admin', which will allow you to have URLs such as /admin/users/add. Works fairly well, and you can define a separate layout just by including in your plugin a /views/layouts/default.ctp file. On Jun 5, 6:05 pm, aranworld [EMAIL PROTECTED] wrote: The only thing stopping you is that you might come into problems having controllers with the same name. If you made a controller named useradmin_controller.php in / controllers/admin, cakephp will find it. However, if you have users_controller.php in BOTH /controllers and / controllers/admin, I believe you will run into naming conflicts. Overall, I think you will find that it is ultimately easier to mostly use single controllers which contain an index, add, edit, and delete function. On Jun 5, 8:58 am, zw [EMAIL PROTECTED] wrote: Is there a way to have a separate admin section that doesn't use the built-in CakePHP admin routing feature? I'd like to be able to set up my site so there is a folder within controllers called admin, and I can put all my admin specific controllers. That way I don't have to have my admin code in my standard controllers and easily use a separate admin layout. Something like this would be ideal: Router::connect('/admin/:controller/:action/*', array('controller' = 'admin/:controller')) Then i can have: /app /controllers /admin posts_controller.php users_controller.php projects_controller.php etc From what I can tell this is not possible, and CakePHP will only look in app/controllers for controllers. I feel this is a really clean structure and way of separating the admin functionality. Thanks for your help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ShadowBox / Ajax Link Problem
I'm only guessing here, but perhaps the layout being used to render the shadowbox doesn't including the JS libraries in the header? I can't be sure, I no longer use the Ajax helper as I prefer jQuery to Prototype :) On Jun 2, 8:09 pm, Kyle Decot [EMAIL PROTECTED] wrote: I am using an ajax link to update a calendar I have made. The link to switch between months will work if the calendar is not loaded with the shadowbox link, but when it's activated via shadowbox, the links do nothing? What could be causing this? div id = cal style = display:none; ?php echo $this-renderElement(cal); ? // cal.ctp contains ?php echo $ajax-link(/cal/ index/,/,array(update=cal)); ? /div --~--~-~--~~~---~--~~ 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: App Controller Fails to Load
I used RewriteBase / after RewriteEngine on, and the Cake apps I've deployed to our 11 hosting seem to work fine. You'll need to insert the RewriteBase directive in each of the 3 .htaccess files. On Jun 2, 9:08 pm, robbie [EMAIL PROTECTED] wrote: Hello All, I have a problem, my local Apache / PHP will correctly load my app_controller.php file which is in the /app directory, however on my shared 1and1 server, the hosthttp://www.formerchampions.net/is failing to load this, so any of my Model's are not appearing inside the views/elements pages. You can see that on the initial page, the for loops just bomb out. Also, I cannot reachhttp://www.formerchampions.net/adm/usersor anything to get to the admin page. Both of my .htaccess files look like this: /kunden/homepages/2/d246080158/htdocs/.htaccess RewriteEngine on RewriteRule ^$ /app/webroot/ [L] RewriteRule (.*) /app/webroot/$1 [L] If I do not include the slash prior to app it generates a 500 server error. If anyone has any suggestions, I would greatly appreciate it. I have been pulling my hair out for the last few days. Thanks again, Robbie --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to dynamically add fields to model
My suggestion would be to go with your initial idea. It's workable, it'd take some fiddling with the code to make it work correctly however. But you could achieve most of what you'd need with a bit of code in the afterFind method of your model. On May 31, 4:26 pm, spamec [EMAIL PROTECTED] wrote: Something is wrong with my last response.. anyway its a pitty that there is no real solution for this problem. I reallly thought that its possible without predefining fields in database in advance. Anyway thanks for sharing your knowledge. Dnia 31 maja 2008 3:18 b logica [EMAIL PROTECTED] napisał(a): This isn't really a CakePHP problem, then. I think you need to rethink your database schema. I wouldn't suggest creating one that has table columns pop into existence like that. Add these extra fields/columns to the clients table with DEFAULT NULL and make sure that your model validation rules have allowEmpty = true. If you're unsure what other fields (besides the required ones you already know about) will be wanted someday, you should probably tell your client or boss to spell out their requirements for the website pronto. In any case, if, sometime in the future, they decide that they want to add a shirt size column (for example) to the clients table it's as easy as adding a new column to the table with our friend DEFAULT NULL, popping the validation rule into the model, and adding the form field into the views. On Fri, May 30, 2008 at 7:05 PM, spamec wrote: Hmm, but I dont know how many fields can admin declare. Its not possible, to make it dynamic in such a way (or am I wrong:) ).. Imagine a case: admin have to extend a Client (which already has name,surname,age etc.) with additional fields like street and postal code. Of course, forms should be extended automatically. What then? I'm interested with quite universal solution, because in future I would like to extend more of my models with such behavior.. On 30 Maj, 18:31, b logica [EMAIL PROTECTED] wrote: Why not just create an AdminPage model? Or, keep everything in Page but make the other fields DEFAULT NULL in pages table? On Fri, May 30, 2008 at 4:49 AM, spamec [EMAIL PROTECTED] wrote: Hi there, I came to a problem and I'm really curious how other people manage such things. I have to build an application in which, admin can extend a Page model with additional fields. My idea is to create: Tables: - dynamicfields: id, name,type, required,modelname - dynamicfields_values: id, dynamicfield_id, value,created,updated And know there is problem, because I have to add,edit,delete fields which are dynamic. What is more, I will have to build forms basing on dynamicfields... Do you have some experience with such situations? Thanks in advance! --~--~-~--~~~---~--~~ 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: SelectTag in Array
If you're trying to bring an old website into Cake, now is the time to use 1.2 instead of the old 1.1. It'll be stable very soon now (I have faith in the dev team), so you're best off sticking with the newest and best. To get the information out that you're looking for, try using (in 1.2): $i = 0; // Loop here $form-input('Booking.extra_member_group.' . $i, array('type' = 'select', 'options' = $extraMemberGroup)); $i++; // End loop here Completely untested, but this way you get an array of options how you've requested. On May 27, 10:55 pm, Sanfly [EMAIL PROTECTED] wrote: Hi Guys Im new to cake and still trying to get my head around everything, so sorry if the answer to this is obvious. I have been looking around for the answer but cant seem to find it I have a form from an old wesite I'm trying to bring into cake. In the form I have a number of select items that pass data into an array, eg: select name=myselect[]options here/select select name=myselect[]options here/select In cake I cant seem to figure out how to make the array. When I print_r the result from this: $html-selectTag('Booking/extra_member_group', $extraMemberGroup, '', array(), array(), false); it gives me: Array( [extra_member_group] = 1 ) But I want it to be like this eg: Array( [extra_member_group] = Array ( [0] = 2[1] = 1 ) ) ) Ive tried: $html-selectTag('Booking/extra_member_group[]', $extraMemberGroup, '', array(), array(), false); $html-selectTag('Booking/extra_member_group/', $extraMemberGroup, '', array(), array(), false); I hope this makes sense and appreciate any help anyone can give me --~--~-~--~~~---~--~~ 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: $this-Auth-user() cached? - Cake 1.2
Basically, it looks like the Auth data is not refreshed on each page load. I can understand why you wouldn't want to do this - performance notwithstanding - but I've run into a few issues with it myself (primarily dealing with having an online store where the customer could change their email address, etc - all stored in the session, so it didn't actually update when they saved the changes). There's probably an alternate solution, I'm thinking somewhere along the lines of forcing a fresh check against the database every time the page is loaded. Maybe from AppController::beforeFilter(), for example. No idea what form that would take yet though. On May 22, 5:55 pm, b logica [EMAIL PROTECTED] wrote: On Thu, May 22, 2008 at 11:28 AM, theandystratton [EMAIL PROTECTED] wrote: I don't understand what you're trying to do here. Are you trying to refresh the $user variable or the data in the session? I'm trying to find an easy way to refresh the data held in $this-Auth- user() But you're assigning *from* Auth, not *to* it. is that just pointing to the User value in the session? I'm not sure how the Auth object maps to the values in the Session. Yes, Look at the source for Auth::user(). It's grabbing it from the session. Strangely though, I'm suddenly seeing an eerily similar problem in my own app :-/ --~--~-~--~~~---~--~~ 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: Saving NOW() in model
I believe I used this method: 'last_login' = '!-NOW()' Which makes Cake stop trying to quote it. But I'm pretty sure the latest SVN revision recognises NOW() and doesn't quote it anyway. Maybe I'm confused. Steve On May 22, 2:12 am, Alex Ciobanu [EMAIL PROTECTED] wrote: Zifnab wrote: I'm trying to figure out how to implicitly make a mysql NOW() call when doing a model save...here's an example of the code: $aUserData = array( 'User' = array( 'id' = 4, 'last_login' = 'NOW()' ) ); $this-User-save( $aUserData, false, array( 'last_login' ) ); Naturally the save doesn't work, because NOW() saves as a string NOW() instead of as a mysql function NOW()How do I get it to save as a mysql function? $aUserData['User']['last_login'] = date(Y-m-d H:i:s); $this-User-save($aUserData); Not using NOW(), but does the trick. --~--~-~--~~~---~--~~ 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: Form posting with type=get
That does make a lot more sense! What I did with my own Cake app was to POST the search request, but then process that request into a series of named parameters and redirect. That way, if a request came in via POST it was a new search, if it came in with named params it was an existing one - and the search didn't happen until the second stage. You're getting more or less the same result by just sending a GET request, but my way was just a little more predictable - and works well I think (check out http://www.bcfw.co.uk to see it in action). Steve On May 17, 7:39 pm, Marcelius [EMAIL PROTECTED] wrote: It is for a search engine :-) Build completly from scratch without cakephp last year. The SearchController (which is a cake controller) catches the GET request, includes the main search class and it wil handle the search request. And it is a requirement that search results can be bookmarked so the easy way to do this is using GET. Hope this info helps :-) On 17 mei, 00:56, Stephen Orr [EMAIL PROTECTED] wrote: I'm having trouble understanding why you'd want to use GET for something... what's the specific situation you're attempting? Steve On May 16, 7:48 pm, the_woodsman [EMAIL PROTECTED] wrote: But it just doesn't make any sense to me that input names are stripped to the column names of a table only when using GET. What is the reason that cake handles get different from post? Surely the handling differs because arrays can't be passed as simply via GET as they can via POST? the data[x][y] naming system is used (at least in part) because this is converted as an array in $_POST. $_GET vars don't work that way in PHP (to my knowledge) so the naming system is completely pointless for a GET request! I'd love to be proved wrong on this one, it'd sure expand my knwoledge :) On May 16, 7:14 pm, Marcelius [EMAIL PROTECTED] wrote: I agree to. But it just doesn't make any sense to me that input names are stripped to the column names of a table only when using GET. What is the reason that cake handles get different from post? I really want to stay as close as possible to the cake conventions so I decided at first to use the formhelper. The great thing about the form helper is that well, helps you build forms I think. But it is the simple trivial stuff that the formhelper does for you independently from the rest of the framework. For example, automaticly setting the 'posted' value of an input field, or showing validation errors. But what if there will be an extension in the functionality later, and cake should do something with the data? That would be another reason to stick with the formhelper I think. Anyways, getting my hands 'dirty' by writing some extra non cake-ish isn't that big a deal but in my opinion not necessary :-) On 16 mei, 14:56, mydesignbuddy [EMAIL PROTECTED] wrote: If you are not using Cake to process the form why use FormHelper when a good old hand-coded form in HTML works. To me Helpers are great time savers when you are utilizing the frameworks features: validations, auto read/write values to view, posting to the next action in your controller. If your not using the built features of cake for a form the helpers could slow down your performance compared to hard-coded HTML that does not need processing. Does anyone else agree with this opinion? -Buddy On May 15, 4:52 am, Marcelius [EMAIL PROTECTED] wrote: Hi! The situation: //in some view I have: ?php echo $form-create(array(controller=search, action=index)); echo $form-input(Region.region_name); echo $form-end(); ? Straight forward, nothing to it... Now I want to post data via GET. Cake doesn't have to worry about handling the 'posted' data because that is delegated to another 3th party class that does the magic for me. //like so: ?php echo $form-create(array(controller=search, action=index, type=get)); echo $form-input(Region.region_name); echo $form-end(); ? But here comes the problem, the input name isn't data[Region] [region_name] anymore, but region_name. So apparently the form helper notices the difference in the form method, and changes the way the input names are printed. Wy? In this situation it is for example impossible to create an array of checkboxes and post them as array data because input names with data[Option][1][option_title] and data[Option][2][option_title] etc are converted to option_title only. Okay so don't be lazy and print the html yourself. Thats fine with me to, but it would be great to have Cake support this problem. Or does it and do I miss something? Greets, Marcel. --~--~-~--~~~---~--~~ You
Re: Can't get Save() to save certain fields
I think it depends which Cake version you're using, but I'm pretty sure now the preferred method of saving is: $this-Model-create($this-data); $this-Model-save(); I'm not sure if this changed between 1.1 and 1.2, but I'm using 1.2 and this technique works perfectly. I usually wrap it in a condition, such as: if($this-Model-create($this-data) $this-Model-save()) { // The information was saved } else { // There was an error while saving - handle it here. } Hope that helps. Steve On May 16, 11:37 pm, Marcin Domanski [EMAIL PROTECTED] wrote: set debug to 1 so cake can refresh the cache, you _should_ debug with debug 0 :) On Fri, May 16, 2008 at 11:17 PM, Joe [EMAIL PROTECTED] wrote: Hi, I'm having trouble with save() and was wondering if anyone could shed some light on the problem. I inherited a project that has a page with a form on it which updates information to a database upon submission. It uses the save() method to update the data in the table, and it works fine for all the fields that were on the form when I started working on it. Now I'm trying to add a few new fields on the form and in the database, but save() refuses to save my data. It still saves every *other* field, just not my new ones. The line that saves the data is simply: $this-Modelname-save($this-data, false); I've print_r()'d $this-data, and the field names are in there just fine. They exist in the database. There is no fields list in the call to save() as you can see, and I tried turning validation off. I just can't get it to work and it's rather frustrating. I went into model_php5.php, and print_r()'d out $fields and $values above this line: if ($db-update($this, $fields, $values)) { and my new fields are not in there. So I printed out the result of the $this-hasField($x) test above the line: if ($this-hasField($x) ($whitelist in_array($x, $fieldList) || !$whitelist)) { and it fails for the fields not in there. So that makes sense. But the ridiculously frustrating thing is that the fields *are in the database*. In the table that belongs to the model. Same name, same capitalizations. I just can't figure out what the problem here is... does anyone have any idea? Joe -- Marcin Domanskihttp://kabturek.info --~--~-~--~~~---~--~~ 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: Form posting with type=get
I'm having trouble understanding why you'd want to use GET for something... what's the specific situation you're attempting? Steve On May 16, 7:48 pm, the_woodsman [EMAIL PROTECTED] wrote: But it just doesn't make any sense to me that input names are stripped to the column names of a table only when using GET. What is the reason that cake handles get different from post? Surely the handling differs because arrays can't be passed as simply via GET as they can via POST? the data[x][y] naming system is used (at least in part) because this is converted as an array in $_POST. $_GET vars don't work that way in PHP (to my knowledge) so the naming system is completely pointless for a GET request! I'd love to be proved wrong on this one, it'd sure expand my knwoledge :) On May 16, 7:14 pm, Marcelius [EMAIL PROTECTED] wrote: I agree to. But it just doesn't make any sense to me that input names are stripped to the column names of a table only when using GET. What is the reason that cake handles get different from post? I really want to stay as close as possible to the cake conventions so I decided at first to use the formhelper. The great thing about the form helper is that well, helps you build forms I think. But it is the simple trivial stuff that the formhelper does for you independently from the rest of the framework. For example, automaticly setting the 'posted' value of an input field, or showing validation errors. But what if there will be an extension in the functionality later, and cake should do something with the data? That would be another reason to stick with the formhelper I think. Anyways, getting my hands 'dirty' by writing some extra non cake-ish isn't that big a deal but in my opinion not necessary :-) On 16 mei, 14:56, mydesignbuddy [EMAIL PROTECTED] wrote: If you are not using Cake to process the form why use FormHelper when a good old hand-coded form in HTML works. To me Helpers are great time savers when you are utilizing the frameworks features: validations, auto read/write values to view, posting to the next action in your controller. If your not using the built features of cake for a form the helpers could slow down your performance compared to hard-coded HTML that does not need processing. Does anyone else agree with this opinion? -Buddy On May 15, 4:52 am, Marcelius [EMAIL PROTECTED] wrote: Hi! The situation: //in some view I have: ?php echo $form-create(array(controller=search, action=index)); echo $form-input(Region.region_name); echo $form-end(); ? Straight forward, nothing to it... Now I want to post data via GET. Cake doesn't have to worry about handling the 'posted' data because that is delegated to another 3th party class that does the magic for me. //like so: ?php echo $form-create(array(controller=search, action=index, type=get)); echo $form-input(Region.region_name); echo $form-end(); ? But here comes the problem, the input name isn't data[Region] [region_name] anymore, but region_name. So apparently the form helper notices the difference in the form method, and changes the way the input names are printed. Wy? In this situation it is for example impossible to create an array of checkboxes and post them as array data because input names with data[Option][1][option_title] and data[Option][2][option_title] etc are converted to option_title only. Okay so don't be lazy and print the html yourself. Thats fine with me to, but it would be great to have Cake support this problem. Or does it and do I miss something? Greets, Marcel. --~--~-~--~~~---~--~~ 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: Is the documentation at book.cakephp.org open source?
The answer seems to be because some people believe that a wiki is the solution to all of mankind's problems. I'd rather see people contributing to the main docs personally, since it was launched the Book has really helped me get answers faster (there's still some things I need to refer to the API for but that'll change as time goes by). Steve On May 6, 4:34 am, nate [EMAIL PROTECTED] wrote: Why? Writing a documentation resource on CakePHP from scratch is quite an undertaking. What could possibly be your motivation for doing such a thing? On May 5, 10:59 pm, Aaron Shafovaloff [EMAIL PROTECTED] wrote: Thanks for the clarification. I'll just start from scratch. On May 5, 8:56 pm, Gwoo [EMAIL PROTECTED] wrote: The book is open. Anyone is free to contribute. The content is owned by the Cake Software Foundation and contributed by loyal members of the CakePHP community who value collaboration and central location for information and resources related to the CakePHP project. Therefore, you cannot reproduce, distribute, or prepare derivative works based on its content for any purpose, without the permission of the Cake Software Foundation. Bake on. --~--~-~--~~~---~--~~ 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: a couple of small things I can't figure out
findAll(array('Table.categoryt' A ) This definitely won't work. The array('Table.categoryt' = 'A') part follows PHP syntax, where = denotes a relationship between the key of the array and the value. To have a condition where you want rows that DON'T match, use array('Table.categoryt' = 'NOT A'), or '!= A', or ' A'. One of those should work (it's late, and I can't be bothered to check which is correct) Steve On Apr 19, 5:57 pm, simonb [EMAIL PROTECTED] wrote: findAll(array('Table.categoryt' A ) Try that. Not so sure about the second problem I use css to set the width regarding multiple records use this ?php echo $form-input(Product.{$i}.id, array('value' = $node['id'], 'label' = false)); echo $form-input(Product.{$i}.qty));? This is place within a for loop and the $i used as the index. In the controller you then use either foreach($this-data['ProductNode'] as $item) { $this-Product-save($item); $this-Product-id = null; //this is required otherwise only a single row will be inserted. } or save the lot in one go $this-Product-saveAll($this-data,false); If you need any further help please ask me. On Apr 19, 10:27 am, damo [EMAIL PROTECTED] wrote: I've looked through the manual/book, but mustn't be looking in the right place. 1) How do I: findAll(array('Table.categoryt' != A ) ie, I know how to return results that are equal to A by = but what about those not equal. Where do I find comparison operators possible for my controller? 2) How can I alter the length of a form input field using form helper? The rows, cols doesn't seem to be suitable for it. This is only for formatting purposes, not for restricting the length of input. 3) I'm trying to update multiple records using a single form. Is this the best way of doing it, or has something easier been developed that I cannot find:https://trac.cakephp.org/ticket/3044 --- Thanks for all the help given by everyone so far, my project has really come together. Give me another 6 months, and I might even be answering these type of questions!! Damo --~--~-~--~~~---~--~~ 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: Problem with plugins
Without knowing exactly what files you have there, I can't really solve the problem. But, to make a plugin work, this is what you need: A folder in plugins called whatever your plugin should be called (hereafter referred to as $plugin). Within that folder, 2 files - $plugin_app_controller.php and $plugin_app_model.php These 2 should follow the below pattern: class PluginAppController extends AppController { } class PluginAppModel extends AppModel { } Also within that folder, 3 more folders - controllers, models, views. Within the controllers folder - $plugin_controller.php. class PluginController extends PluginAppController { var $name = '$plugin'; } This should be enough to get any plugin up and running - if it doesn't contain these files, it probably won't work. Steve On Apr 15, 2:18 am, [EMAIL PROTECTED] wrote: I'm having problems getting plugins to work in my app. I keep getting missing controller errors as cake is tying to access a controller with the name of the plugin. At first I thought I had done something wrong in the plugin I was creating but the problems are there with all of the plugins that I've downloaded and tried to get to work. Is there something I have to do to enable plugins or something? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Which versions of MySQL compatible with CakePHP 1.1.9.6305?
What it sounds like is that he's trying to use the updated $this- Model-find('all'.) syntax from Cake 1.2 in the older version. Best bet is to either upgrade, or use the old $this-Model- findAll($conditions) syntax. Steve On Apr 15, 8:44 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: ... where all ... doesn't look right to me. What does your find-statement look like? Are you adding where to your condition in Cake? It should just be $this-Model-find('title = '.$title) or something similar. What does the MySQL error say? (can be seen in Cakes debug message or just run that query manually to get the error) /Martin On Apr 15, 6:26 am, developer01 [EMAIL PROTECTED] wrote: New to Cake and hoping someone can answer this. I am running into all bunch of sql syntac error 1064 for the simplest of queries. I'm running MySql 5.0.51a, php 5.2.5, both installed via XAMPP, Mac 10.5. A lot of the queries are generated by cake internally so it doesn't make sense to rewrite anything there. What MySql versions are best with my cake version of 1.1.9.6305? For example, this simple sql does not work: SELECT `Post`.`id`, `Post`.`title`, `Post`.`body`, `Post`.`created`, `Post`.`modified` FROM `posts` AS `Post` where all LIMIT 1 The DB table posts is indeed there and the fields all exist and there are values. Cake is producing this code, not me, and it seems to look legit. Am I missing something here? --~--~-~--~~~---~--~~ 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: architecture - organizing related models (?)
My main reason for choosing components rather than models is the inheritance of them. Cake isn't really set up to handle inheriting models directly. Creating a component which then returned a reference to the correct model would be my preference, but without actually sitting down and coding something up, I could be wrong. Stephen On Apr 15, 3:47 pm, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: Stephen Orr wrote: I can't answer all your points, but in theory, you could probably achieve what you're aiming for in (2) by making SearchEngine a factory class which instantiates the other classes on demand. But you'd probably do better with a different architecture. My suggestion would be to use a call such as $this-SearchEngine- search('google', 'keywords'); Oh, and I'd be more inclined to make SearchEngine a component than a model. Just a difference in opinion, but I think it'd make for simpler usage. Thanks for your comments; I strongly believe that the logic should be a part of model. Do you have any good reason for choosing components? -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: |OT| What is your preferred URL structure?
Of course, there's no reason you couldn't achieve those preferred URLs by using custom routes. Stephen On Apr 15, 4:00 pm, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: On Apr 10, 1:18 am, majna [EMAIL PROTECTED] wrote: snip My suggestion is controller/action/slug solution. Sometimes controller/ slug if possible. snip Thanks for your comments. The reason for this post is that: 1. Many times, I find that no one is preferring the named arg thing 2. It's my preference to have singular controller name for view, edit and add: products instead of products/index product/view/ instead of products/view product/edit/ instead of products/edit I wanted others preferences too; thanks for sharing. -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Which versions of MySQL compatible with CakePHP 1.1.9.6305?
It's just that the syntax for the find method has been updated, so the first parameter is no longer the conditions you want to search for, but an identifier for the type of find you want to perform. There's quite a few changes like that - there's probably a list floating around but I have no idea. Other replacements: generateList becomes find('list'...) findAll becomes find('all'...) There's others. I'm just coded out for the night. Stephen On Apr 15, 5:27 pm, developer01 [EMAIL PROTECTED] wrote: Thanks guys. There seems to be two version of the Blog tutorial floating around and I was looking at the 1.2 version as opposed to the 1.1.x. When I get home today I'll upgrade and see if I run into the same issue. But that being said...i'm surprsied 1.2 is creating SQL that does not run in MySQL properly. Shouldn't cake be producing rather similar SQL from 1.1 to 1.2? It's a simple query after all. Or are there strict version compatibilities between Cake versions and MySQL versions? Is that documented? I On Apr 15, 4:37 am, Stephen Orr [EMAIL PROTECTED] wrote: What it sounds like is that he's trying to use the updated $this- Model-find('all'.) syntax from Cake 1.2 in the older version. Best bet is to either upgrade, or use the old $this-Model- findAll($conditions) syntax. Steve On Apr 15, 8:44 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: ... where all ... doesn't look right to me. What does your find-statement look like? Are you adding where to your condition in Cake? It should just be $this-Model-find('title = '.$title) or something similar. What does theMySQLerror say? (can be seen in Cakes debug message or just run that query manually to get the error) /Martin On Apr 15, 6:26 am, developer01 [EMAIL PROTECTED] wrote: New to Cake and hoping someone can answer this. I am running into all bunch of sqlsyntacerror 1064 for the simplest of queries. I'm runningMySql5.0.51a, php 5.2.5, both installed via XAMPP, Mac 10.5. A lot of the queries are generated by cake internally so it doesn't make sense to rewrite anything there. WhatMySqlversions are best with my cake version of 1.1.9.6305? For example, this simple sql does not work: SELECT `Post`.`id`, `Post`.`title`, `Post`.`body`, `Post`.`created`, `Post`.`modified` FROM `posts` AS `Post` where all LIMIT 1 The DB table posts is indeed there and the fields all exist and there are values. Cake is producing this code, not me, and it seems to look legit. Am I missing something here? --~--~-~--~~~---~--~~ 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: id = 0 or id ='0' not allowed in cakephp?
MySQL specifically disallows an ID of 0. I've tested this manually by inserting a test row with an ID of 0 into an auto_incremented column. It ignores it, and gives it an ID of 1 instead. So, not a CakePHP bug at all. Steve On Apr 14, 9:37 pm, Defranco [EMAIL PROTECTED] wrote: nobody? /erico --~--~-~--~~~---~--~~ 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: architecture - organizing related models (?)
I can't answer all your points, but in theory, you could probably achieve what you're aiming for in (2) by making SearchEngine a factory class which instantiates the other classes on demand. But you'd probably do better with a different architecture. My suggestion would be to use a call such as $this-SearchEngine- search('google', 'keywords'); Oh, and I'd be more inclined to make SearchEngine a component than a model. Just a difference in opinion, but I think it'd make for simpler usage. On Apr 9, 5:08 pm, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: (The topic not related to the current threadhttp://groups.google.com/group/cake-php/browse_frm/thread/0133dc7f2df... ; it's different) I'm interested to know the preferred way of organizing the models and vendor files, for the project say meta search engine - using webservices of the search engines: My idea as of now: 1. class SearchEngine extends AppModel{ // some common grabber codes } 2. class Google extends SearchEngine{ function search(){ } } 3. class Yahoo extends SearchEngine{ function search(){ } } 4. nusoap in vendor folders 5. Written grabber codes in models folder Question: 1. Is it the correct approach? 2. I think, it's better that if we can call methods like $this-Controller-SearchEngine-Google-search(); but with current architecture, it's possible only this: $this-Controller-Google-search(); 3. Is it ok to place *our* grabber codings in models folder? 4. Is it right to say that only the 3rd party scripts to be placed in vendors folder? 5. Should the sub-model files (Google, Yahoo) to be placed inside a folder? -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakephp 1.2 form helper,how to create() form without ugly inline css
The CSS is there because of a ticket I posted - in XHTML it's invalid to have any input elements within a form element that aren't also enclosed by a block-level element (so, a fieldset, a paragraph, a div). The inline CSS is purely there to allow you to have valid XHTML and not break your layout with an additional fieldset into the bargain. Steve On Apr 7, 9:30 am, dr. Hannibal Lecter [EMAIL PROTECTED] wrote: Why is it bothering you? You can't see it, the user can't see it..which means - by all means - that it isn't really there ;-) On Apr 5, 10:10 am, dzojntywole! [EMAIL PROTECTED] wrote: Hi everybody, I am trying to use form helper to create a form in my view: ?php echo $form-create() ? the result is: form id=UserAddForm method=post action=/otherwise/6609/users/ addfieldset style=display:none;input type=hidden name=_method value=POST //fieldset is there a way to remove that inline style other than editing helper files? i do not want to reinvent the wheel if the option like that already exist... i tried to google it, asked on #cakephp looked on manual.. api.. still confused hope to get hint, thanks B.W --~--~-~--~~~---~--~~ 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: document root in shared hosting
From a brief look at what they're offering, you should have just been able to upload the Cake files as downloaded and get something working, bar the database configuration. Nobody else can help you with the correct settings for the database however, since they'll be detailed somewhere within cPanel. I suggest better research on your part - we can't do it all for you - Cake in most cases is VERY simple to get running and from looking at Stonerocket I have to say there's no reason it shouldn't just work. Steve On Apr 3, 1:40 am, Raistlin Majere [EMAIL PROTECTED] wrote: I am hosting with StoneRocket.net On 30 mar, 06:20, Stephen Orr [EMAIL PROTECTED] wrote: Which, so long as your RewriteBase directive takes the form of: RewriteBase /directory Will be exactly right. If this isn't working for you, I suggest contacting your hosting company for further support. Cake has worked successfully for me every time, deploying onto many different servers and hosting environments, in most cases without having to change a single line of core code. Out of interest, who are you hosting with? On Mar 30, 2:47 am, Raistlin Majere [EMAIL PROTECTED] wrote: The log file says: RewriteBase takes one argument, the base URL of the per-directory context On Mar 29, 1:03 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: Then go and read the server error log as the message suggests. On Sat, Mar 29, 2008 at 12:04 PM, Raistlin Majere [EMAIL PROTECTED] wrote: I got: 500 Internal Server Error More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. On Mar 28, 7:45 pm, Галкин Николай [EMAIL PROTECTED] wrote: I think yes! Create the file .htaccess in the root directory and write string: RewriteBase /new_root_folder But in your hosting must be enabled module mod_rewrite. Sorry for my English. I am from Russian. Can I change document root in shared hosting? --~--~-~--~~~---~--~~ 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 can I user jQuery insted of prototype?
I agree - there's no need for a helper - it seems pointless to add extra load to PHP processing when you can just add the extra scripting to your views and layouts directly. jQuery is concise enough that you don't need to code a helper for it :) On Apr 3, 1:08 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: You can either do nothing at all... well, apart from including jquery in your layouts, that is. If you want you can download a jquery helper from the bakery.http://bakery.cakephp.org/articles/view/jquery-helper I do not use any helper for jquery, myself. Since all my javascript, including ajax, is applied dynamically to css selectors I have no real need for a helper. On Apr 3, 5:21 am, dyh1919 [EMAIL PROTECTED] wrote: I love jQuery more than prototype,but,what i should do before i use it in CakePHP? --~--~-~--~~~---~--~~ 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: WAMP and CakePHP
I second the recommendation of Wampserver. Only problem I've found is that it doesn't include a mail server by default - which means, if you're running under Vista, you can't send emails from your localhost. Steve On Apr 3, 7:04 pm, dw [EMAIL PROTECTED] wrote: i use wampserver and like it.http://www.wampserver.com/ -d On Apr 2, 10:05 am, UTDStudent [EMAIL PROTECTED] wrote: I am a college student who is currently trying to set up a WAMP installation to run a school project on. Do any of you fine folks have any recommendations for a setup. PS - Normally I'd like to learn Linux and use a LAMP, but I am pressed for time. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: mutliple domains on 1 site
For the database side all I use is a constructor DATABASE_CONFIG(), which checks whether or not the site is running on localhost. If it is, I use the settings I've previously defined in the file (following the same convention as the default setup). I'm working on expanding my overall concept at this point - the sites have become plugins, which gives me the separation of functionality while allowing me to share some simple core functionality. I just need to figure out a way to get Cake to route to the different plugins based on the domain name. At this point I'm thinking this would be something easiest done via AppController, maybe I could reuse the component code. I'm just not sure yet how that works with routing. I'll post my existing (now abandoned) code up in the bin later on, I just need to get my head round this bit first. Steve On Apr 2, 10:28 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Another thing we use here is dirty hack includes in config files: This is my standard database.php file: ?php switch (strtolower($_SERVER['SERVER_NAME'])) { case 'site.local': case 'site': include APP . DS . 'config' . DS . 'database_local.php'; break; case 'test.site.example.com': include APP . DS . 'config' . DS . 'database_test.php'; break; default: include APP . DS . 'config' . DS . 'database_live.php'; break;} ? Which we use to save having to mess about with config on deployment. A similar solution would work for TWIOF's case, and may be the simplest option. Simonhttp://www.simonellistonball.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: mutliple domains on 1 site
I'd love to see this sort of functionality in there - I've just built a component to handle that side of things, it's not perfect but it does work. On Apr 1, 12:13 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: See! That's the beauty of cake. It can look awfully restrictive with all this convention over configuration, but when it comes down to it the framework will let you achieve pretty much anything! It's a while since I enthused, so well done once more everyone. That said, what do people think about the idea of trying to build an enhancement to make the router and/or request handler aware of virtual host names? I would put a trac in (even with a patch!), but if people think it's an edge case here, it may not be worth it. Simon On Apr 1, 12:02 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: Another more elegant, and much more Cakey approach would be to set the viewPaths in the bootstrap based on the $_SERVER['HTTP_HOST']. Or (still based on $_SERVER['HTTP_HOST']) set a different layout, or use ThemeView with the same trick again. --~--~-~--~~~---~--~~ 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: mutliple domains on 1 site
Sure thing. I'm pretty certain my method isn't optimal, but it does work (and as a bonus, because I'm using a model to represent the Sites, you can add them dynamically). It relies on the ThemeView at the minute, because that's how I'm representing each of the different site designs. I ran into the sticking point where each of the sites needs different functionality, and that's as far as I've gotten. Either way, I'll stick the code up somewhere tomorrow (it's at work, and I'm at home). Steve On Apr 1, 4:09 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: If you could share that code, I'll happily look at creating a patch to tart it up a bit. simonhttp://www.simonellistonball.com/ On Apr 1, 3:09 pm, Stephen Orr [EMAIL PROTECTED] wrote: I'd love to see this sort of functionality in there - I've just built a component to handle that side of things, it's not perfect but it does work. --~--~-~--~~~---~--~~ 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: works in localhost, not works in www.toreadandtowrite.com
Probably. Suggestion - ask your HOST what the correct settings should be. On Apr 1, 11:23 pm, Raistlin Majere [EMAIL PROTECTED] wrote: I replaced the line: 'host' = 'localhost', with: 'host' = 'www.toreadandtowrite.com', Is it wrong? On 31 mar, 01:59, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: You just seem to have an issue with the database connection, verify the file config/database.php cheers (and welcome to cake) On 30 mar, 21:35, Raistlin Majere [EMAIL PROTECTED] wrote: My site is actually athttp://www.toreadandtowrite.com/CakePHP/toreadandtowrite/ On Mar 30, 4:28 pm, Raistlin Majere [EMAIL PROTECTED] wrote: What should I do to make my site that works in locahost, work inwww.toreadandtowrite.comtoo?-Masquerle texte des messages précédents - - Afficher le texte des messages précédents - --~--~-~--~~~---~--~~ 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: Parsing a cakephp session Data row
Trouble is, as he says in the original post, this is for an external application. So he can't use Cake methods. That doesn't mean there's not an easier way to do it, however I can't think of one :) On Mar 31, 6:06 am, jonknee [EMAIL PROTECTED] wrote: Thanks for your repleys. I got it working. This is how I got it to work. Comments welcome. You're hugely over complicating things... If you use the SessionComponent as previously suggested, all you'd need to do is: $this-Session-read() No crazy SQL, regular expressions, etc etc. Just a method call. --~--~-~--~~~---~--~~ 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: document root in shared hosting
Which, so long as your RewriteBase directive takes the form of: RewriteBase /directory Will be exactly right. If this isn't working for you, I suggest contacting your hosting company for further support. Cake has worked successfully for me every time, deploying onto many different servers and hosting environments, in most cases without having to change a single line of core code. Out of interest, who are you hosting with? On Mar 30, 2:47 am, Raistlin Majere [EMAIL PROTECTED] wrote: The log file says: RewriteBase takes one argument, the base URL of the per-directory context On Mar 29, 1:03 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: Then go and read the server error log as the message suggests. On Sat, Mar 29, 2008 at 12:04 PM, Raistlin Majere [EMAIL PROTECTED] wrote: I got: 500 Internal Server Error More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. On Mar 28, 7:45 pm, Галкин Николай [EMAIL PROTECTED] wrote: I think yes! Create the file .htaccess in the root directory and write string: RewriteBase /new_root_folder But in your hosting must be enabled module mod_rewrite. Sorry for my English. I am from Russian. Can I change document root in shared hosting? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
We're under attack
I'm sure I won't be the first person to have seen this... or the last to respond to it: http://www.akbkhome.com/blog.php/View/161/CakePHP_taking_it_apart_and_the_better_written_world_of_sinners.html Seems like this guy just doesn't like frameworks. Ours in particular. --~--~-~--~~~---~--~~ 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: looking for a hosting company
Avoid 1and1 for Cake like the plague. It's a bloody nightmare. I had to change the .htaccess files, the databases were slow as hell... and their helpdesk support is pathetic. We're migrating all our sites away from them now. Steve On Mar 26, 5:59 pm, Rob Russell [EMAIL PROTECTED] wrote: Anybody hosted Cake on 1and1? I've really liked them so far but I haven't pushed any Cake apps on to that server yet. I had a VPS (somewhere else) and ran in to trouble locking it down so I've been relegated to managed virtual hosting for now (though 1and1 has met my needs completely so far). On Mar 26, 1:06 pm, [EMAIL PROTECTED] wrote: I agree with Chris on the VPS. I use KnownHost and LiquidWeb and both have been terrific. brian fidler http://www.brianfidler.com Follow me on Twitter:http://www.twitter.com/brianfidler Quoting Chris Hartjes [EMAIL PROTECTED]: On Wed, Mar 26, 2008 at 12:20 PM, jelmer [EMAIL PROTECTED] wrote: I can't recommend bluehost, you'll run into performance problems quite quickly I think, unless you have a very simple app. I used to have a (vbulletin) forum there and I was suspended a few times because of performance issues. I've heard good things about mediatemple but am using a futurehosting.biz vps right now which is all right. If you have any sort of sysadmin-fu, I recommend getting a VPS as well. I'm on slicehost and have had ZERO problems since switching to them about 5 months ago. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: looking for a hosting company
Perhaps I came down a little hard on them. I had a bad experience with their support the other day, which has resulted in me moving a client site to Webfusion instead. Stupidity really. On Mar 27, 2:31 pm, SumanRS [EMAIL PROTECTED] wrote: I've had the same experience as Miki. You need to be good at htaccess files to get cake working on 1and1 ... but running Cake on 1and1 seems fine. - SumanRS On Mar 27, 7:06 am, Miki [EMAIL PROTECTED] wrote: Avoid 1and1 for Cake like the plague. It's a bloody nightmare. I had to change the .htaccess files, the databases were slow as hell... and their helpdesk support is pathetic. We're migrating all our sites away from them now. I have my first test cake application in 11 (no traffic). The only issue was a line i needed to add in htaccess. Miki. --~--~-~--~~~---~--~~ 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: Your database configuration file is not present.
I know this might seem illogical to you - but ALL the information you need to get Cake working is in the docs. Hell, in most cases all you have to do is upload the files as downloaded either from the site or from SVN. This is all I've ever had to do. Rename app/config/database.default.php to database.php, add your database settings to it, and that should get you a basic, if minimal, Cake site running. Beyond that, the docs will help further. If you're trying to install it in a wildly different folder structure, then yes, you will have to change some paths in app/webroot/index.php - but unless you're doing so, you will generally NEVER need to touch it. On Mar 27, 1:46 pm, Raistlin Majere [EMAIL PROTECTED] wrote: I searched for root_path and root_app in there, but the text was not found. On Mar 27, 9:31 am, bingo [EMAIL PROTECTED] wrote: Probably CakePHP is not able to access the databaes configuration.. Open app/webroot/index.php file and change appropriate settings such as root_path, root_app, etc as suggested in the file. Regards, On Mar 27, 4:23 am, Raistlin Majere [EMAIL PROTECTED] wrote: I uploaded CakePHP to /public_html, but it is giving me an error. Your database configuration file is not present. My database configuration file IS present! Why am I getting this error message? I need to install CakePHP, but not CakePHP support in my host. How can I do that? --~--~-~--~~~---~--~~ 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: Trailing Whitespace Prevented a Session From Being Started
Is Zend Framework a big enough open-source project for you? They follow this convention. Steve On Mar 8, 8:31 pm, Guy Rutenberg [EMAIL PROTECTED] wrote: Hi rtconner, On Mar 8, 1:52 am, rtconner [EMAIL PROTECTED] wrote: FYI, It might be a good practive not to use the '?' to close off your php files. PHP closes when it hits the EOF anyways. I've seen some projects that do this, it works well. It's a nice thing to know. Do you know of any open-source project that use this as their coding guidelines? If this is even a somewhat used coding convention (I must admit I never saw it before) in some big/medium open-source projects I will want to consider using it too. Regards and thanks for your tip, Guy --~--~-~--~~~---~--~~ 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: Baking Cake with EasyPHP
Well, it could also be that EasyPHP just isn't very good. So far, my recommended WAMP setups are either XAMPP or Wampserver. I've had problems with several others, including Bitnami WampStack and EasyPHP. Steve On Mar 5, 9:15 pm, Juan Luis Baptiste [EMAIL PROTECTED] wrote: On Wed, Mar 5, 2008 at 2:17 PM, fahad19 [EMAIL PROTECTED] wrote: i just set up a basic model, and a 'scaffold' controller. instead of loading the model, all the content of the 'model php file' is shown in the 'html output' of cake. Probably you don't have php support configured on apache. Cheers, -- Juan Luis Baptiste --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---