Re: Help me set up cakephp on godaddy
Ooops, looks like you already figured it out. Teach me to post before reading to the end of a thread. Well, congrats on getting it all worked out! On 5/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Okay everone good news, got it set up and running. > > Here's what I did (This applies to godaddy's linux hosting which has > rewrite enabled): > > 1. Added a trailing slash '/' to every rewrite rule located in > > /.htaccess > /app/.htaccess > /app/webroot/.htaccess > > 2. Modified /webroot/index.php > > ... > if (!defined('ROOT')) { > //define('ROOT', 'FULL PATH TO DIRECTORY WHERE APP > DIRECTORY IS > LOCATED DO NOT ADD A TRAILING DIRECTORY SEPARATOR'; > //You should also use the DS define to seperate your > directories > // define('ROOT', dirname(dirname(dirname(__FILE__; > define('ROOT', '/home/content/y/o/u/you/html/'); > > } > if (!defined('APP_DIR')) { > //define('APP_DIR', 'DIRECTORY NAME OF APPLICATION'; > //define('APP_DIR', basename(dirname(dirname(__FILE__; > define ('APP_DIR', 'app'); > } > ... > > Left line 41 on config/core.php commented (thus disabling internal > rewrite) > > Thats it! everything worked fine right there. Even admin and routing > were working right away. > > Thank you so much for all your help! > > > On May 24, 11:49 am, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > > I have client that I set up with a cake site about a year ago on godaddy > but > > he changed the access so I can't see how I set it. He is going to send > me > > the new passwords today, I should be able to try to help you soon > > > > Sam D > > > > On 5/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > css are all linked using $html->css > > > > > Found out that if I edit webroot's .htaccess from > > > > > RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] > > > to > > > RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L] > > > > > Images and flash will show up, but still controllers are a no-go > > > > > On May 24, 11:11 am, "John David Anderson (_psychic_)" > > > <[EMAIL PROTECTED]> wrote: > > > > On May 24, 2007, at 10:04 AM, [EMAIL PROTECTED] wrote: > > > > > > > John, I already downloaded and installed a brand new copy of cake > and > > > > > uploaded it. > > > > > After that I tried working with internal urls but they worked only > if > > > > > I typed /site/index.php?controller > > > > > > That's how internal URLs work. > > > > > > example.com/index.php?/controller/action > > > > > > or > > > > > > example.com/index.php?url=/controller/action > > > > > > > Btw, im using godaddy's linux hosting with is SUPPOSED to have > > > > > mod_rewrite enabled. > > > > > > Verify that. That seems to be the main issue here, and you'll save a > > > > lot of time double checking that rather than assuming it. If it has > > > > it, why are you not using it? > > > > > > > here is the link to the site:http://sportmarketingcenter.com > > > > > > > so far I've gotten the homepage to render the images and flash > file > > > > > but thats it (try clicking on one of the menu options) it will > just go > > > > > back to the start page with no layout defined. > > > > > > It was my understanding that this was a fresh cake install, but it > > > > seems you're running a complete site - which is it? How are you > > > > linking to your CSS in the layouts? > > > > > > -- John > > > > -- > > (the old fart) the advice is free, the lack of crankiness will cost you > > > > - its a fine line between a real question and an idiot > > > > http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help me set up cakephp on godaddy
I actually just wrote a blog post about getting cake working a godaddy hosting. Check it out! http://nathan.ashleafmedia.com/2007/baking-cakephp-on-godaddy-hosting/ On 5/24/07, Samuel DeVore <[EMAIL PROTECTED]> wrote: > > I have client that I set up with a cake site about a year ago on godaddy > but he changed the access so I can't see how I set it. He is going to send > me the new passwords today, I should be able to try to help you soon > > Sam D > > On 5/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > css are all linked using $html->css > > > > Found out that if I edit webroot's .htaccess from > > > > RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] > > to > > RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L] > > > > Images and flash will show up, but still controllers are a no-go > > > > On May 24, 11:11 am, "John David Anderson (_psychic_)" > > <[EMAIL PROTECTED]> wrote: > > > On May 24, 2007, at 10:04 AM, [EMAIL PROTECTED] wrote: > > > > > > > > > > > > > John, I already downloaded and installed a brand new copy of cake > > and > > > > uploaded it. > > > > After that I tried working with internal urls but they worked only > > if > > > > I typed /site/index.php?controller > > > > > > That's how internal URLs work. > > > > > > example.com/index.php?/controller/action > > > > > > or > > > > > > example.com/index.php?url=/controller/action > > > > > > > Btw, im using godaddy's linux hosting with is SUPPOSED to have > > > > mod_rewrite enabled. > > > > > > Verify that. That seems to be the main issue here, and you'll save a > > > lot of time double checking that rather than assuming it. If it has > > > it, why are you not using it? > > > > > > > here is the link to the site:http://sportmarketingcenter.com > > > > > > > so far I've gotten the homepage to render the images and flash file > > > > but thats it (try clicking on one of the menu options) it will just > > go > > > > back to the start page with no layout defined. > > > > > > It was my understanding that this was a fresh cake install, but it > > > seems you're running a complete site - which is it? How are you > > > linking to your CSS in the layouts? > > > > > > -- John > > > > > > > > > -- > (the old fart) the advice is free, the lack of crankiness will cost you > > - its a fine line between a real question and an idiot > > http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ > > > -- Nathan Garza AshLeaf Media | Director of Technology Innovations _ www.ashleafmedia.com | [EMAIL PROTECTED] | 832.514.5726 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Bug with - /cake/libs/router.php :: stripEscape() - cakephp.v.1.1.15.5144
https://trac.cakephp.org/ticket/2640#preview The new method in router.php is: stripEscape($param) The way it's currently written, it can run into problems with highly nested arrays basically it assumes that there's a text value instead of an array value. This is very easily fixed by making the method self-recurse. I have updated my router.php to do exactly that, and it seems to be working fine. == code == $value) { if(is_string($value)) { $return[$key] = preg_replace('/^ *-!/', '', $value); } else { foreach ($value as $array => $string) { $return[$key][$array] = $this->stripEscape($string); } } } return $return; } ?> --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Issue with Sitepoint Article
I am attempting to follow the article at Sitepoint (http:// www.sitepoint.com/article/application-development-cakephp). I believe that I have CakePHP successfully installed and configured (at http://www.b13ed.com/); however, I am stuck at page 2 of the article. I cannot get http://b13ed.com/notes/ to produce any results - other than a lovely 404 error. I have created and uploaded the 2 files as directed by the article, but not getting the expected results. I would be grateful for any direction that will help my to troubleshoot the issue. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Including a cake ajax form in a non cake php page
I have an ajax driven form in cake, that works like a champ. it's really pretty simple: When you submit the form, it sends the request to the controller and then updates the div containing the html form with the response from the controller. Now, the thing that I'm trying to figure out is to include that form as an element in a non-cake php page (POPS - Plain Old PHP Script - no framework just html + php). I guess I could cheat and just include the ajax cake form in an iframe, but then that negates all the coolness of having an ajax form. Ideally, I wish I could do something like this in my plain PHP file: (the cake app is in a secondary level directory) - snippet -- end snippet where the include would suck over the processed output from my cake view, instead of just trying to include the file contents, which it won't find. Anybody have any advice? TIA! Rich --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Pagination component misbehaving in php4
Hi all! I have a project that uses the Pagination component. It works perfectly in my development environment, however when I uploaded the project to the production server things went sour. The component seems to do it's job, i.e. results get ordered, controlling the parameters via the url works and elements/pagination.thtml gets rendered properly. The problem is that the header links have mysteriously disappeared. I placed some debug calls around the code and found that all calls to the pagination component and helper methods get exactly the same data in both servers. When I placed calls to debug inside PaginationHelper's sortBy() method I found that in my development server the field _pageDetails is always set, while in my production server it gets wiped out somehow, hence the lack of header links. The puzzle is, why is this happening? The project is exactly the same on both servers, the database is the same, the only thing I could think of is some weirdness related to php versions, my development server runs php 5.2.1 and the productions server runs 4.3.11. Can anyone give me any clues? Thanks! Bernardo PHP Version 5.2.1 elements/result_table.thml $th[] = $this->Pagination->sortBy(...) PaginationHelper->_pageDetails = Array ( [importParams] => [Defaults] => Array ( [page] => 1 [show] => 10 [sortBy] => id [sortByClass] => Clube [direction] => ASC ) [show] => 10 [page] => 1 [sortBy] => id [sortByClass] => Clube [direction] => ASC [ajaxDivUpdate] => content [ajaxFormId] => [maxPages] => 9 [showLimits] => 1 [style] => ajax [paramStyle] => get [paramSeperator] => / [url] => /clubes [total] => 3237 [resultsPerPage] => Array ( [0] => 10 [1] => 25 [2] => 50 [3] => 100 ) [pageCount] => 324 [previousPage] => [nextPage] => 2 ) PHP Version 4.3.11 elements/result_table.thml $th[] = $this->Pagination->sortBy(...) PaginationHelper->_pageDetails = Array ( ) --~--~-~--~~~---~--~~ 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 storing Binary Data over 900K in Field
ya that's what i'm thinking. i was thinking of placing the area that stores the files outside of the public_html area, but how would i access this area from within cakephp? that way, php can still access the files but no one can just point their browser to the area and open the file. On May 24, 10:45 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > This isn't a solution, but you should seriously consider using the > filesystem for storing files. It's much faster and much more well > suited for storing files. > > On May 24, 7:39 pm, rockit <[EMAIL PROTECTED]> wrote: > > > i have a table which i'm using to store binary data, so that someone > > can buy a digital good, and after the payment process is completed > > they can download the binary data out of the table, ie. MP3's. > > > the problem i'm having right now is when i'm trying to save any file > > over 900K, i get the error 'max_allowed_packet' bytes. my script that > > i'm trying to save with just basically is: > > > $tempfile = fopen($uploadfile, 'rb'); > > > $filedata = fread($tempfile, filesize($uploadfile)); > > > $filedata = addslashes($filedata); > > > and then of course my insert sql statement. i'm wondering what else > > can be done either PHP or MySQL wise to accomdate this better. It > > should be able to handle up to 10 MB files for this project. > > Mediumblob is capable of up to 16 but this should be sufficient. I > > get no issues with files under 900K. --~--~-~--~~~---~--~~ 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 storing Binary Data over 900K in Field
This isn't a solution, but you should seriously consider using the filesystem for storing files. It's much faster and much more well suited for storing files. On May 24, 7:39 pm, rockit <[EMAIL PROTECTED]> wrote: > i have a table which i'm using to store binary data, so that someone > can buy a digital good, and after the payment process is completed > they can download the binary data out of the table, ie. MP3's. > > the problem i'm having right now is when i'm trying to save any file > over 900K, i get the error 'max_allowed_packet' bytes. my script that > i'm trying to save with just basically is: > > $tempfile = fopen($uploadfile, 'rb'); > > $filedata = fread($tempfile, filesize($uploadfile)); > > $filedata = addslashes($filedata); > > and then of course my insert sql statement. i'm wondering what else > can be done either PHP or MySQL wise to accomdate this better. It > should be able to handle up to 10 MB files for this project. > Mediumblob is capable of up to 16 but this should be sufficient. I > get no issues with files under 900K. --~--~-~--~~~---~--~~ 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: Invalidating model from another model
Have you seen the example of the Observer pattern, described in the bakery somewhere? This might be helpful... On May 24, 1:09 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I've searched around but can't find any discusson on this... > > I have a method in the model that is handling a certain function for > me. It adds a couple records all linked together, and also allows > editing of these records. For the sake of example from the controller > I call: > > $this->PartyParticipant->handleGuest( $name, $email, $rsvp ); > > and it will do its stuff, interacting with a couple models fine since > they're all referenced in the PartyParticipant model (via hasOne, > belongsTo, etc). > > Problem is, I want to invalidate fields of OTHER models within this > method. > > In the model I want to write: > $this->UserDetail->invalidate('name') > > However the controller has a unique UserDetail object from the > PartyParticipant object... so it loses that invalidation data. > > I suppose I can do this from controller: > $this->PartyParticipant->controller = &$this; > > and in the PartyParticipant model: > $this->controller->UserDetail->invalidate('name'); > > but i hate to rely on a reference needing to be passed.. > > Any ideas? Thoughts? threats? > > Thanks!! > > -ryan --~--~-~--~~~---~--~~ 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: Issue on software design / good practice
Cool, the concept of a value object makes sense to me. Too bad it's only planned for the 2.0 milestone ;). On 25 mei, 02:16, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I would agree with you, the Model seems like the best place for this > logic. But accepting cake's implementation of MVC, the next best place > is a helper. In this case UserHelper. > echo $user->getFullName($data['User']); > > In the future, I believe we will have the choice of using VO (value > objects) instead of data arrays. > 2.0 milestone: "Change Models to return object instances instead of > arrays" > In which case, (IMHO) the VO would become the best place for a > getFullName method. > > cook > > On May 24, 6:06 pm, tawm <[EMAIL PROTECTED]> wrote: > > > Hey all, > > > I'm dealing with this design issue and I'm really curious what you > > guys think of it. I keep thinking I must be overlooking something, > > because it's such a basic thing. > > > Ok, I've got a concept in the MVC approach, so let's say it's a user. > > So I've got a 'User' model, a 'UsersController' and (let's say) a > > 'profile' view. The 'profile' view shows the basic information of the > > user, such as name, age etc.. It gets this information from the > > UsersController in the form of a data array, which in turn is returned > > by a findAll() request to the model. In the model we've got a field > > for first name and a field for last name, since that's how it's stored > > in the database. But, in the view I want to print the full name. Now, > > the question is, where do you put the method that does the conversion > > from first and last name to full name? > > > * My first thought was; in the model. This method is about nothing but > > a different representation of the same data, so it's clearly model > > material. So that would mean just add a getFullName() method to the > > User model and done. But this approach is problematic, since in the > > view all we've got is a data array (with first and last name). At the > > moment we want to actually get the full name for displaying it (in the > > view) we cannot reach the model anymore and therefore cannot call the > > getFullName() method. > > Ok, so we could call the method in the controller and pass the result > > to the view as a separate variable. Yeah sure, that's possible, but > > that's really not a very attractive solution. It would mean you would > > manually have to pass an extra variable to every view that wants to > > use the result of a partical model method call. That gets out of hand > > very quickly. > > > * So we need another location for our method. What about a helper? > > Helpers exist to encapsulate common view processing, so that sounds > > like an appropriate location. But, it doesn't feel good though. If we > > would be discussing f.e. a date formatting method (getFullDate()) then > > a helper would be the perfect spot, since date formatting applies to > > many different model throughout one application. This is not the case > > with the name of a user though. Our getFullName() method applies very > > specifically to a user alone, so we don't want to put it in a general > > purpose, open scope, helper file. > > > * Hmm, so now what? What are the alternatives? Well, we could add some > > postprocessing to the model's afterFind() method, in which we add an > > extra 'fullName' field to the data array. Ok, that's possible, and at > > least it enables us to keep the 'conversion-to-full-name-logic' in the > > model. But still, my sense of aestetics is not satisfied. All a model > > does in this approach is fetching and preparing a data array and pass > > it on to the controller. The model should stuff every possible > > representation of the raw data that might be needed by the view into > > this data array beforehand, since the model is out of reach as soon as > > the data ends up in the view. This feels like rape. > > > So, what's your view on this issue? I hope I'm missing something very > > obvious here, or my view on software design is flawed, because it > > annoys me that I cannot find a pleasing solution to an issue this > > basic. > > > Tim Molendijk --~--~-~--~~~---~--~~ 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: Issue on software design / good practice
Well, of course, in this case you could get away with not using a method at all. But this case was just an example case. I can think of many derivatives of the raw model data that you definitely want to put in a method, a method to calculate age based on birthdate being the most basic example. As far as the afterFind() solution goes, like I discussed in my initial post that really isn't a preferable solution in many situations. Imagine you have a huge amount of methods like the one I am discussing. Every view is just using one or two of them, appropriate to its needs. Nevertheless, for every view the afterFind() will call every single method and stuff all the results into the data array. That's not very elegant. Now imagine some of these methods take parameters... ... ...can you see my point? On 25 mei, 02:38, "John David Anderson (_psychic_)" <[EMAIL PROTECTED]> wrote: > On May 24, 2007, at 6:16 PM, [EMAIL PROTECTED] wrote: > > > > > I would agree with you, the Model seems like the best place for this > > logic. But accepting cake's implementation of MVC, the next best place > > is a helper. In this case UserHelper. > > echo $user->getFullName($data['User']); > > > In the future, I believe we will have the choice of using VO (value > > objects) instead of data arrays. > > 2.0 milestone: "Change Models to return object instances instead of > > arrays" > > In which case, (IMHO) the VO would become the best place for a > > getFullName method. > > Do you need a method? Personally, I hate getters and setters. > > What about slipping it in the data array using afterFind() in the > model? That way every call that gets a user's name also returns a > full name... > > -- 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: Problem storing Binary Data over 900K in Field
You need to change a setting for mysql. See http://dev.mysql.com/doc/refman/5.0/en/packet-too-large.html and http://dev.mysql.com/doc/refman/5.0/en/program-variables.html . Google is awesome! On May 24, 5:39 pm, rockit <[EMAIL PROTECTED]> wrote: > i have a table which i'm using to store binary data, so that someone > can buy a digital good, and after the payment process is completed > they can download the binary data out of the table, ie. MP3's. > > the problem i'm having right now is when i'm trying to save any file > over 900K, i get the error 'max_allowed_packet' bytes. my script that > i'm trying to save with just basically is: > > $tempfile = fopen($uploadfile, 'rb'); > > $filedata = fread($tempfile, filesize($uploadfile)); > > $filedata = addslashes($filedata); > > and then of course my insert sql statement. i'm wondering what else > can be done either PHP or MySQL wise to accomdate this better. It > should be able to handle up to 10 MB files for this project. > Mediumblob is capable of up to 16 but this should be sufficient. I > get no issues with files under 900K. --~--~-~--~~~---~--~~ 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: Issue on software design / good practice
I do Seems to accomplish what you are looking for without a new function :D I understand what you are saying. Ran into the same thing myself when doing some scaffolding and wanting it to display the full name (ie. $displayField). Eventually I just gave up and did the above ;) On May 24, 4:06 pm, tawm <[EMAIL PROTECTED]> wrote: > Hey all, > > I'm dealing with this design issue and I'm really curious what you > guys think of it. I keep thinking I must be overlooking something, > because it's such a basic thing. > > Ok, I've got a concept in the MVC approach, so let's say it's a user. > So I've got a 'User' model, a 'UsersController' and (let's say) a > 'profile' view. The 'profile' view shows the basic information of the > user, such as name, age etc.. It gets this information from the > UsersController in the form of a data array, which in turn is returned > by a findAll() request to the model. In the model we've got a field > for first name and a field for last name, since that's how it's stored > in the database. But, in the view I want to print the full name. Now, > the question is, where do you put the method that does the conversion > from first and last name to full name? > > * My first thought was; in the model. This method is about nothing but > a different representation of the same data, so it's clearly model > material. So that would mean just add a getFullName() method to the > User model and done. But this approach is problematic, since in the > view all we've got is a data array (with first and last name). At the > moment we want to actually get the full name for displaying it (in the > view) we cannot reach the model anymore and therefore cannot call the > getFullName() method. > Ok, so we could call the method in the controller and pass the result > to the view as a separate variable. Yeah sure, that's possible, but > that's really not a very attractive solution. It would mean you would > manually have to pass an extra variable to every view that wants to > use the result of a partical model method call. That gets out of hand > very quickly. > > * So we need another location for our method. What about a helper? > Helpers exist to encapsulate common view processing, so that sounds > like an appropriate location. But, it doesn't feel good though. If we > would be discussing f.e. a date formatting method (getFullDate()) then > a helper would be the perfect spot, since date formatting applies to > many different model throughout one application. This is not the case > with the name of a user though. Our getFullName() method applies very > specifically to a user alone, so we don't want to put it in a general > purpose, open scope, helper file. > > * Hmm, so now what? What are the alternatives? Well, we could add some > postprocessing to the model's afterFind() method, in which we add an > extra 'fullName' field to the data array. Ok, that's possible, and at > least it enables us to keep the 'conversion-to-full-name-logic' in the > model. But still, my sense of aestetics is not satisfied. All a model > does in this approach is fetching and preparing a data array and pass > it on to the controller. The model should stuff every possible > representation of the raw data that might be needed by the view into > this data array beforehand, since the model is out of reach as soon as > the data ends up in the view. This feels like rape. > > So, what's your view on this issue? I hope I'm missing something very > obvious here, or my view on software design is flawed, because it > annoys me that I cannot find a pleasing solution to an issue this > basic. > > Tim Molendijk --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Form Helper - create() - action = same url by default?
Hello, it's my first day with CakePHP (1.2.0.5146alpha). I'm paying around with the form helper, My route: /:language/:controller/:action/* it's using an non-standard variable (language). I have a simple .../en/posts/add controller/action. Now i use the form helper to create a form tag: create('Post', array('type' => 'post')) ?> The problem is that it will produce action="/posts/add" The language is missing! After investigating the core code I found two workarounds: create('Post', array('type' => 'post', 'url' => array('language' => $this->params['language']))) ?> create('Post', array('type' => 'post', 'url' => $html->url())) ?> Is this behavior intended, a bug or did I miss anything? --~--~-~--~~~---~--~~ 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: Issue on software design / good practice
On May 24, 2007, at 6:16 PM, [EMAIL PROTECTED] wrote: > > I would agree with you, the Model seems like the best place for this > logic. But accepting cake's implementation of MVC, the next best place > is a helper. In this case UserHelper. > echo $user->getFullName($data['User']); > > In the future, I believe we will have the choice of using VO (value > objects) instead of data arrays. > 2.0 milestone: "Change Models to return object instances instead of > arrays" > In which case, (IMHO) the VO would become the best place for a > getFullName method. Do you need a method? Personally, I hate getters and setters. What about slipping it in the data array using afterFind() in the model? That way every call that gets a user's name also returns a full name... -- 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: Issue on software design / good practice
I would agree with you, the Model seems like the best place for this logic. But accepting cake's implementation of MVC, the next best place is a helper. In this case UserHelper. echo $user->getFullName($data['User']); In the future, I believe we will have the choice of using VO (value objects) instead of data arrays. 2.0 milestone: "Change Models to return object instances instead of arrays" In which case, (IMHO) the VO would become the best place for a getFullName method. cook On May 24, 6:06 pm, tawm <[EMAIL PROTECTED]> wrote: > Hey all, > > I'm dealing with this design issue and I'm really curious what you > guys think of it. I keep thinking I must be overlooking something, > because it's such a basic thing. > > Ok, I've got a concept in the MVC approach, so let's say it's a user. > So I've got a 'User' model, a 'UsersController' and (let's say) a > 'profile' view. The 'profile' view shows the basic information of the > user, such as name, age etc.. It gets this information from the > UsersController in the form of a data array, which in turn is returned > by a findAll() request to the model. In the model we've got a field > for first name and a field for last name, since that's how it's stored > in the database. But, in the view I want to print the full name. Now, > the question is, where do you put the method that does the conversion > from first and last name to full name? > > * My first thought was; in the model. This method is about nothing but > a different representation of the same data, so it's clearly model > material. So that would mean just add a getFullName() method to the > User model and done. But this approach is problematic, since in the > view all we've got is a data array (with first and last name). At the > moment we want to actually get the full name for displaying it (in the > view) we cannot reach the model anymore and therefore cannot call the > getFullName() method. > Ok, so we could call the method in the controller and pass the result > to the view as a separate variable. Yeah sure, that's possible, but > that's really not a very attractive solution. It would mean you would > manually have to pass an extra variable to every view that wants to > use the result of a partical model method call. That gets out of hand > very quickly. > > * So we need another location for our method. What about a helper? > Helpers exist to encapsulate common view processing, so that sounds > like an appropriate location. But, it doesn't feel good though. If we > would be discussing f.e. a date formatting method (getFullDate()) then > a helper would be the perfect spot, since date formatting applies to > many different model throughout one application. This is not the case > with the name of a user though. Our getFullName() method applies very > specifically to a user alone, so we don't want to put it in a general > purpose, open scope, helper file. > > * Hmm, so now what? What are the alternatives? Well, we could add some > postprocessing to the model's afterFind() method, in which we add an > extra 'fullName' field to the data array. Ok, that's possible, and at > least it enables us to keep the 'conversion-to-full-name-logic' in the > model. But still, my sense of aestetics is not satisfied. All a model > does in this approach is fetching and preparing a data array and pass > it on to the controller. The model should stuff every possible > representation of the raw data that might be needed by the view into > this data array beforehand, since the model is out of reach as soon as > the data ends up in the view. This feels like rape. > > So, what's your view on this issue? I hope I'm missing something very > obvious here, or my view on software design is flawed, because it > annoys me that I cannot find a pleasing solution to an issue this > basic. > > Tim Molendijk --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Problem storing Binary Data over 900K in Field
i have a table which i'm using to store binary data, so that someone can buy a digital good, and after the payment process is completed they can download the binary data out of the table, ie. MP3's. the problem i'm having right now is when i'm trying to save any file over 900K, i get the error 'max_allowed_packet' bytes. my script that i'm trying to save with just basically is: $tempfile = fopen($uploadfile, 'rb'); $filedata = fread($tempfile, filesize($uploadfile)); $filedata = addslashes($filedata); and then of course my insert sql statement. i'm wondering what else can be done either PHP or MySQL wise to accomdate this better. It should be able to handle up to 10 MB files for this project. Mediumblob is capable of up to 16 but this should be sufficient. I get no issues with files under 900K. --~--~-~--~~~---~--~~ 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: Getting MimeType for File Upload
Mind telling us what the issues were and what the resolution was? I get bad mime types in an app too, and using swfupload gives me application/octet-stream since it is coming via flash. I would be interested in seeing what you did. rockit-2 wrote: > > > all issues resolved. > > On May 24, 6:05 pm, rockit <[EMAIL PROTECTED]> wrote: >> http://bin.cakephp.org/view/1381182794 shows the controller. >> >> On May 24, 5:21 pm, rockit <[EMAIL PROTECTED]> wrote: >> >> > got the issue fixed with the size & type, it was in my php >> > installation had to increase max_upload. >> >> > However, when i go to save the type, it saves the first letter of >> > $this->data['Digital']['filename']['name']; >> >> > this is the code i'm using to save the field. >> >> > //take the type of filename and store it in db under mimetype >> > $this->data['Digital']['mimetype'] = $this->data['Digital']['filename'] >> > ['type']; >> >> > On May 24, 4:50 pm, rockit <[EMAIL PROTECTED]> wrote: >> >> > > I think i found part of the issue, for whatever reason it's not >> > > sending the mime type for mp3's. i did a print_r on the whole array >> > > to see what data is being passed and it's sending the type or size >> for >> > > that matter. is this an apache issue? >> >> > > i'm posting the data >> >> > > > > > method="post" enctype="multipart/form-data"> >> >> > > is there a different enctype i should be using? >> >> > > On May 24, 4:25 pm, rockit <[EMAIL PROTECTED]> wrote: >> >> > > > it's important that i store the mime type of the file upload. i >> need >> > > > to store binary data in the db for download later. but i can't >> seem >> > > > to get the mimetype inserted properly. >> >> > > > code snippet: >> >> > > > $this->data['Digital']['filename'] = >> $this->data['Digital']['filename'] >> > > > ['name']; >> >> > > > //take the type of filename and store it in db under mimetype >> > > > $this->data['Digital']['mimetype'] = >> $this->data['Digital']['filename'] >> > > > ['type']; >> >> > > > having an issue with getting the type of file to store in the db, >> so i >> > > > know what each file type is. please help. > > > > > > -- View this message in context: http://www.nabble.com/Getting-MimeType-for-File-Upload-tf3812317.html#a10794235 Sent from the CakePHP mailing list archive at Nabble.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 -~--~~~~--~~--~--~---
Issue on software design / good practice
Hey all, I'm dealing with this design issue and I'm really curious what you guys think of it. I keep thinking I must be overlooking something, because it's such a basic thing. Ok, I've got a concept in the MVC approach, so let's say it's a user. So I've got a 'User' model, a 'UsersController' and (let's say) a 'profile' view. The 'profile' view shows the basic information of the user, such as name, age etc.. It gets this information from the UsersController in the form of a data array, which in turn is returned by a findAll() request to the model. In the model we've got a field for first name and a field for last name, since that's how it's stored in the database. But, in the view I want to print the full name. Now, the question is, where do you put the method that does the conversion from first and last name to full name? * My first thought was; in the model. This method is about nothing but a different representation of the same data, so it's clearly model material. So that would mean just add a getFullName() method to the User model and done. But this approach is problematic, since in the view all we've got is a data array (with first and last name). At the moment we want to actually get the full name for displaying it (in the view) we cannot reach the model anymore and therefore cannot call the getFullName() method. Ok, so we could call the method in the controller and pass the result to the view as a separate variable. Yeah sure, that's possible, but that's really not a very attractive solution. It would mean you would manually have to pass an extra variable to every view that wants to use the result of a partical model method call. That gets out of hand very quickly. * So we need another location for our method. What about a helper? Helpers exist to encapsulate common view processing, so that sounds like an appropriate location. But, it doesn't feel good though. If we would be discussing f.e. a date formatting method (getFullDate()) then a helper would be the perfect spot, since date formatting applies to many different model throughout one application. This is not the case with the name of a user though. Our getFullName() method applies very specifically to a user alone, so we don't want to put it in a general purpose, open scope, helper file. * Hmm, so now what? What are the alternatives? Well, we could add some postprocessing to the model's afterFind() method, in which we add an extra 'fullName' field to the data array. Ok, that's possible, and at least it enables us to keep the 'conversion-to-full-name-logic' in the model. But still, my sense of aestetics is not satisfied. All a model does in this approach is fetching and preparing a data array and pass it on to the controller. The model should stuff every possible representation of the raw data that might be needed by the view into this data array beforehand, since the model is out of reach as soon as the data ends up in the view. This feels like rape. So, what's your view on this issue? I hope I'm missing something very obvious here, or my view on software design is flawed, because it annoys me that I cannot find a pleasing solution to an issue this basic. Tim Molendijk --~--~-~--~~~---~--~~ 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: Getting MimeType for File Upload
all issues resolved. On May 24, 6:05 pm, rockit <[EMAIL PROTECTED]> wrote: > http://bin.cakephp.org/view/1381182794 shows the controller. > > On May 24, 5:21 pm, rockit <[EMAIL PROTECTED]> wrote: > > > got the issue fixed with the size & type, it was in my php > > installation had to increase max_upload. > > > However, when i go to save the type, it saves the first letter of > > $this->data['Digital']['filename']['name']; > > > this is the code i'm using to save the field. > > > //take the type of filename and store it in db under mimetype > > $this->data['Digital']['mimetype'] = $this->data['Digital']['filename'] > > ['type']; > > > On May 24, 4:50 pm, rockit <[EMAIL PROTECTED]> wrote: > > > > I think i found part of the issue, for whatever reason it's not > > > sending the mime type for mp3's. i did a print_r on the whole array > > > to see what data is being passed and it's sending the type or size for > > > that matter. is this an apache issue? > > > > i'm posting the data > > > > > > method="post" enctype="multipart/form-data"> > > > > is there a different enctype i should be using? > > > > On May 24, 4:25 pm, rockit <[EMAIL PROTECTED]> wrote: > > > > > it's important that i store the mime type of the file upload. i need > > > > to store binary data in the db for download later. but i can't seem > > > > to get the mimetype inserted properly. > > > > > code snippet: > > > > > $this->data['Digital']['filename'] = $this->data['Digital']['filename'] > > > > ['name']; > > > > > //take the type of filename and store it in db under mimetype > > > > $this->data['Digital']['mimetype'] = $this->data['Digital']['filename'] > > > > ['type']; > > > > > having an issue with getting the type of file to store in the db, so i > > > > know what each file type is. please help. --~--~-~--~~~---~--~~ 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: simple relation
Set up a belongsTo relationship in your Project model. var $belongsTo = array('Status'); should be enough. On May 24, 2:27 pm, pete <[EMAIL PROTECTED]> wrote: > hi, > i still play around with creating a simple relation, and i don't get > it to run. > thanks > pete > > TABLES: > status > id > description > > project > id > status_id > project_title > > CONTROLLER > $this->set('projects', $this->Project->findAll()); > > every project has one status. > how do i create a relation between these 2 tables so i can print the > status.description and not only the status.id > > VIEW > project_title: Test > status: Open ?? --~--~-~--~~~---~--~~ 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: problemns with search on models
On 5/24/07, Kamik <[EMAIL PROTECTED]> wrote: > > any idea? Bumping a post is considered bad manners on this list. Be patient, if someone has an answer for you they will post it... -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: problemns with search on models
any idea? On 24 maio, 11:30, Kamik <[EMAIL PROTECTED]> wrote: > hello, im having problems with search on models > > i have models user, module_user and module > im trying made one unique search with cake for return the result. I > have theses datas for compate > user.login > user.password > module.id > > anyone know how made one unique search with theses datas? i only made > it using findBySql. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
simple relation
hi, i still play around with creating a simple relation, and i don't get it to run. thanks pete TABLES: status id description project id status_id project_title CONTROLLER $this->set('projects', $this->Project->findAll()); every project has one status. how do i create a relation between these 2 tables so i can print the status.description and not only the status.id VIEW project_title: Test status: Open ?? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Paginator - rows per page
How would I dynamically set the paginator options limit array element value? I have it set statically in the controller as so: var $paginate = array('limit' => 25, 'order' => array( '' => 'asc')) Would like to allow the user to be able to change the limit value, but not sure of the syntax in the View to use. TIA Rick --~--~-~--~~~---~--~~ 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: Getting MimeType for File Upload
http://bin.cakephp.org/view/1381182794 shows the controller. On May 24, 5:21 pm, rockit <[EMAIL PROTECTED]> wrote: > got the issue fixed with the size & type, it was in my php > installation had to increase max_upload. > > However, when i go to save the type, it saves the first letter of > $this->data['Digital']['filename']['name']; > > this is the code i'm using to save the field. > > //take the type of filename and store it in db under mimetype > $this->data['Digital']['mimetype'] = $this->data['Digital']['filename'] > ['type']; > > On May 24, 4:50 pm, rockit <[EMAIL PROTECTED]> wrote: > > > I think i found part of the issue, for whatever reason it's not > > sending the mime type for mp3's. i did a print_r on the whole array > > to see what data is being passed and it's sending the type or size for > > that matter. is this an apache issue? > > > i'm posting the data > > > > method="post" enctype="multipart/form-data"> > > > is there a different enctype i should be using? > > > On May 24, 4:25 pm, rockit <[EMAIL PROTECTED]> wrote: > > > > it's important that i store the mime type of the file upload. i need > > > to store binary data in the db for download later. but i can't seem > > > to get the mimetype inserted properly. > > > > code snippet: > > > > $this->data['Digital']['filename'] = $this->data['Digital']['filename'] > > > ['name']; > > > > //take the type of filename and store it in db under mimetype > > > $this->data['Digital']['mimetype'] = $this->data['Digital']['filename'] > > > ['type']; > > > > having an issue with getting the type of file to store in the db, so i > > > know what each file type is. please help. --~--~-~--~~~---~--~~ 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: Complex SQL Conditions (multiple ORs)
Fabulous! That works perfectly for most of my queries. But why won't it work in the following? $conditions['NOT'] = array('Listing.expiration' => "BETWEEN 1 AND ".mktime()); $conditions[0]['OR'] = array("Listing.title" => "LIKE %".$term."%", "Listing.description" => "LIKE %".$term."%"); $conditions[1]['OR'] = array("Listing.title" => "LIKE %".$term_2."%", "Listing.description" => "LIKE %".$term_2."%"); Based on the examples given in other discussions, I'd expect this to return all listings between the timestamps given that include both term 1 and term 2 in either the title or description. But instead, the expiration requirement is ignored entirely. My apologies if these questions are answered elsewhere. I have searched both the CakePHP site and this group. A robust conditions tutorial would be an excellent endeavor! --~--~-~--~~~---~--~~ 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: Getting MimeType for File Upload
got the issue fixed with the size & type, it was in my php installation had to increase max_upload. However, when i go to save the type, it saves the first letter of $this->data['Digital']['filename']['name']; this is the code i'm using to save the field. //take the type of filename and store it in db under mimetype $this->data['Digital']['mimetype'] = $this->data['Digital']['filename'] ['type']; On May 24, 4:50 pm, rockit <[EMAIL PROTECTED]> wrote: > I think i found part of the issue, for whatever reason it's not > sending the mime type for mp3's. i did a print_r on the whole array > to see what data is being passed and it's sending the type or size for > that matter. is this an apache issue? > > i'm posting the data > > method="post" enctype="multipart/form-data"> > > is there a different enctype i should be using? > > On May 24, 4:25 pm, rockit <[EMAIL PROTECTED]> wrote: > > > it's important that i store the mime type of the file upload. i need > > to store binary data in the db for download later. but i can't seem > > to get the mimetype inserted properly. > > > code snippet: > > > $this->data['Digital']['filename'] = $this->data['Digital']['filename'] > > ['name']; > > > //take the type of filename and store it in db under mimetype > > $this->data['Digital']['mimetype'] = $this->data['Digital']['filename'] > > ['type']; > > > having an issue with getting the type of file to store in the db, so i > > know what each file type is. please help. --~--~-~--~~~---~--~~ 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: Getting MimeType for File Upload
I think i found part of the issue, for whatever reason it's not sending the mime type for mp3's. i did a print_r on the whole array to see what data is being passed and it's sending the type or size for that matter. is this an apache issue? i'm posting the data is there a different enctype i should be using? On May 24, 4:25 pm, rockit <[EMAIL PROTECTED]> wrote: > it's important that i store the mime type of the file upload. i need > to store binary data in the db for download later. but i can't seem > to get the mimetype inserted properly. > > code snippet: > > $this->data['Digital']['filename'] = $this->data['Digital']['filename'] > ['name']; > > //take the type of filename and store it in db under mimetype > $this->data['Digital']['mimetype'] = $this->data['Digital']['filename'] > ['type']; > > having an issue with getting the type of file to store in the db, so i > know what each file type is. please help. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
othAuth error Notice: Only variables should be assigned by reference
Hi All, I am implementing the othAuth component in a new project for which I quickly drafted a demoversion using scaffolding (I love cake for it). When I tested it on my two development servers all was fine, but putting it on the server of the client the app broke with the above error in the component of othAuth. It is line 301: $UserModel =& $this->_createModel(); I read it is a php 4 bug. Unfortunately I could not get the server to be updated very soon. Does anybody know of a quick and dirty workaround by any chance? For the time being? Thanks, Paul --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Getting MimeType for File Upload
it's important that i store the mime type of the file upload. i need to store binary data in the db for download later. but i can't seem to get the mimetype inserted properly. code snippet: $this->data['Digital']['filename'] = $this->data['Digital']['filename'] ['name']; //take the type of filename and store it in db under mimetype $this->data['Digital']['mimetype'] = $this->data['Digital']['filename'] ['type']; having an issue with getting the type of file to store in the db, so i know what each file type is. please help. --~--~-~--~~~---~--~~ 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: $form->create not producing anything
On May 24, 2007, at 12:50 PM, Ita wrote: > > Oh man, > That was painful. > I was hoping that my mistake was bigger than that. > Thanks for pointing out my stupidity... > you saved me a bunch of time I'm just wondering how you verified the enctype when the tag wasn't there. :) - John > > On May 24, 9:30 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: >> you need to echo the form->create >> >> On 5/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >>> Hi, >>> I'm new to CakePHP but I have followed the blog tutorial and now >>> trying to devlop something on my own using cake 1.2. >> >>> I have the following template to add a user to the system: >>> Add User >> >>> create('User',array('action'=>'/users/add'))?> >>> >>> input('User/user_name', array('size' => >>> '40'))?> >>> error('User/user_name', 'Username is >>> required.') ?> >>> >>> >>> input('User/password', array >>> ('size'=>'10')) ? >> >>> error('User/password', 'Password is >>> required.') ?> >>> >>> >>> input('User/email', array >>> ('size'=>'50')) ?> >>> error('User/email', 'eMail is >>> required.') ?> >>> >>> submit('Save') ?> >>> >>> end('User')?> >> >>> I have added Form helper to the users_controller.php file so I don't >>> get an error about $form not being recognized. >>> When I call the template the form control appear but there is no >>> form >>> tag like so: >>> Add User >>> >>> User >>> Name>> size="40" >>> maxlength="255" value="" id="UserUserName" /> >> >>> >>> >> for="UserPassword">Password>> name="data[User][password]" size="10" value="" id="UserPassword" / >>> >>> div> >>> >>> Email>> label>>> maxlength="100" value="" id="UserEmail" /> >>> >> div> >> >>> Anyone knows what am I doing wrong? >> >> -- >> (the old fart) the advice is free, the lack of crankiness will >> cost you >> >> - its a fine line between a real question and an idiot >> >> http://blog.samdevore.com/archives/2007/03/05/when-open-source- >> bugs-me/ > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: $form->create not producing anything
Oh man, That was painful. I was hoping that my mistake was bigger than that. Thanks for pointing out my stupidity... you saved me a bunch of time On May 24, 9:30 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > you need to echo the form->create > > On 5/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, > > I'm new to CakePHP but I have followed the blog tutorial and now > > trying to devlop something on my own using cake 1.2. > > > I have the following template to add a user to the system: > > Add User > > > create('User',array('action'=>'/users/add'))?> > > > > input('User/user_name', array('size' => > > '40'))?> > > error('User/user_name', 'Username is > > required.') ?> > > > > > > input('User/password', array('size'=>'10')) ? > > > error('User/password', 'Password is > > required.') ?> > > > > > > input('User/email', array('size'=>'50')) ?> > > error('User/email', 'eMail is required.') ?> > > > > submit('Save') ?> > > > > end('User')?> > > > I have added Form helper to the users_controller.php file so I don't > > get an error about $form not being recognized. > > When I call the template the form control appear but there is no form > > tag like so: > > Add User > > > > User > > Name > maxlength="255" value="" id="UserUserName" /> > > > > > > for="UserPassword">Password > name="data[User][password]" size="10" value="" id="UserPassword" /> > div> > > > > Email > label> > maxlength="100" value="" id="UserEmail" /> > > > div> > > > Anyone knows what am I doing wrong? > > -- > (the old fart) the advice is free, the lack of crankiness will cost you > > - its a fine line between a real question and an idiot > > http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Invalidating model from another model
I've searched around but can't find any discusson on this... I have a method in the model that is handling a certain function for me. It adds a couple records all linked together, and also allows editing of these records. For the sake of example from the controller I call: $this->PartyParticipant->handleGuest( $name, $email, $rsvp ); and it will do its stuff, interacting with a couple models fine since they're all referenced in the PartyParticipant model (via hasOne, belongsTo, etc). Problem is, I want to invalidate fields of OTHER models within this method. In the model I want to write: $this->UserDetail->invalidate('name') However the controller has a unique UserDetail object from the PartyParticipant object... so it loses that invalidation data. I suppose I can do this from controller: $this->PartyParticipant->controller = &$this; and in the PartyParticipant model: $this->controller->UserDetail->invalidate('name'); but i hate to rely on a reference needing to be passed.. Any ideas? Thoughts? threats? Thanks!! -ryan --~--~-~--~~~---~--~~ 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 upload file with Cake 1.2
I try to insert in the view the instruction that you post, but apparently doesn't work. I can't see the imput for the attachment Andrea On 24 Mag, 18:21, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > in 1.2 I make sure that I declare and open my forms like > > create('Attachment',array('type'=>'file'); ?> > > On 5/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > > Hi to everybody, > > I have a problem to create a page for uploading files. > > My cake version is 1.2.0.4798alpha > > I'm using this component: > >http://cakeforge.org/snippet/detail.php?type=snippet&id=36 > > > In the view file I use: > > > > label('Image.image', 'Immagine');?> > > file('userfile'); ?> > > > > > And in the Controller this: > > if ($this->FileHandler->upload('userfile', > > './img/')) {//per > > localhost > > > But always I recive this error: > > > No file supplied. > > > In the previous stable version of Cake I use the same approach and it > > works well. I don't understand what is the problem... > > > Can anyone helps me? > > > ps. Sorry for my little english > > -- > (the old fart) the advice is free, the lack of crankiness will cost you > > - its a fine line between a real question and an idiot > > http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: multi-page forms
Anyone have a solution for the Back button problem here? I don't think it's right for the state to entirely be based on the session information because the user can get to the recap screen, click the browser back button to the beginning of the wizard, resubmit the first page, and FormWizard will ignore that page and do the final action of the wizard because it thinks the user is still on the recap page. Unless I don't understand something, this isn't a complete solution. On May 5, 7:05 am, CraZyLeGs <[EMAIL PROTECTED]> wrote: > It's a bug in the component: > initWizard has default prefix set to _Wiz > function initWizard(& $ways, $prefix = "_Wiz") > While clearWizard ( and the methods it calls ) has _Wizard. > function clearWizard($prefix = "_Wizard") > function clearStep($prefix = "_Wizard") > function clearData($prefix = "_Wizard") > > Change one of them. > > On May 4, 1:41 pm, halebs <[EMAIL PROTECTED]> wrote: > > > Anyone using theFormWizardcomponent every have trouble with the > > wizard session vars NOT being cleared in the last step? I am doing a > > pr($SESSION) on pages after the form submission and I still see the > > _Wizard array set. I am clearing the related session vars manually by > > using $this->Session->delete(_WizData); in the last step, but not sure > > if that is necessary or a good practice. > > > function recap() > > { > > // Save data to database > > if > > ($this->SurveyPtsd->save($this->FormWizard->getWizardVars())) > > { > > $this->Session->delete(_WizData); > > $this->flash('Thank you for completing the > > survey',"/surveys/"); > > exit(); > > } > > else > > { > > return false; > > } > > } > > > Any assistance would be much appreciated. > > > On Apr 21, 8:04 pm, Chris Lamb <[EMAIL PROTECTED]> wrote: > > > > keymaster wrote: > > > > One has to first do a proper search for the solution. > > > > One does not simply search into Mordor. > > > > -- > > > Chris Lamb, Leamington Spa, UK GPG: 0x634F9A20 > > > > signature.asc > > > 1KDownload --~--~-~--~~~---~--~~ 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: $form->create not producing anything
you need to echo the form->create On 5/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Hi, > I'm new to CakePHP but I have followed the blog tutorial and now > trying to devlop something on my own using cake 1.2. > > I have the following template to add a user to the system: > Add User > > create('User',array('action'=>'/users/add'))?> > > input('User/user_name', array('size' => > '40'))?> > error('User/user_name', 'Username is > required.') ?> > > > input('User/password', array('size'=>'10')) ? > > > error('User/password', 'Password is > required.') ?> > > > input('User/email', array('size'=>'50')) ?> > error('User/email', 'eMail is required.') ?> > > submit('Save') ?> > > end('User')?> > > I have added Form helper to the users_controller.php file so I don't > get an error about $form not being recognized. > When I call the template the form control appear but there is no form > tag like so: > Add User > > User > Name maxlength="255" value="" id="UserUserName" /> > > > for="UserPassword">Password name="data[User][password]" size="10" value="" id="UserPassword" /> div> > > Email label> maxlength="100" value="" id="UserEmail" /> > div> > > Anyone knows what am I doing wrong? > > > > > -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem upload file with Cake 1.2
The type is: enctype="multipart/form-data" Andrea On 24 Mag, 17:56, "John David Anderson (_psychic_)" <[EMAIL PROTECTED]> wrote: > On May 24, 2007, at 9:53 AM, [EMAIL PROTECTED] wrote: > > > > > > > Hi to everybody, > > I have a problem to create a page for uploading files. > > My cake version is 1.2.0.4798alpha > > I'm using this component:http://cakeforge.org/snippet/detail.php? > > type=snippet&id=36 > > > In the view file I use: > > > >label('Image.image', 'Immagine');?> > >file('userfile'); ?> > > > > > And in the Controller this: > >if ($this->FileHandler->upload('userfile', './img/')) > > {//per > > localhost > > > But always I recive this error: > > > No file supplied. > > What is the enctype attribute for the form set as? > > -- 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 -~--~~~~--~~--~--~---
$form->create not producing anything
Hi, I'm new to CakePHP but I have followed the blog tutorial and now trying to devlop something on my own using cake 1.2. I have the following template to add a user to the system: Add User create('User',array('action'=>'/users/add'))?> input('User/user_name', array('size' => '40'))?> error('User/user_name', 'Username is required.') ?> input('User/password', array('size'=>'10')) ? > error('User/password', 'Password is required.') ?> input('User/email', array('size'=>'50')) ?> error('User/email', 'eMail is required.') ?> submit('Save') ?> end('User')?> I have added Form helper to the users_controller.php file so I don't get an error about $form not being recognized. When I call the template the form control appear but there is no form tag like so: Add User User Name Password Email Anyone knows what am I doing wrong? --~--~-~--~~~---~--~~ 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: Yet another question on Routing
Hey Felix, I missed this post earlier. Thats a pretty cool hack. If the modified url schema I am trying out doesn't work for our needs, I'll try out this snippet. Thanks a lot for the input! -Greg On May 24, 9:43 am, Felix Geisendörfer <[EMAIL PROTECTED]> wrote: > Here is a rather hackish snippet that might help you. Put this in your > bootstrap.php: > > > function listControllers($underscored = false) { > uses('Folder'); > $Folder = new Folder(); > > if ($underscored == false) { > $toCtrlName = create_function('$controllerFile', 'return > Inflector::camelize(r("_controller.php", "", $controllerFile));'); > } else { > $toCtrlName = create_function('$controllerFile', 'return > r("_controller.php", "", $controllerFile);'); > } > > $Configure = Configure::getInstance(); > foreach($Configure->controllerPaths as $path) { > $Folder->cd($path); > $controllerFiles = $Folder->find('.+_controller\.php$'); > $controllers = array_map($toCtrlName, $controllerFiles); > } > > return $controllers;} > > > > Then you can use it in your routes.php to get a nice regex strings > matching all your controllers like this: > > > $controllerRegex = '('.join('|', array_map('preg_quote', > listControllers(true))).')'; > > > This should be very useful if you decide to manually map all controllers > by yourself. > > HTH, Felix > --http://www.thinkingphp.orghttp://www.fg-webdesign.de > > John David Anderson (_psychic_) wrote: > > > On May 24, 2007, at 10:19 AM, Greg wrote: > > >>> Can you take a step back and explain why you need the route, and > >>> maybe provide some examples? Maybe we can find a good way to do what > >>> you want. > > >> We need to have a url schema likehttp://domain.com/community/ > >> category/post, > >> so I have defined routes accordingly. These routes work great, except > >> that they completely override cake's default routes. Now, simple > >> commands like requestAction(/controller/action/...) are confused with > >> these routes, rather than using cake's defaults. > > > Would you be amenable to changing the URL format a bit? You just need > > a way to distinguish a community name from a controller name. > > > Something like these might be matchable using regex to avoid > > controller name collisions: > > >http://example.com/c:los_angeles/computers/mac_rulez > >http://example.com/los_angeles:computers/mac_rulez > >http://example.com/c_los_angeles/computers/mac_rulez > > > Just add some little marker in there that regex can pick up and > > recognize as a community name. > > > Its a little hacky, but you could also iterate through your > > controllers directory and grab out the names and add those as > > conditions in the regex. The CONTROLLERS constant is your friend > > there. I think that this approach is less user-friendly, as some sort > > of marker in the URL to denote community names is more user-friendly. > > > -- 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 -~--~~~~--~~--~--~---
session variable problem
hi, I got this problem: i am trying to join 2 applications, but the 2 of them work with different versions of cakephp (1.1...,1.2...), i have defined a session variable with the same name in the 2 aplications, when i try to access this variable from 1.1... to 1.2... it works fine, but when i try to access from 1.2.. to 1.1.. the session variable is re-defined and gets it`s initial value. What could it be the problem?? Here it's a little part of code: if (!$this->Session->valid()) { $this->Session->renew(); } if (!$this->Session->check('USER_LOGIN_KEY')) { $this->Session->write('USER_LOGIN_KEY','anonymous'); } Please help Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help me set up cakephp on godaddy
This .htaccess setup works for me on godaddy. the key is Options +FollowSymLinks in the .htaccess file in your document root: Options +FollowSymLinks RewriteEngine on RewriteRule^$ /app/webroot/[L] RewriteRule(.*) /app/webroot/$1 [L] and webroot/.htaccess looks like this: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] good luck with all that. On May 24, 12:49 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > I have client that I set up with a cake site about a year ago on godaddy but > he changed the access so I can't see how I set it. He is going to send me > the new passwords today, I should be able to try to help you soon > > Sam D > > On 5/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > > css are all linked using $html->css > > > Found out that if I edit webroot's .htaccess from > > > RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] > > to > > RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L] > > > Images and flash will show up, but still controllers are a no-go > > > On May 24, 11:11 am, "John David Anderson (_psychic_)" > > <[EMAIL PROTECTED]> wrote: > > > On May 24, 2007, at 10:04 AM, [EMAIL PROTECTED] wrote: > > > > > John, I already downloaded and installed a brand new copy of cake and > > > > uploaded it. > > > > After that I tried working with internal urls but they worked only if > > > > I typed /site/index.php?controller > > > > That's how internal URLs work. > > > > example.com/index.php?/controller/action > > > > or > > > > example.com/index.php?url=/controller/action > > > > > Btw, im using godaddy's linux hosting with is SUPPOSED to have > > > > mod_rewrite enabled. > > > > Verify that. That seems to be the main issue here, and you'll save a > > > lot of time double checking that rather than assuming it. If it has > > > it, why are you not using it? > > > > > here is the link to the site:http://sportmarketingcenter.com > > > > > so far I've gotten the homepage to render the images and flash file > > > > but thats it (try clicking on one of the menu options) it will just go > > > > back to the start page with no layout defined. > > > > It was my understanding that this was a fresh cake install, but it > > > seems you're running a complete site - which is it? How are you > > > linking to your CSS in the layouts? > > > > -- John > > -- > (the old fart) the advice is free, the lack of crankiness will cost you > > - its a fine line between a real question and an idiot > > http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help me set up cakephp on godaddy
Okay everone good news, got it set up and running. Here's what I did (This applies to godaddy's linux hosting which has rewrite enabled): 1. Added a trailing slash '/' to every rewrite rule located in /.htaccess /app/.htaccess /app/webroot/.htaccess 2. Modified /webroot/index.php ... if (!defined('ROOT')) { //define('ROOT', 'FULL PATH TO DIRECTORY WHERE APP DIRECTORY IS LOCATED DO NOT ADD A TRAILING DIRECTORY SEPARATOR'; //You should also use the DS define to seperate your directories // define('ROOT', dirname(dirname(dirname(__FILE__; define('ROOT', '/home/content/y/o/u/you/html/'); } if (!defined('APP_DIR')) { //define('APP_DIR', 'DIRECTORY NAME OF APPLICATION'; //define('APP_DIR', basename(dirname(dirname(__FILE__; define ('APP_DIR', 'app'); } ... Left line 41 on config/core.php commented (thus disabling internal rewrite) Thats it! everything worked fine right there. Even admin and routing were working right away. Thank you so much for all your help! On May 24, 11:49 am, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > I have client that I set up with a cake site about a year ago on godaddy but > he changed the access so I can't see how I set it. He is going to send me > the new passwords today, I should be able to try to help you soon > > Sam D > > On 5/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > > css are all linked using $html->css > > > Found out that if I edit webroot's .htaccess from > > > RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] > > to > > RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L] > > > Images and flash will show up, but still controllers are a no-go > > > On May 24, 11:11 am, "John David Anderson (_psychic_)" > > <[EMAIL PROTECTED]> wrote: > > > On May 24, 2007, at 10:04 AM, [EMAIL PROTECTED] wrote: > > > > > John, I already downloaded and installed a brand new copy of cake and > > > > uploaded it. > > > > After that I tried working with internal urls but they worked only if > > > > I typed /site/index.php?controller > > > > That's how internal URLs work. > > > > example.com/index.php?/controller/action > > > > or > > > > example.com/index.php?url=/controller/action > > > > > Btw, im using godaddy's linux hosting with is SUPPOSED to have > > > > mod_rewrite enabled. > > > > Verify that. That seems to be the main issue here, and you'll save a > > > lot of time double checking that rather than assuming it. If it has > > > it, why are you not using it? > > > > > here is the link to the site:http://sportmarketingcenter.com > > > > > so far I've gotten the homepage to render the images and flash file > > > > but thats it (try clicking on one of the menu options) it will just go > > > > back to the start page with no layout defined. > > > > It was my understanding that this was a fresh cake install, but it > > > seems you're running a complete site - which is it? How are you > > > linking to your CSS in the layouts? > > > > -- John > > -- > (the old fart) the advice is free, the lack of crankiness will cost you > > - its a fine line between a real question and an idiot > > http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: $html->link return me absolute path NOT relative path ??
I dig in the baseUrl fucntion of dispatcher.php and set base to "" and webroot to "/". All everything look good so far ! baseUrl function is quite compliquate and for me doesn't provide the right results ! Constant On 24 mai, 15:11, macfurax <[EMAIL PROTECTED]> wrote: > Hi, > > I have discovered CakePHP few weeks ago and it was a great > discovering ! > > I make a test drive application on XAMPP on my laptop. Now I want to > test it on my hosting. > So I create a subdomaine pointing to the "webroot" folder of CakePHP. > > http://ministock.constantdupuis.be/nodes/browse(if you want to see > what append) > > And there links to other part of the application are not referencing > relative path but absolute path. > > In the view : > > link($child['Node']['name'], '/nodes/browse/'. > $child['Node']['id']);?> > > On XAMPP test it gives (which works) : > > WebGal > > And on my hosting (of course doesn't works): > > WebGal > > Any idea ? > Did I miss somethings ? > > I'm using version 1.1.14.4797 of cakePHP > > Thanks > > Constant --~--~-~--~~~---~--~~ 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: Stripescape in 1.1.15.5144
Always late... thanks! On May 24, 1:46 pm, "Larry E. Masters aka PhpNut" <[EMAIL PROTECTED]> wrote: > Fixed yesterday in the core: > > https://trac.cakephp.org/changeset/5163 > > -- > /** > * @author Larry E. Masters > * @var string $userName > * @param string $realName > * @returns string aka PhpNut > * @access public > */ --~--~-~--~~~---~--~~ 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: Help me set up cakephp on godaddy
I have client that I set up with a cake site about a year ago on godaddy but he changed the access so I can't see how I set it. He is going to send me the new passwords today, I should be able to try to help you soon Sam D On 5/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > css are all linked using $html->css > > Found out that if I edit webroot's .htaccess from > > RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] > to > RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L] > > Images and flash will show up, but still controllers are a no-go > > On May 24, 11:11 am, "John David Anderson (_psychic_)" > <[EMAIL PROTECTED]> wrote: > > On May 24, 2007, at 10:04 AM, [EMAIL PROTECTED] wrote: > > > > > > > > > John, I already downloaded and installed a brand new copy of cake and > > > uploaded it. > > > After that I tried working with internal urls but they worked only if > > > I typed /site/index.php?controller > > > > That's how internal URLs work. > > > > example.com/index.php?/controller/action > > > > or > > > > example.com/index.php?url=/controller/action > > > > > Btw, im using godaddy's linux hosting with is SUPPOSED to have > > > mod_rewrite enabled. > > > > Verify that. That seems to be the main issue here, and you'll save a > > lot of time double checking that rather than assuming it. If it has > > it, why are you not using it? > > > > > here is the link to the site:http://sportmarketingcenter.com > > > > > so far I've gotten the homepage to render the images and flash file > > > but thats it (try clicking on one of the menu options) it will just go > > > back to the start page with no layout defined. > > > > It was my understanding that this was a fresh cake install, but it > > seems you're running a complete site - which is it? How are you > > linking to your CSS in the layouts? > > > > -- John > > > > > -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Yet another question on Routing
On May 24, 2007, at 10:44 AM, Greg wrote: > > That's not a bad idea--adding a marker to denote a community. I think > I'll end up doing something like this, it seems pretty logical. It > definitely beats adding a route for every controller, that could get > pretty unmanageable in a large-scale application. Actually, I might > just add a leading virtual directory like 'communities/community/ > category/post', that would also work, right? Thanks for sharing your > ideas John. No problem - good luck. -- 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: Stripescape in 1.1.15.5144
Fixed yesterday in the core: https://trac.cakephp.org/changeset/5163 -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ --~--~-~--~~~---~--~~ 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: Yet another question on Routing
That's not a bad idea--adding a marker to denote a community. I think I'll end up doing something like this, it seems pretty logical. It definitely beats adding a route for every controller, that could get pretty unmanageable in a large-scale application. Actually, I might just add a leading virtual directory like 'communities/community/ category/post', that would also work, right? Thanks for sharing your ideas 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: Yet another question on Routing
Here is a rather hackish snippet that might help you. Put this in your bootstrap.php: function listControllers($underscored = false) { uses('Folder'); $Folder = new Folder(); if ($underscored == false) { $toCtrlName = create_function('$controllerFile', 'return Inflector::camelize(r("_controller.php", "", $controllerFile));'); } else { $toCtrlName = create_function('$controllerFile', 'return r("_controller.php", "", $controllerFile);'); } $Configure = Configure::getInstance(); foreach($Configure->controllerPaths as $path) { $Folder->cd($path); $controllerFiles = $Folder->find('.+_controller\.php$'); $controllers = array_map($toCtrlName, $controllerFiles); } return $controllers; } Then you can use it in your routes.php to get a nice regex strings matching all your controllers like this: $controllerRegex = '('.join('|', array_map('preg_quote', listControllers(true))).')'; This should be very useful if you decide to manually map all controllers by yourself. HTH, Felix -- http://www.thinkingphp.org http://www.fg-webdesign.de John David Anderson (_psychic_) wrote: > On May 24, 2007, at 10:19 AM, Greg wrote: > > >>> Can you take a step back and explain why you need the route, and >>> maybe provide some examples? Maybe we can find a good way to do what >>> you want. >>> >> We need to have a url schema like http://domain.com/community/ >> category/post, >> so I have defined routes accordingly. These routes work great, except >> that they completely override cake's default routes. Now, simple >> commands like requestAction(/controller/action/...) are confused with >> these routes, rather than using cake's defaults. >> > > Would you be amenable to changing the URL format a bit? You just need > a way to distinguish a community name from a controller name. > > Something like these might be matchable using regex to avoid > controller name collisions: > > http://example.com/c:los_angeles/computers/mac_rulez > http://example.com/los_angeles:computers/mac_rulez > http://example.com/c_los_angeles/computers/mac_rulez > > Just add some little marker in there that regex can pick up and > recognize as a community name. > > Its a little hacky, but you could also iterate through your > controllers directory and grab out the names and add those as > conditions in the regex. The CONTROLLERS constant is your friend > there. I think that this approach is less user-friendly, as some sort > of marker in the URL to denote community names is more user-friendly. > > -- 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 -~--~~~~--~~--~--~---
Stripescape in 1.1.15.5144
Just update the cake version, and notice some strange behaviour, when i pass number or boolean params in my routes, php throws warnings and notices: Warning: Invalid argument supplied for foreach() in C:\_wwwroot\system \include_path\cake\libs\router.php on line 210 Notice: Undefined variable: return in C:\_wwwroot\system\include_path \cake\libs\router.php on line 219 Looking at router.php i realize that the problem was in stripEscape(), the function is: function stripEscape($param) { if(is_string($param) || empty($param)) { $return = preg_replace('/^ *-!/', '', $param); return $return; } foreach($param as $key => $value) { if(is_string($value)) { $return[$key] = preg_replace('/^ *-!/', '', $value); } else { foreach ($value as $array => $string) { $return[$key][$array] = preg_replace('/^ *-!/', '', $string); } } } return $return; } So, when a number or a boolean is passed, nothing capture it. I never upload a bug to trac, and i dont know if this is really a bug, so i ask it here first. What do you think? Byes, Gonzalo PD: my ugly patch function stripEscape($param) { if(is_string($param) || empty($param)) { $return = preg_replace('/^ *-!/', '', $param); return $return; } if (is_numeric($param)) { return (int) $param; } if (is_bool($param)) { return (bool) $param; } if (is_array($param) && count($param) > 1) { foreach($param as $key => $value) { if(is_string($value)) { $return[$key] = preg_replace('/^ *-!/', '', $value); } else { foreach ($value as $array => $string) { $return[$key][$array] = preg_replace('/^ *-!/', '', $string); } } } return $return; } } --~--~-~--~~~---~--~~ 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: Yet another question on Routing
On May 24, 2007, at 10:19 AM, Greg wrote: > >> Can you take a step back and explain why you need the route, and >> maybe provide some examples? Maybe we can find a good way to do what >> you want. > > > We need to have a url schema like http://domain.com/community/ > category/post, > so I have defined routes accordingly. These routes work great, except > that they completely override cake's default routes. Now, simple > commands like requestAction(/controller/action/...) are confused with > these routes, rather than using cake's defaults. Would you be amenable to changing the URL format a bit? You just need a way to distinguish a community name from a controller name. Something like these might be matchable using regex to avoid controller name collisions: http://example.com/c:los_angeles/computers/mac_rulez http://example.com/los_angeles:computers/mac_rulez http://example.com/c_los_angeles/computers/mac_rulez Just add some little marker in there that regex can pick up and recognize as a community name. Its a little hacky, but you could also iterate through your controllers directory and grab out the names and add those as conditions in the regex. The CONTROLLERS constant is your friend there. I think that this approach is less user-friendly, as some sort of marker in the URL to denote community names is more user-friendly. -- 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: Problem upload file with Cake 1.2
in 1.2 I make sure that I declare and open my forms like create('Attachment',array('type'=>'file'); ?> On 5/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Hi to everybody, > I have a problem to create a page for uploading files. > My cake version is 1.2.0.4798alpha > I'm using this component: > http://cakeforge.org/snippet/detail.php?type=snippet&id=36 > > In the view file I use: > > label('Image.image', 'Immagine');?> > file('userfile'); ?> > > > And in the Controller this: > if ($this->FileHandler->upload('userfile', > './img/')) {//per > localhost > > But always I recive this error: > > No file supplied. > > In the previous stable version of Cake I use the same approach and it > works well. I don't understand what is the problem... > > Can anyone helps me? > > ps. Sorry for my little english > > > > > -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Yet another question on Routing
> Can you take a step back and explain why you need the route, and > maybe provide some examples? Maybe we can find a good way to do what > you want. We need to have a url schema like http://domain.com/community/category/post, so I have defined routes accordingly. These routes work great, except that they completely override cake's default routes. Now, simple commands like requestAction(/controller/action/...) are confused with these routes, rather than using cake's defaults. For instance, when I run http://domain.com/my_community/computers/mac-vs-pc, I want to access PostsController::read('mac-vs-pc'). However, if I want to access some other action directly, like PostsController::get_thread($id), or something like this, I'd like to be able to use the standard requestAction('/posts/get_thread/id'). But, my routes convince cake that I am trying to access a community called 'posts', category called 'get_thread' and post called 'id'. So, unless I define Router::connect('/posts/:action/*'...), likewise for all my other controllers and actions, before I define my custom routes, I cannot use requestAction properly. So I guess I am asking if there might be a generic route that knows to look for a controller match rather than having to define one for each controller in my app. thanks for the help, Greg --~--~-~--~~~---~--~~ 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: Help me set up cakephp on godaddy
css are all linked using $html->css Found out that if I edit webroot's .htaccess from RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] to RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L] Images and flash will show up, but still controllers are a no-go On May 24, 11:11 am, "John David Anderson (_psychic_)" <[EMAIL PROTECTED]> wrote: > On May 24, 2007, at 10:04 AM, [EMAIL PROTECTED] wrote: > > > > > John, I already downloaded and installed a brand new copy of cake and > > uploaded it. > > After that I tried working with internal urls but they worked only if > > I typed /site/index.php?controller > > That's how internal URLs work. > > example.com/index.php?/controller/action > > or > > example.com/index.php?url=/controller/action > > > Btw, im using godaddy's linux hosting with is SUPPOSED to have > > mod_rewrite enabled. > > Verify that. That seems to be the main issue here, and you'll save a > lot of time double checking that rather than assuming it. If it has > it, why are you not using it? > > > here is the link to the site:http://sportmarketingcenter.com > > > so far I've gotten the homepage to render the images and flash file > > but thats it (try clicking on one of the menu options) it will just go > > back to the start page with no layout defined. > > It was my understanding that this was a fresh cake install, but it > seems you're running a complete site - which is it? How are you > linking to your CSS in the layouts? > > -- 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: Help me set up cakephp on godaddy
On May 24, 2007, at 10:04 AM, [EMAIL PROTECTED] wrote: > > John, I already downloaded and installed a brand new copy of cake and > uploaded it. > After that I tried working with internal urls but they worked only if > I typed /site/index.php?controller That's how internal URLs work. example.com/index.php?/controller/action or example.com/index.php?url=/controller/action > Btw, im using godaddy's linux hosting with is SUPPOSED to have > mod_rewrite enabled. Verify that. That seems to be the main issue here, and you'll save a lot of time double checking that rather than assuming it. If it has it, why are you not using it? > here is the link to the site: http://sportmarketingcenter.com > > so far I've gotten the homepage to render the images and flash file > but thats it (try clicking on one of the menu options) it will just go > back to the start page with no layout defined. It was my understanding that this was a fresh cake install, but it seems you're running a complete site - which is it? How are you linking to your CSS in the layouts? -- 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: Changing datasources to support web services.
instead of doing: $this->setDataSource('whatever'); you can do that: class MyModel extends AppModel { $useDbConfig = 'whatever'; //... } On 24 mai, 17:37, shmit <[EMAIL PROTECTED]> wrote: > Because I like to answer my own questions, I found the solution to > this. > > Here's how you set up the map for your new service: > > name your file 'app/models/datasources/type_source.php' (e.g., > 'web_services_source.php') > your class name will be the StudlyCaps version of that (e.g., > 'WebServicesSource'), defined in the above file. > > Set up a map for that datasource to a name in database.php's > DATABASE_CONFIG class: > > var $whatever = array('datasource' => 'type'); (e.g.: var > $web_services => array('datasource' => 'web_services')) > > The datasource value is the name of your datasource file w/o the > '_source.php' at the end. The name of the variable ($web_services), > can be whatever you want. > > In your model, tell it to use your new data source. I did this in the > constructor with: > > $this->setDataSource('whatever'); > > Where 'whatever' is the name of your variable in the DATABASE_CONFIG > class. > > I'm probably doing that last part wrong, but it seems to work for me. > > On May 24, 11:01 am, shmit <[EMAIL PROTECTED]> wrote:> On May 23, 7:44 pm, > gwoo <[EMAIL PROTECTED]> wrote: > > > > then create a connection in database.php that can be used. > > > you could use the xml class to get the web service. > > > This is the part I'm missing. I can't for the life of me figure out > > how to get the data source loaded. The docs turn up nothing. Google > > turns up nothing, and I can't pick apart the source enough (yet) to > > figure out how to load it. > > > The only thing I've found was this comment: > > > * @param string $name The name of the DataSource, as defined in > > app/ > > config/connections > > > Of course, the file doesn't exist, and I can't even tell if its > > getting loaded at all, nor what format it's supposed to be in. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help me set up cakephp on godaddy
John, I already downloaded and installed a brand new copy of cake and uploaded it. After that I tried working with internal urls but they worked only if I typed /site/index.php?controller Btw, im using godaddy's linux hosting with is SUPPOSED to have mod_rewrite enabled. here is the link to the site: http://sportmarketingcenter.com so far I've gotten the homepage to render the images and flash file but thats it (try clicking on one of the menu options) it will just go back to the start page with no layout defined. On May 24, 10:50 am, "John David Anderson (_psychic_)" <[EMAIL PROTECTED]> wrote: > On May 24, 2007, at 9:42 AM, [EMAIL PROTECTED] wrote: > > > > > Still have not been able to shed some light on this. > > > Ive tried: > > > - enabling internal rewrite and deleting all .htaccess files (only > > homepage will show, links dont work) > > - putting back all .htaccess files and disabling internal rewrite (no > > good, only text shows) > > - manually setting the ROOT and APP_DIR in webroot's index.php (no > > good either) > > And what happened? > > If you can't get mod_rewrite to go at all, I'd start off with a brand > new copy of CakePHP, and try enabling Cake's internal pretty URLs > (remove .htaccess and uncomment core.php line 41). > > -- 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: Yet another question on Routing
On May 24, 2007, at 9:55 AM, Greg wrote: > > John, > > Thanks for the quick response. About the regex, that happens to be > required by our system, which means I am probably going to have to > define a route for every controller before I define my /:comunity and > other custom routes. Oh well, thought I'd ask... > > Maybe I could write a function that checks the existing controllers in > my app, that way I wouldn't have to add a route every time I add a > controller, not that I would really be adding that many controllers, > if any at all. Just trying to figure out a decent pragmatic approach > to the OOP thing... Can you take a step back and explain why you need the route, and maybe provide some examples? Maybe we can find a good way to do what you want. -- 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: Problem upload file with Cake 1.2
On May 24, 2007, at 9:53 AM, [EMAIL PROTECTED] wrote: > > Hi to everybody, > I have a problem to create a page for uploading files. > My cake version is 1.2.0.4798alpha > I'm using this component: http://cakeforge.org/snippet/detail.php? > type=snippet&id=36 > > In the view file I use: > > label('Image.image', 'Immagine');?> > file('userfile'); ?> > > > And in the Controller this: > if ($this->FileHandler->upload('userfile', './img/')) > {//per > localhost > > But always I recive this error: > > No file supplied. What is the enctype attribute for the form set as? -- 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: Yet another question on Routing
John, Thanks for the quick response. About the regex, that happens to be required by our system, which means I am probably going to have to define a route for every controller before I define my /:comunity and other custom routes. Oh well, thought I'd ask... Maybe I could write a function that checks the existing controllers in my app, that way I wouldn't have to add a route every time I add a controller, not that I would really be adding that many controllers, if any at all. Just trying to figure out a decent pragmatic approach to the OOP thing... --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Problem upload file with Cake 1.2
Hi to everybody, I have a problem to create a page for uploading files. My cake version is 1.2.0.4798alpha I'm using this component: http://cakeforge.org/snippet/detail.php?type=snippet&id=36 In the view file I use: label('Image.image', 'Immagine');?> file('userfile'); ?> And in the Controller this: if ($this->FileHandler->upload('userfile', './img/')) {//per localhost But always I recive this error: No file supplied. In the previous stable version of Cake I use the same approach and it works well. I don't understand what is the problem... Can anyone helps me? ps. Sorry for my little english --~--~-~--~~~---~--~~ 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: Help me set up cakephp on godaddy
On May 24, 2007, at 9:42 AM, [EMAIL PROTECTED] wrote: > > Still have not been able to shed some light on this. > > Ive tried: > > - enabling internal rewrite and deleting all .htaccess files (only > homepage will show, links dont work) > - putting back all .htaccess files and disabling internal rewrite (no > good, only text shows) > - manually setting the ROOT and APP_DIR in webroot's index.php (no > good either) And what happened? If you can't get mod_rewrite to go at all, I'd start off with a brand new copy of CakePHP, and try enabling Cake's internal pretty URLs (remove .htaccess and uncomment core.php line 41). -- 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: Yet another question on Routing
On May 24, 2007, at 9:27 AM, Greg wrote: > > CakePHP version > > I'm sorry to bring up routing again, it seems to be covered a lot, but > I am not sure if I am doing this quite right... > > First of all, I have a route: > Router::connect('/:community', array('controller' => 'communities', > 'action' => 'index'), array('community' => '[a-zA-Z0-9_\-]+')); > > Now, when I try to access my posts controller via requestAction('/ > posts/index'), it routes to '/communities/index', with 'posts' as the > community name. Does this mean I have to define a route for every > controller in my app before I define my custom routes if I want to > access my controllers? Or refine your regex. Essentially the route above tells the router to hand any alphanumeric (plus _\-]+) string as a param named community to CommunitiesController->index(). Since "posts" fits your supplied regex, it hands it to the CommunitiesController. Make it more specific, or define some sort of naming convention in URLs so the router knows when a community is being passed rather than a name to a controller. -- 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: Help me set up cakephp on godaddy
Still have not been able to shed some light on this. Ive tried: - enabling internal rewrite and deleting all .htaccess files (only homepage will show, links dont work) - putting back all .htaccess files and disabling internal rewrite (no good, only text shows) - manually setting the ROOT and APP_DIR in webroot's index.php (no good either) I would really appreciate some help here guys --~--~-~--~~~---~--~~ 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: Yet another question on Routing
oops, forgot to complete the 'CakePHP version' line. I am using 1.2.0.5137alpha On May 24, 8:27 am, Greg <[EMAIL PROTECTED]> wrote: > CakePHP version > > I'm sorry to bring up routing again, it seems to be covered a lot, but > I am not sure if I am doing this quite right... > > First of all, I have a route: > Router::connect('/:community', array('controller' => 'communities', > 'action' => 'index'), array('community' => '[a-zA-Z0-9_\-]+')); > > Now, when I try to access my posts controller via requestAction('/ > posts/index'), it routes to '/communities/index', with 'posts' as the > community name. Does this mean I have to define a route for every > controller in my app before I define my custom routes if I want to > access my controllers? > > It worked when I added Router::connect('/posts/:action/*' .. > before my custom route, but I feel like there must be a more efficient > way of getting around this issue. If anyone could help out, I would > be grateful. > > Thanks in advance, > Greg --~--~-~--~~~---~--~~ 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: Changing datasources to support web services.
Because I like to answer my own questions, I found the solution to this. Here's how you set up the map for your new service: name your file 'app/models/datasources/type_source.php' (e.g., 'web_services_source.php') your class name will be the StudlyCaps version of that (e.g., 'WebServicesSource'), defined in the above file. Set up a map for that datasource to a name in database.php's DATABASE_CONFIG class: var $whatever = array('datasource' => 'type'); (e.g.: var $web_services => array('datasource' => 'web_services')) The datasource value is the name of your datasource file w/o the '_source.php' at the end. The name of the variable ($web_services), can be whatever you want. In your model, tell it to use your new data source. I did this in the constructor with: $this->setDataSource('whatever'); Where 'whatever' is the name of your variable in the DATABASE_CONFIG class. I'm probably doing that last part wrong, but it seems to work for me. On May 24, 11:01 am, shmit <[EMAIL PROTECTED]> wrote: > On May 23, 7:44 pm, gwoo <[EMAIL PROTECTED]> wrote: > > > then create a connection in database.php that can be used. > > you could use the xml class to get the web service. > > This is the part I'm missing. I can't for the life of me figure out > how to get the data source loaded. The docs turn up nothing. Google > turns up nothing, and I can't pick apart the source enough (yet) to > figure out how to load it. > > The only thing I've found was this comment: > > * @param string $name The name of the DataSource, as defined in app/ > config/connections > > Of course, the file doesn't exist, and I can't even tell if its > getting loaded at all, nor what format it's supposed to be in. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
problemns with search on models
hello, im having problems with search on models i have models user, module_user and module im trying made one unique search with cake for return the result. I have theses datas for compate user.login user.password module.id anyone know how made one unique search with theses datas? i only made it using findBySql. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Yet another question on Routing
CakePHP version I'm sorry to bring up routing again, it seems to be covered a lot, but I am not sure if I am doing this quite right... First of all, I have a route: Router::connect('/:community', array('controller' => 'communities', 'action' => 'index'), array('community' => '[a-zA-Z0-9_\-]+')); Now, when I try to access my posts controller via requestAction('/ posts/index'), it routes to '/communities/index', with 'posts' as the community name. Does this mean I have to define a route for every controller in my app before I define my custom routes if I want to access my controllers? It worked when I added Router::connect('/posts/:action/*' .. before my custom route, but I feel like there must be a more efficient way of getting around this issue. If anyone could help out, I would be grateful. Thanks in advance, Greg --~--~-~--~~~---~--~~ 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: Changing datasources to support web services.
On May 23, 7:44 pm, gwoo <[EMAIL PROTECTED]> wrote: > then create a connection in database.php that can be used. > you could use the xml class to get the web service. This is the part I'm missing. I can't for the life of me figure out how to get the data source loaded. The docs turn up nothing. Google turns up nothing, and I can't pick apart the source enough (yet) to figure out how to load it. The only thing I've found was this comment: * @param string $name The name of the DataSource, as defined in app/ config/connections Of course, the file doesn't exist, and I can't even tell if its getting loaded at all, nor what format it's supposed to be in. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
1.2 - Paginating data other than Model records
Hi, Is there any way to paginate data other than Model records using the Paginator helper? For instance, I want to paginate an array, not the actual Model records. Something like: Pseudo Code * var $paginate = array('limit' => 3); $fruit = Array('apples','oranges','pears','prunes'); $this->set('results', $this->Paginate($fruit)); End Pseudo Code * Regards, Graham --~--~-~--~~~---~--~~ 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: multiple fields in $displayField.
On May 24, 12:31 am, Ruud Gâst <[EMAIL PROTECTED]> wrote: > Hello there, > > I've been trying to fill a SELECT-tag by using the generateList > function, this works great! Although I want to fill it with multiple > fields from the table, eg. firstname . ' ' . lastname. How can I pull > this off? > > Greets Ruud http://groups.google.com/group/cake-php/search?group=cake-php&q=generateList+multiple+field --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
GET-like request sent as POST returns a 404 when debug == 0 ?
Hi All, I've noticed this behaviour only when debug = 0 (ie. production mode). I had an Ajax call that worked fine in dev but failed in production. After lots of troubleshooting, I looked at the Apache logs and noticed that when sending via POST, it would send a 404. When the EXACT same request got changed from POST to GET, it worked fine. I have other methods that get submitted to via POST and they work fine. I also tried removing the $argument in the action definition and setting the URL it submits to to /path/to/submit instead of /path/to/submit/ to determine if CakePHP is simply checking if the GET-like request contains an argument and blocks it if so, but it kept giving me a 404 ! So my question is, is CakePHP doing this as a security measure? Thanks in advance. Regards, Gonzalo --~--~-~--~~~---~--~~ 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: Complex SQL Conditions (multiple ORs)
On May 23, 9:57 pm, squidliberty <[EMAIL PROTECTED]> wrote: > Looking it over, I think my question may boil down to this: how can I > set conditions that specify "X is not between A and B"? Erm, as you would expect probably. $conditions['NOT']['Model.field'] = "BETWEEN $A AND $B" hth, AD PS There are a number of solutions if you wanted to use the same array structure as your original message -and they have all been mentioned in the group before. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Is 1.2.0.5146alpha Usable?
...for the SQL errors you should set debug to 3 and check the sql queries. You will probably find the error if you are familiar with queries =) The 1.2.0.5146alpha is working fine, and it's a great tool when you get the hang of it! --~--~-~--~~~---~--~~ 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: I starting new which version to go with?
I would say go for the latest CakePHP 1.2.x.x version! CakePHP 1.1.x.x surely has more examples and documentation, but when 1.2.x.x get's stable 1.1 will slowly get outdated. I'm currently rewriting a fairly large application from 1.1 to 1.2, and it requires a lot of changes before it's fully 1.2 compatible. A lot of 1.1 functions has been deprecated! My advice is go for 1.2.x.x, get used to the new way of using model behaviors and all the features 1.2 has to offer. --~--~-~--~~~---~--~~ 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: Ajax + CakePHP + Tree Menu (Ver Urgent)
On 5/24/07, Vishal <[EMAIL PROTECTED]> wrote: > Is there any website/document which expains Ajax and CakePHP step by > step... Go to http://bakery.cakephp.org and search for 'ajax' there. Lots of examples. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
$html->link return me absolute path NOT relative path ??
Hi, I have discovered CakePHP few weeks ago and it was a great discovering ! I make a test drive application on XAMPP on my laptop. Now I want to test it on my hosting. So I create a subdomaine pointing to the "webroot" folder of CakePHP. http://ministock.constantdupuis.be/nodes/browse (if you want to see what append) And there links to other part of the application are not referencing relative path but absolute path. In the view : link($child['Node']['name'], '/nodes/browse/'. $child['Node']['id']);?> On XAMPP test it gives (which works) : WebGal And on my hosting (of course doesn't works): WebGal Any idea ? Did I miss somethings ? I'm using version 1.1.14.4797 of cakePHP Thanks Constant --~--~-~--~~~---~--~~ 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: I starting new which version to go with?
Ketan, I started with CakePHP recently and faced the same question. I chose to go with 1.2 at the recommendation of some of the people on the group. My experience was good, but I spent a lot of time early-on just figuring cake out. Searching and asking the group helped a lot, though sometimes I got rather tripped up as the thread I found that answered my question perfectly was about 1.1 where something minor had changed in 1.2 to throw me off. I eventually found the 1.2 source code (and web-based API) to be the best resource -- but this isn't necessarily something that will suffice for every programmer. As a cake newbie myself, I would recommend reading the manual IN ITS ENTIRETY, follow the blog tutorial to write your own sample app (it really doesn't take that long) and play with the code a little to learn where you'll want to put your own code in your project. Then, if you feel comfortable wading through source code and API documentation, 1.2 has some nice stuff. In my experience so far, I have not been the victim of an unstable alpha release, and we are currently using 1.2.0.5146alpha in production. On the other hand, if you don't know if you have the patience and wherewithal to learn the framework from the source up, I'd recommend using 1.1 as it DOES have better documentation and discussion history (searchable!). I starting become very productive with Cake once I finally had a clear picture of what all the parts did, how they interacted, and I finally accepted that Cake does a LOT automagically for you (person -> people -- didn't see that one coming!). Ketan Patel wrote: > I am fairly comfortable with PHP. I had a look at CakePHP 1.1.x.x > version and CakePHP 1.2.x.x version. There are significant changes > between these two versions. > > My question is CakePHP 1.1.x.x has been around for a while and has > lots of codes and samples and articles that can help a new comer like > me to settle down quickly. Whereas with 1.2.x.x its not the case, the > only documentation it has is API document. > > Questions: > 1. As a newbie, which version should I start with? > 2. In case, if I start with 1.1.x.x then is the code portable to > 1.2.x.x with no or minimal changes to code? > > Thanks, > Ketan > > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
I starting new which version to go with?
I am fairly comfortable with PHP. I had a look at CakePHP 1.1.x.x version and CakePHP 1.2.x.x version. There are significant changes between these two versions. My question is CakePHP 1.1.x.x has been around for a while and has lots of codes and samples and articles that can help a new comer like me to settle down quickly. Whereas with 1.2.x.x its not the case, the only documentation it has is API document. Questions: 1. As a newbie, which version should I start with? 2. In case, if I start with 1.1.x.x then is the code portable to 1.2.x.x with no or minimal changes to code? Thanks, Ketan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Using CakePHP via a subdomain
Hi, I have discovered CakePHP few weeks ago and it was a great discovering ! I make a test drive application on XAMPP on my laptop. Now I want to test it on my hosting. So I create a subdomaine pointing to the "webroot" folder of CakePHP. http://ministock.constantdupuis.be/nodes/browse (if you want to see what append) And there links to other part of the application are not referencing relative path but absolute path. In the view : link($child['Node']['name'], '/nodes/browse/'. $child['Node']['id']);?> On XAMPP test it gives (which works) : WebGal And on my hosting (of course doesn't works): WebGal Any idea ? Did I miss somethings ? I'm using version 1.1.14.4797 of cakePHP Thanks Constant --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
othAuth error otice: Only variables should be assigned by reference
Hi All, I am implementing the othAuth component in a new project for which I quickly drafted a demoversion using scaffolding (I love cake for it). When I tested it on my two development servers all was fine, but putting it on the server of the client the app broke with the above error in the component of othAuth. It is line 301: $UserModel =& $this->_createModel(); I read it is a php 4 bug. Unfortunately I could not get the server to be updated very soon. Does anybody know of a quick and dirty workaround by any chance? For the time being? Thanks, Paul --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Mock "non cakey" objects, how to?
Has anyoby ever mocked classes with cake 1.1 test suite and can me give a hint how to do it? I want to mock a class that is neither a controller nor a model or any other cakey object, it just should simulate a single function that returns an array (to simulate access to the file system). I have done the following in my TestCase: When I run the test case, I get the error "Bad GroupTest [...import.test.php] with error [Non-static method Mock::generate() should not be called statically, assuming $this from incompatible context]" --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
get parameters error
Hi need help on this get method, on my localhost its working fine but on the my server its not seeing my get parameters Example: account/test?type=1 printing the $this->param would output Array ( [pass] => Array ( ) [controller] => accounts [action] => test [url] => Array ( [url] => accounts/test ) [bare] => 0 [webservices] => [plugin] => ) instead of Array ( [pass] => Array ( ) [controller] => accounts [action] => test [url] => Array ( [url] => accounts/test [type] => 1 ) [bare] => 0 [webservices] => [plugin] =>) My server is hostmonster, my .htaccess is like this RewriteEngine on RewriteRule ^js/(.*\.js) combine.php?type=js&files=$1 [L] RewriteRule ^sitecss/(.*\.css) combine.php?type=css&files=$1 [L] RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] How can i fix this problem? Tnx in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Changes to SecurityComponent - every form I submit gets blackholed
Hey Larry, It was more that I developed the site with 1.2 while it was still changing a lot so I decided to keep the forms "pure". I will have a look at converting them to helper calls and see how well it works with what I have already. One comment though is that you really should make the message more pronounced (at least on debug mode) as the form would just stop working and give back a totally blank screen, I had to set up a whole XDebug session just to step through the application to see that the actual post back was being blackholed. The result I was getting was a blank page with the database trace, and even if I put statements like die('here') in my action, it would never hit it so I was getting pretty confused for a while ;) Loving 1.2 though, and I can't wait for it to become stable. Cheers, Mladen (Mika) On May 23, 4:20 pm, "Larry E. Masters aka PhpNut" <[EMAIL PROTECTED]> wrote: > Mika, > > If you are using hand-written forms you will need to follow the example > here:https://trac.cakephp.org/changeset/4978to remove any fields that are > added by hand. > > Note when the security component is used you should still use the > $form->create(); and the $form->submit(); if not your forms will not have > the expected hidden fields and will be considered invalid anyway. > > Do you really like writing all the forms yourself or is there another reason > you are not using the helper? > > -- > /** > * @author Larry E. Masters > * @var string $userName > * @param string $realName > * @returns string aka PhpNut > * @access public > */ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---