Re: Models in default.thtml
I am a bit confused with the "model in default.thtml" and the question. Models are not available in views, you would need the controller to access your model and pass the data to the view. On Jul 3, 6:58 pm, Brian <[EMAIL PROTECTED]> wrote: > I feel like this is a very small thing I'm missing, but I haven't yet > found a solution. > > So my problem is that I want to have a dynamic menu displayed on every > page, based on visible instances of one of my models. However, when I > try to do something like this: > > Menu->findAll(null, null, $order = "root DESC") > as $menu): ?> > > I get the "call to a member function on a non-object" error. I've told > my AppController that it's supposed to use the Menu model (var > $uses...) but that's not working. > > Any advice? Thanks much again. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How can I get the version of cakephp used in my project?
Configure::version() On Jul 4, 7:48 am, hi and hello <[EMAIL PROTECTED]> wrote: >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: 1.2 Pagination SQL Injection
On Jul 3, 7:46 pm, "Larry E. Masters aka PhpNut" <[EMAIL PROTECTED]> wrote: > On 7/3/07, R. Rajesh Jeba Anbiah <[EMAIL PROTECTED]> wrote: > >FWIW, Sanitize::clean() is broken (the trim logic is totally > > breaking) leaving possibility for SQL errors. Sanitization is also not > > promoted in the community nor in source, IM*H*O. > > Sanitize::clean() is not needed if you follow the correct conventions of the > framework. All sql in escaped at the dbo level when using these conventions. I'm sorry, I meant Sanitize::escape() -- Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How can I get the version of cakephp used in my project?
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: Sending an php array to javascript part 2
On 7/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > hi everybody. Thanks for all help you have giving for me. I have a doubt > that is simple for anyone that know javascript, but I'm learning yet. > I send an array to javascript using $javascripy->codeblock and javascript > is receiving an array formating like: > var time = new Array[1,2,3]; > > Is that correct ? It shouldn't be : > var time = new Array(1,2,3); > > If I'm wrong is there any cakephp function or I need to use str_replace ? did you take a look at the $javascript->object() takes a php array or object and returns JSON HTH T -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Sending an php array to javascript part 2
hi everybody. Thanks for all help you have giving for me. I have a doubt that is simple for anyone that know javascript, but I'm learning yet. I send an array to javascript using $javascripy->codeblock and javascript is receiving an array formating like: var time = new Array[1,2,3]; Is that correct ? It shouldn't be : var time = new Array(1,2,3); If I'm wrong is there any cakephp function or I need to use str_replace ? Thanks, Alexandre. --~--~-~--~~~---~--~~ 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: Why dispatcher return a blank page?
I can't access my sf shell account at all so I can't try out your tips. That's very help tip! Thanks very much! On Jul 3, 1:19 pm, AD7six <[EMAIL PROTECTED]> wrote: > On Jul 3, 9:34 pm, "chanh.ong" <[EMAIL PROTECTED]> wrote: > > > I did you you suggest. > > > . Copy my cake 1.1 to caketest. > > . copy .htacess and edit the rewritebase to caketest > > . Test it to make sure it still work and it does > > . Then rename cake to cakecore11 > > . Copy cake core 1.2 to caketest and all I got is a blank page just > > like before. > > > I just wondering what was changed in dispatcher.php for Cake 1.2 so I > > can have a starting point to attempt to look. > > echo ""; > print_r($aVariable); // Anything in the code you want to see the value > of > print_r('Made it to:' .__FILE__.':'.__LINE__); die; > > paste that as the first line of your index.php file. If you don't see > anything then the problem isn't cake. If you see your debug message > copy and paste moving forwards in the same file until you don't see it > anymore. when you see nothing go into the method you just stepped over > pasting at the beginning. etc. until you see something you can fix. > > hth, > > AD --~--~-~--~~~---~--~~ 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 need help with Set::extract
The following is my array structure: Array ( [0] => Array ( [0] => Array ( [TagCount] => 5 ) [TagsPost] => Array ( [TagId] => 1 ) [Tag] => Array ( [TagName] => personal ) ) [1] => Array ( [0] => Array ( [TagCount] => 3 ) [TagsPost] => Array ( [TagId] => 3 ) [Tag] => Array ( [TagName] => general ) ) ) which I want to organize as follows array ( [0] => Array( [TagCount]=>5, [TagId] =>1, [TagName] => personal ) [1] => Array( [TagCount]=>3, [TagId] =>3, [TagName] => general ) ) Using set I am able to extract tagcount, tagId and tagName separately in individual array, but is there a way directly that could give me what I want without coding manual loop. Cheers, 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 -~--~~~~--~~--~--~---
Re: Going nuts on components
Here is the Bakery's implementation as a helper :- https://cakeforge.org/plugins/scmsvn/viewcvs.php/trunk/bakery/views/helpers/bbcode.php?rev=564&root=bakery&view=markup Basically in the view you call $bbcode->format($this->data['ModelName'] ['bbcode']); Geoff -- http://lemoncake.wordpress.com On Jul 4, 11:30 am, DrLaban <[EMAIL PROTECTED]> wrote: > Hey all and thank you for reading this post! > > I'm a newbie on cakePHP but it's a really fascinating project and > slowly I'm getting the hang of things. It might be that I'm going a > bit too fast and get a bit ahead of myself, but really, I can't see > why I have such problems with components. I'm trying to wrap my head > around some other minor things, I'll mention them below. > > Short: > This is for a guestbook I've done. I need to interpret bbCode inside > each users message and translate those into proper html. > I can't really get the grips on what's needed for it to work, perhaps > I'm looking in the wrong direction, but a component seems appropriate. > > Longer: > I've tried creating a component using the guide on cakePHP.org. Now, > everything works after doing some extensive search on google and > whatnot. I have problems in the Model/Controller/Component-block. If I > add a file ("Guestbook.php") in the components folder, along with the > code snippets from cakePHP.org I get a fatal error on MySQL telling me > that 'startup' isn't a valid query. Someone in a newsgroup post > mentioned that this could be due to the fact that I haven't defined > the functions in the model. So, I added them there and everything is > fins so far. But no matter what I add to the component file, I get > errors until I add them to the model too. This makes the component > file obsolete, since the functions become duplicated. > What am I missing here? > > Short 2: > How do I access instance variables or variables in general? There > aren't getters in cake as far as I've gathered and I find it tricky to > figure out how to get to a specific piece of data within a variable in > a class. I'm sure there's an easy way to read data from variables, but > I just haven't found it. > > Thanks for your time, I hope I didn't mess everything up with my > descriptions! > > Regards > DrLaban --~--~-~--~~~---~--~~ 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: DB Schema Help
What about a field in the images table that is used for ordering and then use 'Images.order_field' as the 3rd parameter in your findAll() Geoff -- http://lemoncake.wordpress.com On Jul 4, 11:14 am, McFadly <[EMAIL PROTECTED]> wrote: > Hello Bakers - > > I have a situation where I can't agree on the best database schema / > logic for my project. > > Here's a simplified version of my project: > > table: Homes > table: Images > > Each Home will have zero to many Images. Some Images will be "stock" > images that can be used by many Homes. Each group of Images > associated with a Home will be in a user defined and changeable > order. > > Homes HABTM Images would provide the ability to associate images to > homes, but how do I keep them in a specific and changeable order? > > My initial thought is a table: galleries, which has a serialized list > of image_ids, in a particular order. Is this my best bet, or am I > overlooking a possibility? > > Your thoughts and direction, please. > Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using jquery's Ajax functions in tandem with CakePHP...
You need an ajax view for the action that either prints out just the snippet of html ( HIJAX or AJAH method ) and renders that by itself without a layout. Or.. You can return a javascript array in your view. ( JSON method ) Or.. You can return a well formed XML document ( AJAX method ) with an xml layout that sets the content type headers correctly for you. With the first one the $( "selector" ).html( returnedHtml ) will put the markup into the the element selector ( usually a container div ) With the second two you need to parse and transform the JSON or XML into html using jquery ( or even better, any one of the jquery dom creation tools on the jquery plugins page ) and insert the content into the document. Usually this would happen in one of jquery's ajax method callbacks. There are a few good tutorials on the jquery tutorial page. If the appended elements need to have even handler applied to them you can do so in the callbacks as well. There is an excellent tutorial linked from the jquery site named something along the lines of "Correctly using callbacks" or some such listed under the Ajax heading that explains this very well. Good luck. On Jul 3, 7:26 am, Jim Newfer <[EMAIL PROTECTED]> wrote: > Gremlin, thank you so much for your reply! So far it isn't working but > in the top of my javascript I have arequestAction, and in my > controller I set something like this > > if(isset($this->params['requested'])) { > return array('stories' => $getstories, 'school' => > $schoolname); > > That is all I should need to do to have jquery be able to access my > models right ? > > Thanks for any more advice from anyone. > > On Jul 2, 10:24 pm, gremlin <[EMAIL PROTECTED]> wrote: > > > You can call a script the same way, just use $( "#quote p" ).load( "/ > > contoller/action" ); > > > Make sure your controller handlesajaxrequests. If you don't know > > what that means look uprequestActionor parseExtensions in the > > groups. > > > On Jul 2, 10:12 pm, Jim Newfer <[EMAIL PROTECTED]> wrote: > > > > I have been usingjquery, which is great btw, with cakephp for a > > > couple of weeks now. I love it to say the least. I haven't really > > > dealt withajaxvery much, but I have done some basic things with it, > > > and PHP outside of cake. Needless to say, when it comes time to use > > >jquery'sajaxfunctionality with cake, I am completely and totally > > > lost. > > > > I trying to get this EXTREMELY simple tutorial to work with cakephp > > > for about the past 3 hours, and just cannot seem to figure it out. > > > >http://www.sitepoint.com/article/ajax-jquery > > > > I think it make have something to do with this line injquery, where > > > it calls for an outside script. > > > > $("#quote p").load("script.php"); > > > > I was wondering is there some way to instead, call upon a specific > > > controller? Or passjqueryinformation? > > > > Obviously I do not want to include a separate script because that > > > would be an unnecessary hassle. I am just looking for pointers/tips on > > > how to useajax'sfunctionality with cake, because I cannot seem to > > > find any good tutorials anywhere on incorporatingjqueryinto cake. > > > > Any guidance is GREATLY appreciated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Going nuts on components
Hey all and thank you for reading this post! I'm a newbie on cakePHP but it's a really fascinating project and slowly I'm getting the hang of things. It might be that I'm going a bit too fast and get a bit ahead of myself, but really, I can't see why I have such problems with components. I'm trying to wrap my head around some other minor things, I'll mention them below. Short: This is for a guestbook I've done. I need to interpret bbCode inside each users message and translate those into proper html. I can't really get the grips on what's needed for it to work, perhaps I'm looking in the wrong direction, but a component seems appropriate. Longer: I've tried creating a component using the guide on cakePHP.org. Now, everything works after doing some extensive search on google and whatnot. I have problems in the Model/Controller/Component-block. If I add a file ("Guestbook.php") in the components folder, along with the code snippets from cakePHP.org I get a fatal error on MySQL telling me that 'startup' isn't a valid query. Someone in a newsgroup post mentioned that this could be due to the fact that I haven't defined the functions in the model. So, I added them there and everything is fins so far. But no matter what I add to the component file, I get errors until I add them to the model too. This makes the component file obsolete, since the functions become duplicated. What am I missing here? Short 2: How do I access instance variables or variables in general? There aren't getters in cake as far as I've gathered and I find it tricky to figure out how to get to a specific piece of data within a variable in a class. I'm sure there's an easy way to read data from variables, but I just haven't found it. Thanks for your time, I hope I didn't mess everything up with my descriptions! Regards DrLaban --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
DB Schema Help
Hello Bakers - I have a situation where I can't agree on the best database schema / logic for my project. Here's a simplified version of my project: table: Homes table: Images Each Home will have zero to many Images. Some Images will be "stock" images that can be used by many Homes. Each group of Images associated with a Home will be in a user defined and changeable order. Homes HABTM Images would provide the ability to associate images to homes, but how do I keep them in a specific and changeable order? My initial thought is a table: galleries, which has a serialized list of image_ids, in a particular order. Is this my best bet, or am I overlooking a possibility? Your thoughts and direction, please. 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: what's wrong with my javascript setting in phpCake?
Problem solved. I did it again, it worked. But it remains unknown what's wrong with me. I did clear cache of browser, maybe that helped. Anyway, I can go ahead. On Jul 3, 10:01 am, Geoff Ford <[EMAIL PROTECTED]> wrote: > Exactly where are you js files located, and what is the exact code > used to link to the javascript files? > > Your js files should be in /app/webroot/js. > > The link in your view file should be: > link('scriptaculous'); ?> > > Thats all there is to it. > > Geoff > --http://lemoncake.wordpress.com > > On Jul 3, 10:48 am, minglee <[EMAIL PROTECTED]> wrote: > > > Now I'm just testing the configure of javascript in Cake, so I only > > tried some javascript effects, which needn't data from php, but I use > > DOM name and id. The problem is: all worked very well if I put > > javascript functions directly in html pages, but didn't if I use > > header included .js files. > > > On Jul 3, 12:18 am, crouchjay <[EMAIL PROTECTED]> wrote: > > > > Are you passing an id or name, because javascript does not like the > > > array usage of the name that cakephp uses? > > > > On Jul 2, 3:14 pm, minglee <[EMAIL PROTECTED]> wrote: > > > > > 1. One of the .js files downloaded was prototype.js, genuine one > > > > without any modification. And the method called is element.hide. But > > > > did not work. > > > > 2. For my own .js files, when I copied the js codes into html pages, > > > > they worked. But didn't, when they in files loaded in html pages. > > > > So I shall say, it is not a javascript coding error, but a setting > > > > problem. Unfortunately, I am not familiar with phpCake. phpCake is a > > > > good framework, but the user's manual and API manual are too simple. > > > > > On Jul 2, 10:54 am, Geoff Ford <[EMAIL PROTECTED]> wrote: > > > > > > Sounds to me like a javascript error. Havethe downloaded js files > > > > > actually got the right code in them, or are they blank or 404 error > > > > > messages? > > > > > > Some actual code might help as well. > > > > > > Geoff > > > > > --http://lemoncake.wordpress.com > > > > > > On Jul 2, 10:45 am, minglee <[EMAIL PROTECTED]> wrote: > > > > > > > Thanks, francky061. > > > > > > Sorry, that's a mistake in my message. I did use > > > > > > $javascript->('.js') > > > > > > to load .js files, but it doesn't work. And I checked the generated > > > > > > html page source, there is .js file included in the header, but > > > > > > when I > > > > > > call the js functions, 'not difined' errors appear. What is more > > > > > > strange, when I save the page from browser, all the .js files were > > > > > > also downloaded in the page folder. But still doesn't work. > > > > > > > On Jul 2, 12:24 am, francky06l <[EMAIL PROTECTED]> wrote: > > > > > > > > In the views, the way you would call the helper should > > > > > > > $javascript- > > > > > > > > >() NOT $this->javascript > > > > > > > > Hope this help > > > > > > > > On Jul 1, 12:17 pm, minglee <[EMAIL PROTECTED]> wrote: > > > > > > > > > I am new to phpCake. My phpCake routing is set to > > > > > > > > 'development'. And I > > > > > > > > put all .js files into ./cake/app/webroot/js/, and set helper, > > > > > > > > called > > > > > > > > '$this->javascript', ect.., did everything as told in the > > > > > > > > manual, but > > > > > > > > it does not work. I've tried my other none-cake applications on > > > > > > > > the > > > > > > > > same server, they all work well with their js files. So, SOS. > > > > > > > > Thanks a > > > > > > > > lot!- Hide quoted text - > > > > > - Show quoted text - --~--~-~--~~~---~--~~ 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: HABTM findAll problem
About seeing that (6) product item, I see that too, but this the problem that it won't get into $data variable, and I have this problem with $hasMany association, it is better to say that I just receive 5 item per model, and I don't know why. about HABTM pagination, thank you! I will looking forward it. Regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Why dispatcher return a blank page?
On Jul 3, 9:34 pm, "chanh.ong" <[EMAIL PROTECTED]> wrote: > I did you you suggest. > > . Copy my cake 1.1 to caketest. > . copy .htacess and edit the rewritebase to caketest > . Test it to make sure it still work and it does > . Then rename cake to cakecore11 > . Copy cake core 1.2 to caketest and all I got is a blank page just > like before. > > I just wondering what was changed in dispatcher.php for Cake 1.2 so I > can have a starting point to attempt to look. echo ""; print_r($aVariable); // Anything in the code you want to see the value of print_r('Made it to:' .__FILE__.':'.__LINE__); die; paste that as the first line of your index.php file. If you don't see anything then the problem isn't cake. If you see your debug message copy and paste moving forwards in the same file until you don't see it anymore. when you see nothing go into the method you just stepped over pasting at the beginning. etc. until you see something you can fix. hth, AD --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Geocoding
Hi guys, I'm testing the code explained in: http://bakery.cakephp.org/articles/view/geocoding-in-cakephp Can anyone help me? And I am getting these errors: Notice (8): Undefined index: scheme [CORE\cake\libs\http_socket.php, line 268] Context | Code $path = "http://maps.google.com/maps/geo?&q=1600%20Pennsylvania%20Ave. %20Washington%20DC %20USA&output=csv&key=ABQIn0kmVahg_WhO0jCT8Z8MkBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxS- Zl837z60cpTjKeSeelhEJVmNOQ" $options= array("method" => "GET") * @todo check if somebody might have passed a fully qualified URL as a $path and don't prepent the scheme/host in those cases */ // Set's the URI for this request $this->setURI($this->config['scheme'].'://'.$this- >config['host'].$path); } HttpSocket::request() - CORE\cake\libs\http_socket.php, line 268 HttpSocket::get() - CORE\cake\libs\http_socket.php, line 320 GeocodedBehavior::_geocoords() - CORE\app\models\behaviors \geocoded.php, line 113 GeocodedBehavior::geocode() - CORE\app\models\behaviors\geocoded.php, line 87 Model::call__() - CORE\cake\libs\model\model.php, line 477 Overloadable::__call() - CORE\cake\libs\overloadable_php5.php, line 46 Location::geocode() - [internal], line ?? LocationsController::index() - CORE\app\controllers \locations_controller.php, line 16 Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 341 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 323 [main] - CORE\app\webroot\index.php, line 83 Warning (2): parse_url(://localhosthttp://maps.google.com/maps/geo? &q=1600%20Pennsylvania%20Ave.%20Washington%20DC %20USA&output=csv&key=ABQIn0kmVahg_WhO0jCT8Z8MkBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxS- Zl837z60cpTjKeSeelhEJVmNOQ) [function.parse-url]: Unable to parse URL [CORE\cake\libs\http_socket.php, line 133] Context | Code $uri= "://localhosthttp://maps.google.com/maps/geo? &q=1600%20Pennsylvania%20Ave.%20Washington%20DC %20USA&output=csv&key=ABQIn0kmVahg_WhO0jCT8Z8MkBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxS- Zl837z60cpTjKeSeelhEJVmNOQ" // If we were not given an array as $uri if (!is_array($uri)) { // Parse the $uri string into an array using php's parse_url function $uri = parse_url($uri); } parse_url - [internal], line ?? HttpSocket::setURI() - CORE\cake\libs\http_socket.php, line 133 HttpSocket::request() - CORE\cake\libs\http_socket.php, line 268 HttpSocket::get() - CORE\cake\libs\http_socket.php, line 320 GeocodedBehavior::_geocoords() - CORE\app\models\behaviors \geocoded.php, line 113 GeocodedBehavior::geocode() - CORE\app\models\behaviors\geocoded.php, line 87 Model::call__() - CORE\cake\libs\model\model.php, line 477 Overloadable::__call() - CORE\cake\libs\overloadable_php5.php, line 46 Location::geocode() - [internal], line ?? LocationsController::index() - CORE\app\controllers \locations_controller.php, line 16 Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 341 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 323 [main] - CORE\app\webroot\index.php, line 83 Notice (8): Undefined index: scheme [CORE\cake\libs\http_socket.php, line 230] Context | Code $uri= array("persistent" => false, "host" => "localhost", "port" => 80, "login" => null, "password" => null, "timeout" => 30, "query" => false, "path" => "") $uriTemplate= "/%path" $defaultPorts = array("http" => 80, "https" => 443) $defaultPorts = array('http' => 80, 'https' => 443); // If our $uri uses the default port for it's scheme if ($defaultPorts[$uri['scheme']] == $uri['port']) { // Strip the port part from the $uriTemplate HttpSocket::getURI() - CORE\cake\libs\http_socket.php, line 230 HttpSocket::__buildHeader() - CORE\cake\libs\http_socket.php, line 401 HttpSocket::buildHeader() - CORE\cake\libs\http_socket.php, line 378 HttpSocket::request() - CORE\cake\libs\http_socket.php, line 287 HttpSocket::get() - CORE\cake\libs\http_socket.php, line 320 GeocodedBehavior::_geocoords() - CORE\app\models\behaviors \geocoded.php, line 113 GeocodedBehavior::geocode() - CORE\app\models\behaviors\geocoded.php, line 87 Model::call__() - CORE\cake\libs\model\model.php, line 477 Overloadable::__call() - CORE\cake\libs\overloadable_php5.php, line 46 Location::geocode() - [internal], line ?? LocationsController::index() - CORE\app\controllers \locations_controller.php, line 16 Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 341 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 323 [main] - CORE\app\webroot\index.php, line 83 Notice (8): Undefined index: [CORE\cake\libs\http_socket.php, line 230] Context | Code $uri= array("persistent" => false, "host" => "localhost", "port" => 80, "login" => null, "password" => null, "timeout" => 30, "query" => false, "path" => "") $uriTemplate= "/%path" $defaultPorts = array("http" => 80, "https" => 443)
Re: Why dispatcher return a blank page?
I did you you suggest. . Copy my cake 1.1 to caketest. . copy .htacess and edit the rewritebase to caketest . Test it to make sure it still work and it does . Then rename cake to cakecore11 . Copy cake core 1.2 to caketest and all I got is a blank page just like before. I just wondering what was changed in dispatcher.php for Cake 1.2 so I can have a starting point to attempt to look. Thanks On Jul 3, 11:09 am, Danielle Tilley <[EMAIL PROTECTED]> wrote: > I had a similar problem over the weekend. Mine turned out to be a corrupted > basics.php file > Danielle > chanh.ong wrote:I rename all .htaccess as you suggested but still get a blank > page. One interesting thing is I have the rewritebase set to cake on my cake > 1.1 install and 1.1 works in both rewrite on and off. So that is a different > between 1.1 and 1.2 on how the dispatcher determine to return a page. Thanks > On Jul 2, 10:00 pm, Geoff Ford<[EMAIL PROTECTED]>wrote:This is still a > rewrite problem. You discovered previously that the servers root htdocs > folder is not where your files are located. Therefore when rewrite invoked it > is starting in the wrong location. Delete .htaccess completely, and you will > see the default page. If you set up a local server with xampp or similar you > will see that there is no problem with the default cake install. The problem > clearly lies in sourceforges non-standard server setup. You need to read and > understand the > followinghttp://httpd.apache.org/docs/1.3/mod/mod_rewrite.html. Especially > the part about RewriteBase RewriteBase /caketest wont work because > /var/www/caketest does not exist RewriteBase /my_alias/caketest is what you > need, you will have to figure out what your my_alias is as I have no idea. > Otherwise do away with .htaccess and use urls like index.php/pages/ hello > Geoff --http://lemoncake.wordpress.com On Jul 3, 2:15 pm, "chanh.ong"<[EMAIL > PROTECTED]>wrote:I have been having problem and go through various debugging > to determine what kind of problem that I might have with Cake 1.2alpha.I have > been chasing the wrong path in thinking that my problem might be the rewrite > but the real problem is the dispatcher where it just return a blank page.I > download the latest nightly Cake 1.2.Here is what I have done: . edit > .htaccess to add rewritebase /caketest . rename app/webroot/index.php to > idx.phpI want to see whether the rewrite work and it does.When > Ihttp://coaddons.sourceforge.net/caketest/itbrought me to the url where > webroot folder is located and I see the idx.php which I rename earlier.When I > click on the idx.php that is where I got a blank page.My question is what > factors that cause Cake 1.2alpha dispatcher to return a blank page rather > than a sample Cake page like 1.1?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: Instructions for Upgrading to 1.2
On 6/30/07, Dr. Tarique Sani <[EMAIL PROTECTED]> wrote: > > > Guess this is a windows program. I'll search for a Linux equivalent > > > try meld or for that matter kompare also works decently > Cheers Tarique, I'll give those a shot. Sonic --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Strange beforeFilter behaviour
I have the following beforefilter, to make sure some queries have the additional condition "WHERE sitename = 'x'". function beforeFind(&$queryData) { if ($this->hasField('siteindex') && !in_array('siteindex', array_keys($queryData)) && !in_array($this->name . '.siteindex', array_keys($queryData))) { $queryData['conditions'][$this->name . '.siteindex'] = Configure::read('siteid'); } return $queryData; } The beforefilter looks okay to me, but in some cases queries turn out like this: ...WHERE 1HERE layerid = '2' AND siteindex = '1' ORDER BY `order_id` ASC, `id` ASC; (look at the 1HERE part) And thus I get mysql errors. 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: Why dispatcher return a blank page?
I had a similar problem over the weekend. Mine turned out to be a corrupted basics.php file Danielle chanh.ong wrote: I rename all .htaccess as you suggested but still get a blank page. One interesting thing is I have the rewritebase set to cake on my cake 1.1 install and 1.1 works in both rewrite on and off. So that is a different between 1.1 and 1.2 on how the dispatcher determine to return a page. Thanks On Jul 2, 10:00 pm, Geoff Ford <[EMAIL PROTECTED]> wrote: This is still a rewrite problem. You discovered previously that the servers root htdocs folder is not where your files are located. Therefore when rewrite invoked it is starting in the wrong location. Delete .htaccess completely, and you will see the default page. If you set up a local server with xampp or similar you will see that there is no problem with the default cake install. The problem clearly lies in sourceforges non-standard server setup. You need to read and understand the followinghttp://httpd.apache.org/docs/1.3/mod/mod_rewrite.html. Especially the part about RewriteBase RewriteBase /caketest wont work because /var/www/caketest does not exist RewriteBase /my_alias/caketest is what you need, you will have to figure out what your my_alias is as I have no idea. Otherwise do away with .htaccess and use urls like index.php/pages/ hello Geoff --http://lemoncake.wordpress.com On Jul 3, 2:15 pm, "chanh.ong" <[EMAIL PROTECTED]> wrote: I have been having problem and go through various debugging to determine what kind of problem that I might have with Cake 1.2alpha. I have been chasing the wrong path in thinking that my problem might be the rewrite but the real problem is the dispatcher where it just return a blank page. I download the latest nightly Cake 1.2. Here is what I have done: . edit .htaccess to add rewritebase /caketest . rename app/webroot/index.php to idx.php I want to see whether the rewrite work and it does. When Ihttp://coaddons.sourceforge.net/caketest/itbrought me to the url where webroot folder is located and I see the idx.php which I rename earlier. When I click on the idx.php that is where I got a blank page. My question is what factors that cause Cake 1.2alpha dispatcher to return a blank page rather than a sample Cake page like 1.1? 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: Why dispatcher return a blank page?
As far as I know, the .htaccess amd index.php of webroot are the same in Cake 1.1 and Cake 1.2. Must something quite simple that causes errors. Since you have the cake 1.1 working why don't you try a "brute" method and replace the content 1.1 "core cake", with 1.2 ?? If this works, then you would make a serious exam on the files involved.. On Jul 3, 3:15 pm, "chanh.ong" <[EMAIL PROTECTED]> wrote: > I rename all .htaccess as you suggested but still get a blank page. > > One interesting thing is I have the rewritebase set to cake on my cake > 1.1 install and 1.1 works in both rewrite on and off. > > So that is a different between 1.1 and 1.2 on how the dispatcher > determine to return a page. > > Thanks > > On Jul 2, 10:00 pm, Geoff Ford <[EMAIL PROTECTED]> wrote: > > > This is still a rewrite problem. You discovered previously that the > > servers root htdocs folder is not where your files are located. > > Therefore when rewrite invoked it is starting in the wrong location. > > Delete .htaccess completely, and you will see the default page. > > > If you set up a local server with xampp or similar you will see that > > there is no problem with the default cake install. The problem clearly > > lies in sourceforges non-standard server setup. > > > You need to read and understand the > > followinghttp://httpd.apache.org/docs/1.3/mod/mod_rewrite.html. Especially > > the > > part about RewriteBase > > > RewriteBase /caketest wont work because /var/www/caketest does not > > exist > > RewriteBase /my_alias/caketest is what you need, you will have to > > figure out what your my_alias is as I have no idea. > > > Otherwise do away with .htaccess and use urls like index.php/pages/ > > hello > > > Geoff > > --http://lemoncake.wordpress.com > > > On Jul 3, 2:15 pm, "chanh.ong" <[EMAIL PROTECTED]> wrote: > > > > I have been having problem and go through various debugging to > > > determine what kind of problem that I might have with Cake 1.2alpha. > > > > I have been chasing the wrong path in thinking that my problem might > > > be the rewrite but the real problem is the dispatcher where it just > > > return a blank page. > > > > I download the latest nightly Cake 1.2. > > > > Here is what I have done: > > > . edit .htaccess to add rewritebase /caketest > > > . rename app/webroot/index.php to idx.php > > > > I want to see whether the rewrite work and it does. > > > > When Ihttp://coaddons.sourceforge.net/caketest/itbroughtme to the > > > url where webroot folder is located and I see the idx.php which I > > > rename earlier. > > > > When I click on the idx.php that is where I got a blank page. > > > > My question is what factors that cause Cake 1.2alpha dispatcher to > > > return a blank page rather than a sample Cake page like 1.1? > > > > 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: dynamic url in $ajax->link
you can use the "with" parameter of the $ajax call. You would have to give the DOM ID of the parameter. You will get this value in the $this- >params of the controller. hope this help On Jul 3, 3:48 pm, Ita <[EMAIL PROTECTED]> wrote: > OK - managed. > Didn't notice the ajax 'with' option. > BTW it should be better documented since its really not clear how it > should be used. > for future ref it can be found > here:http://groups.google.com/group/cake-php/browse_thread/thread/ac6d7e82... > > On Jul 3, 3:06 pm, Ita <[EMAIL PROTECTED]> wrote: > > > Hi, > > I'm trying to create an ajax link that will pass a dynamic parameter > > according to something the user inputs. > > what I mean is that I want the link that will call an action but with > > a different parameter each time and this parameter is given by the > > user on the client side, during the creation of the link on the serer > > side I have no idea what this parameter is going to be. > > > I have tried to user the "before" option but I couldn't find a way to > > update the url that the ajax link calls. > > > Maybe what I'm trying to do is not possible but I'm asking anyway. --~--~-~--~~~---~--~~ 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: Paginate define columns to use (1.2)
On 7/3/07, Mech7 <[EMAIL PROTECTED]> wrote: > > Thanks this seems to do the job.. when i put it in my controller :D > but what does the recursive var stand for? > Think of it like this... If your main model that is being indexed has children (other models) you could well want fields associated with those children (for example, perhaps to to resolve an employee number into a readable name) The recursion var controls how deep this matching will go. To continue the example, some employees might have one or more further objects (models) associated with them as individuals. For your original parent object right at the top, it is probably unlikely you need this level of detail so restricting the recursive var should reduce the DB load & execution speed. See the definition of find() at http://manual.cakephp.org/chapter/models - it's all in there :-) - howard --~--~-~--~~~---~--~~ 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: Paginate define columns to use (1.2)
Thanks this seems to do the job.. when i put it in my controller :D but what does the recursive var stand for? On Jul 2, 10:42 pm, phpjoy <[EMAIL PROTECTED]> wrote: > did you try: > $this->ModelName->recursive = 0; > in the model? > > On Jul 1, 5:13 pm, Mech7 <[EMAIL PROTECTED]> wrote: > > > > > > > UnbindModel does also not seem to work :( > > > // Remove HABTM on tags and categories > > $this->Article->unbindModel(array('hasAndBelongsToMany' => > > array('Tag', 'Category'))); > > // Find all articles > > $this->set('articles', $this->paginate('Article')); --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Models in default.thtml
I feel like this is a very small thing I'm missing, but I haven't yet found a solution. So my problem is that I want to have a dynamic menu displayed on every page, based on visible instances of one of my models. However, when I try to do something like this: Menu->findAll(null, null, $order = "root DESC") as $menu): ?> I get the "call to a member function on a non-object" error. I've told my AppController that it's supposed to use the Menu model (var $uses...) but that's not working. Any advice? Thanks much again. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CSS not working out the box
I believe Harro and I are having the exact same problem. I am trying to run this as a development setup .When I point the browser to 'localhost/cake' and I look at the source, I see the following: Clearly, this is pointing to nothing. However, when I point the browser to localhost/cake/app/webroot the same line read the following: I have mod_rewrite enabled. I assume there is a setting I need to change. Would it just be easier to move the webroot folder out of /app and set the path manually. Also, if I change the Apache DocumentRoot to to the app/webroot folder (i.e. production setup) everything works fine. --~--~-~--~~~---~--~~ 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: Condition not applied to select drop down box in belongsTo association
PS. When I say prevent, I'm refering to stopping the section still appearing in the parent down drop down box on its own edit page. On 7/3/07, michaelmcandrew <[EMAIL PROTECTED]> wrote: > > Hi, I have a belongs to condition that applies to a Section model that > references itself for its parents. I > > var $belongsTo = array( > 'Parent' => array( > 'className'=>'Section', > 'foreignKey'=>'parent_id', > ) > ); > > I want to be able to stop a parent being its own child. I thought > adding the following condition would prevent that. > > 'conditions'=>'Section.parent_id'!=Parent.id'. > > But it doesn't. Can anyone tell me what I am doing wrong? > > Thanks, > Michael > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: A question about integrating jquery in cakephp?
Well I place jquery stuff in a subdirectory of webroot/js I have webroot/js/jquery/jquery.js In my header I have: If you are also using prototype, make sure you avoid conflicts. Read this: Using jQuery with Other Libraries http://docs.jquery.com/Using_jQuery_with_Other_Libraries I use to prefix my jQuery stuff with $j and prototype stuff with $
Condition not applied to select drop down box in belongsTo association
Hi, I have a belongs to condition that applies to a Section model that references itself for its parents. I var $belongsTo = array( 'Parent' => array( 'className'=>'Section', 'foreignKey'=>'parent_id', ) ); I want to be able to stop a parent being its own child. I thought adding the following condition would prevent that. 'conditions'=>'Section.parent_id'!=Parent.id'. But it doesn't. Can anyone tell me what I am doing wrong? Thanks, Michael --~--~-~--~~~---~--~~ 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: 1.2 Pagination SQL Injection
On 7/3/07, R. Rajesh Jeba Anbiah <[EMAIL PROTECTED]> wrote: > > >FWIW, Sanitize::clean() is broken (the trim logic is totally > breaking) leaving possibility for SQL errors. Sanitization is also not > promoted in the community nor in source, IM*H*O. Wanted to add a little more to this before I hit send. Before you go spewing comments like the one above do a little research in this framework. From the beginning security has been a primary focus of the development. Over the course of 2 years I have had 2 reported exploits that have been patched within hours of being reported. Educate yourself a little before trying to inform others with false statements like: "Sanitization is also not promoted in the community nor in source, IM*H*O." -- /** * @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: 1.2 Pagination SQL Injection
On 7/3/07, R. Rajesh Jeba Anbiah <[EMAIL PROTECTED]> wrote: > >FWIW, Sanitize::clean() is broken (the trim logic is totally > breaking) leaving possibility for SQL errors. Sanitization is also not > promoted in the community nor in source, IM*H*O. Sanitize::clean() is not needed if you follow the correct conventions of the framework. All sql in escaped at the dbo level when using these conventions. And if you find a problem with anything in the core you are wasting your time reporting it here, I have a trac site setup for reporting issues with the core. -- /** * @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: A question about integrating jquery in cakephp?
I use : http://bakery.cakephp.org/articles/view/some-ideas-to-organize-your-css-files-and-autoload-them-in-cakephp added a comment at the bottom which includes using this technique for JS - works fine for me so far... On Jul 2, 9:48 am, Grant Cox <[EMAIL PROTECTED]> wrote: > http://cakebaker.42dh.com/2007/02/21/referencing-javascript-files/ > > $scripts_for_layout is where any javascript includes you define in > your view, using the Javascript helper and a false "inline" parameter. > > On Jul 2, 3:10 pm, Jim Newfer <[EMAIL PROTECTED]> wrote: > > > Alright, I got it to work, when I removed the line of code from my > > default layout, $scripts_for_layout. > > > Can someone please tell me what $scripts_for_layout is used for? Thank > > you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 1.2 Pagination SQL Injection
Agreed with you on that point On 7/3/07, R. Rajesh Jeba Anbiah <[EMAIL PROTECTED]> wrote: > > > On Jul 3, 11:48 am, AD7six <[EMAIL PROTECTED]> wrote: > > On Jul 3, 2:54 am, AndyC <[EMAIL PROTECTED]> wrote: > > > > > OK done. > > > > When you tested that, how did you do so and what did you see? > > > > I see: > > ORDER BY `fi\'eld` asc. > > > > obviously that won't work but neither will it allow you to do much > > (and it's not permitting injection either) > >FWIW, Sanitize::clean() is broken (the trim logic is totally > breaking) leaving possibility for SQL errors. Sanitization is also not > promoted in the community nor in source, IM*H*O. > > -- > > Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/ > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 1.2 Pagination SQL Injection
On Jul 3, 11:48 am, AD7six <[EMAIL PROTECTED]> wrote: > On Jul 3, 2:54 am, AndyC <[EMAIL PROTECTED]> wrote: > > > OK done. > > When you tested that, how did you do so and what did you see? > > I see: > ORDER BY `fi\'eld` asc. > > obviously that won't work but neither will it allow you to do much > (and it's not permitting injection either) FWIW, Sanitize::clean() is broken (the trim logic is totally breaking) leaving possibility for SQL errors. Sanitization is also not promoted in the community nor in source, IM*H*O. -- Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using jquery's Ajax functions in tandem with CakePHP...
Gremlin, thank you so much for your reply! So far it isn't working but in the top of my javascript I have a requestAction, and in my controller I set something like this if(isset($this->params['requested'])) { return array('stories' => $getstories, 'school' => $schoolname); That is all I should need to do to have jquery be able to access my models right ? Thanks for any more advice from anyone. On Jul 2, 10:24 pm, gremlin <[EMAIL PROTECTED]> wrote: > You can call a script the same way, just use $( "#quote p" ).load( "/ > contoller/action" ); > > Make sure your controller handlesajaxrequests. If you don't know > what that means look up requestAction or parseExtensions in the > groups. > > On Jul 2, 10:12 pm, Jim Newfer <[EMAIL PROTECTED]> wrote: > > > I have been usingjquery, which is great btw, with cakephp for a > > couple of weeks now. I love it to say the least. I haven't really > > dealt withajaxvery much, but I have done some basic things with it, > > and PHP outside of cake. Needless to say, when it comes time to use > >jquery'sajaxfunctionality with cake, I am completely and totally > > lost. > > > I trying to get this EXTREMELY simple tutorial to work with cakephp > > for about the past 3 hours, and just cannot seem to figure it out. > > >http://www.sitepoint.com/article/ajax-jquery > > > I think it make have something to do with this line injquery, where > > it calls for an outside script. > > > $("#quote p").load("script.php"); > > > I was wondering is there some way to instead, call upon a specific > > controller? Or passjqueryinformation? > > > Obviously I do not want to include a separate script because that > > would be an unnecessary hassle. I am just looking for pointers/tips on > > how to useajax'sfunctionality with cake, because I cannot seem to > > find any good tutorials anywhere on incorporatingjqueryinto cake. > > > Any guidance is GREATLY appreciated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CSS not working out the box
> > If you've done a default install of cakephp on your local machine and > css is not working, check a couple things: > > 1. do you have mod_rewrite active? > 2. which index.php page is getting loaded? > > /cakephp_xxx/index.php > > or > > cakephp_xxx/app/index.php And also check 3. Can you reach the css by browsing to /css/cake.generic.css 4. Check the page source in your browser what it says, ie HTH 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 -~--~~~~--~~--~--~---
Re: dynamic url in $ajax->link
OK - managed. Didn't notice the ajax 'with' option. BTW it should be better documented since its really not clear how it should be used. for future ref it can be found here: http://groups.google.com/group/cake-php/browse_thread/thread/ac6d7e82cdebff0d/419c61467f610e69 On Jul 3, 3:06 pm, Ita <[EMAIL PROTECTED]> wrote: > Hi, > I'm trying to create an ajax link that will pass a dynamic parameter > according to something the user inputs. > what I mean is that I want the link that will call an action but with > a different parameter each time and this parameter is given by the > user on the client side, during the creation of the link on the serer > side I have no idea what this parameter is going to be. > > I have tried to user the "before" option but I couldn't find a way to > update the url that the ajax link calls. > > Maybe what I'm trying to do is not possible but I'm asking anyway. --~--~-~--~~~---~--~~ 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: CSS not working out the box
If you've done a default install of cakephp on your local machine and css is not working, check a couple things: 1. do you have mod_rewrite active? 2. which index.php page is getting loaded? /cakephp_xxx/index.php or cakephp_xxx/app/index.php On Jul 3, 7:24 am, Harro <[EMAIL PROTECTED]> wrote: > I have just downloaded the latest stable release from cakephp.org: > > cake_1.1.15.5144.zip > > and unzipped it into my webroot, however, there is no css styling what > so ever? Is there any configurations I have to make to get it working? > > Thanks, Harro. --~--~-~--~~~---~--~~ 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: Why dispatcher return a blank page?
I rename all .htaccess as you suggested but still get a blank page. One interesting thing is I have the rewritebase set to cake on my cake 1.1 install and 1.1 works in both rewrite on and off. So that is a different between 1.1 and 1.2 on how the dispatcher determine to return a page. Thanks On Jul 2, 10:00 pm, Geoff Ford <[EMAIL PROTECTED]> wrote: > This is still a rewrite problem. You discovered previously that the > servers root htdocs folder is not where your files are located. > Therefore when rewrite invoked it is starting in the wrong location. > Delete .htaccess completely, and you will see the default page. > > If you set up a local server with xampp or similar you will see that > there is no problem with the default cake install. The problem clearly > lies in sourceforges non-standard server setup. > > You need to read and understand the > followinghttp://httpd.apache.org/docs/1.3/mod/mod_rewrite.html. Especially > the > part about RewriteBase > > RewriteBase /caketest wont work because /var/www/caketest does not > exist > RewriteBase /my_alias/caketest is what you need, you will have to > figure out what your my_alias is as I have no idea. > > Otherwise do away with .htaccess and use urls like index.php/pages/ > hello > > Geoff > --http://lemoncake.wordpress.com > > On Jul 3, 2:15 pm, "chanh.ong" <[EMAIL PROTECTED]> wrote: > > > I have been having problem and go through various debugging to > > determine what kind of problem that I might have with Cake 1.2alpha. > > > I have been chasing the wrong path in thinking that my problem might > > be the rewrite but the real problem is the dispatcher where it just > > return a blank page. > > > I download the latest nightly Cake 1.2. > > > Here is what I have done: > > . edit .htaccess to add rewritebase /caketest > > . rename app/webroot/index.php to idx.php > > > I want to see whether the rewrite work and it does. > > > When Ihttp://coaddons.sourceforge.net/caketest/itbrought me to the > > url where webroot folder is located and I see the idx.php which I > > rename earlier. > > > When I click on the idx.php that is where I got a blank page. > > > My question is what factors that cause Cake 1.2alpha dispatcher to > > return a blank page rather than a sample Cake page like 1.1? > > > 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 -~--~~~~--~~--~--~---
dynamic url in $ajax->link
Hi, I'm trying to create an ajax link that will pass a dynamic parameter according to something the user inputs. what I mean is that I want the link that will call an action but with a different parameter each time and this parameter is given by the user on the client side, during the creation of the link on the serer side I have no idea what this parameter is going to be. I have tried to user the "before" option but I couldn't find a way to update the url that the ajax link calls. Maybe what I'm trying to do is not possible but I'm asking anyway. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
CSS not working out the box
I have just downloaded the latest stable release from cakephp.org: cake_1.1.15.5144.zip and unzipped it into my webroot, however, there is no css styling what so ever? Is there any configurations I have to make to get it working? Thanks, Harro. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Cake 1.2: Doubled COUNT(*) query when updating data
If it's a new record (no rows with given id in a table), Cake makes one COUNT query and one INSERT, this is OK. But when record with id exists, Cake makes two COUNT(*) queries istead of single one. It'a bug? :) Action: $this->Model->save($mydata); SQL queries: 1.SELECT COUNT(*) AS count FROM [...] id` = 20491 1 2 2 SELECT COUNT(*) AS count FROM [...] id` = 20491 1 2 3 UPDATE [...] id` IN (2049) P.S. Sorry for my 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: How to make session expire after browser close?
It could be you have multiple instances of same browser open, if so then closing one of them does not cause the session to expire. At least that's what I have noticed in firefox. So you have to close all instances. I am talking of instances and not tabs. Cheers, Ketan ;-) dkcforu wrote: > The problem i am facing is that, when i am closing my browser in which > i am logged in some site, its session should be destroyed after set > time which is set to 120sec in my case, but it is not doing that. the > session is still there when i am opening the browser again. How can i > resolve this problem? in the other way i can say; > > > I log into my site > > Close my browser (all windows) > > Load load browser again, visit my site, and i am automatically > > STILL logged in? > > > I have tried with making the define('CAKE_SECURITY', 'high'); also but > didn't get any result through this. > > Can some one help me on this 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 -~--~~~~--~~--~--~---
Re: Validation in 1.1.15.5144
[..snip..] > > Hi, > > Have you tried enabling SQL debug to see what INSERT statement it is using? Yep. And I see something like: INSERT INTO... ('created') VALUES ('...') So. This code working properly in neighbourg directory... > > Some comments about your code: > > - $this->render() executes by default (if autoRender is set to true) so you > can probably just do if ($this->data) to check if there's anything > submitted. If not, it will render() by default (right now you're doing if > (empty($this->params['data'])) { ... } else { ... }. > - You don't need to do: $this->set( 'data', $this->data ) ... $this->data > is available from the view automatically. Thank's > > Hope this helps. Only adding if (! empty ($this->params['data'])) help me. But why doesn't working model validation (body, title cannot been empty) I don't understand. So in SQL I see how adding EMPTY record... > > - 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: cake generic arrays
You want the Model::generateList() method. It does exactly what you need, and it's listed in the API, and in the manual (under 'Model'). On Jul 2, 11:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Is there a built in function for take the results of a generic query() > call and making an associative array? For example, I want to use a > SELECT DISTINCT field_name and simply get an array of those values, or > an associative array of array(value => value) to use in an HTML select > > I couldn't find anything in any docs for this. > Brian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to make session expire after browser close?
On 7/3/07, dkcforu <[EMAIL PROTECTED]> wrote: > > > session is still there when i am opening the browser again. How can i > resolve this problem? in the other way i can say; #1 Examine the cookie and see if it is set to expire at the end of session. If it is then your browser is at fault - if not then the script is at fault HTH Tariqeu -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How to make session expire after browser close?
The problem i am facing is that, when i am closing my browser in which i am logged in some site, its session should be destroyed after set time which is set to 120sec in my case, but it is not doing that. the session is still there when i am opening the browser again. How can i resolve this problem? in the other way i can say; > I log into my site > Close my browser (all windows) > Load load browser again, visit my site, and i am automatically > STILL logged in? I have tried with making the define('CAKE_SECURITY', 'high'); also but didn't get any result through this. Can some one help me on this 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 -~--~~~~--~~--~--~---
Re: Two pagination on single page
thanks dear, can u tell me is there any possibility's to use one ajax paging and another one is url submiting page?. little bit confuse. On 7/3/07, Spectacularium <[EMAIL PROTECTED]> wrote: > > > Use the ajax pagination to fix this problem or else you can use custom > params in the url for populating the paginator. > > On Jul 3, 6:16 am, "lalit kumar" <[EMAIL PROTECTED]> wrote: > > hi, > > > > can u help me. i wanna to configure two pagination on single page in > cake > > php. the problem is that all the varibles of second pagination > orverwrite > > the first one pagination. > > > > Thanks > > lalit > > > > Lalit Kumar > > Software Engg. > > Netsolutions > > Chandigarh > > 09888711687 > > > > > -- Lalit Kumar Software Engg. Netsolutions Chandigarh 09888711687 --~--~-~--~~~---~--~~ 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: HABTM findAll problem
On Jul 3, 12:23 pm, AD7six <[EMAIL PROTECTED]> wrote: > On Jul 3, 12:19 pm, Easter Egg <[EMAIL PROTECTED]> wrote: > > > so, where is the sixth item? I don't know. > > Try looking at and counting the number of products you have in your > data. Hint there are 6. > > AD PS you are going to have a lot of difficulties paginating habtm data as you are - search the group for "filtering habtm" since that is what you will need to do such that you paginate on the Product model not the tag (as there will only ever be 1 as that is your constraint). hth, AD --~--~-~--~~~---~--~~ 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: 3 levels of HABTM and a headache
> > you are not going to be able to solve your problem with a single query > (unless you write it manually) but you'll find some detailed > explanations/examples of what you can do here: > > http://groups.google.com/group/cake-php/search?q=filtering+habtm&start=0&scoring=d Thanks AD, I looked into it and it gave me an even bigger headache :) but it was interesting reading, I will use it for the flexible search form I have to build lateron. For now I have solved my problem by traversing a 3 level deep findAll() on the User model and storing the Services in a small array in the Session. Due to the structure of my application it is no problem. Thanx again, I am new to cake but it has already boosted my time-to-deliver(-prototype) by 220% :-) 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 -~--~~~~--~~--~--~---
Re: simple app with authentication
http://bakery.cakephp.org/tags/view/auth Take your pick HTH T On 7/3/07, Matt2012 <[EMAIL PROTECTED]> wrote: > > > Has anyone made available a simple cake built site with login/ > registration built in similar to freakauth for code igniter > http://www.4webby.com/freakauth/ > > I think starting from there makes starting a new framework much more > painless as newbies always have to conquer both learning how to make > composite layouts and authentication before they can start. > > Yes I know im lazy but rapid app development is what its all about ? > > Matt. > > > > > -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: HABTM findAll problem
On Jul 3, 12:19 pm, Easter Egg <[EMAIL PROTECTED]> wrote: > so, where is the sixth item? I don't know. Try looking at and counting the number of products you have in your data. Hint there are 6. AD --~--~-~--~~~---~--~~ 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: HABTM findAll problem
oops! wrong message, let me show another tag.id that contains more that 5 result: 5 SELECT `Product`.`id`, `Product`.`name`, `Product`.`altname`, `Product`.`description`, `Product`.`year`, `Product`.`price`, `Product`.`quantity`, `Product`.`small_image`, `Product`.`big_image` FROM `products` AS `Product` JOIN `products_tags` ON (`products_tags`.`tag_id` = 3 AND `products_tags`.`product_id` = `Product`.`id`) WHERE 1 = 1 6 6 1 this query will return 6 item, but I cannot access them, I just see that $data is this: Array ( [0] => Array ( [Tag] => Array ( [id] => 3 [name] => مهییج ) [Product] => Array ( [0] => Array ( [id] => 3 [name] => توازن [altname] => Equilibrium [description] => توازن فیلمی است علمی- تخیلی، در باب نظم جهان و دنیایی از آینده که در آن بشریت بالاجبار به نظامهای سخت اجتماعی پناه برده است. [year] => 2001 [price] => 750 [quantity] => 1 [small_image] => winter.jpg [big_image] => sunset.jpg ) [1] => Array ( [id] => 4 [name] => ماتریکس [altname] => Matrix [description] => فیلم قشنگیه! حال کنین! [year] => 2001 [price] => 800 [quantity] => 1 [small_image] => blood_and_chocolate.jpg [big_image] => madonna_confessions_tour.jpg ) [2] => Array ( [id] => 5 [name] => ناچو لیبره [altname] => Nacho Libre [description] => فیلمی مهیج، با بازی بازیگران کمدی [year] => 1999 [price] => 780 [quantity] => 1 [small_image] => blood_and_chocolate.jpg [big_image] => arthur_and_the_invisibles.jpg ) [3] => Array ( [id] => 8 [name] => کوزهی سفالی [altname] => The Pottery [description] => جیمز در آغاز با کوزه گری شروع میکند،اما در آینده به قهرمانی بدل میشود که کشورش را نجات میدهد. [year] => 2007 [price] => 750 [quantity] => 1 [small_image] => if_only.jpg [big_image] => little_children.jpg ) [4] => Array ( [id] => 17 [name] => ماتریکس 2 [altname] => شسی [description] => شسیشسی [year] => 2001 [price] => 200 [quantity] => 1 [small_image] => [big_image] => ) [5] => Array ( [id] => 18 [name] => اسپایدرمن 3 [altname] => Spiderman 3 [description] => fileasdasdasdad [year] => 2004 [price] => 750 [quantity] => 1 [small_image] => hannibal_rising.jpg [big_image] => lost_cover_s2p1__naboo_qwerty_.jpg ) ) ) ) so, where is the sixth item? I don't know. I used 1.1.15.5144 . --~--~-~--~~~---~--~~ 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: HABTM findAll problem
function view($id) { $criteria= "Tag.id = {$id}"; list($order,$limit,$page) = $this->Pagination->init($criteria, null, array('sortBy' => 'id DESC')); // Added $data = $this->Tag->findAll($criteria, NULL, $order, $limit, $page); // Extra parameters added $this->set('data', $data); } for your more info, I turned on debugging system and recieved this details: Nr Query Error AffectedNum. rows Took (ms) 1 DESCRIBE `tags` 2 2 2 2 DESCRIBE `products` 9 9 2 3 SELECT COUNT(*) AS count FROM `tags` AS `Tag` WHERE `Tag`.`id` = 4 1 1 0 4 SELECT `Tag`.`id`, `Tag`.`name` FROM `tags` AS `Tag` WHERE `Tag`.`id` = 4 ORDER BY `Tag`.`id` DESC LIMIT 201 1 0 5 SELECT `Product`.`id`, `Product`.`name`, `Product`.`altname`, `Product`.`description`, `Product`.`year`, `Product`.`price`, `Product`.`quantity`, `Product`.`small_image`, `Product`.`big_image` FROM `products` AS `Product` JOIN `products_tags` ON (`products_tags`.`tag_id` = 4 AND `products_tags`.`product_id` = `Product`.`id`) WHERE 1 = 1 4 4 1 6 SELECT Tag.`name`, Tag.`id` , COUNT( P.`product_id` ) count FROM `tags` Tag, `products_tags` P WHERE Tag.id = P.`tag_id` GROUP BY Tag.id 8 8 1 --~--~-~--~~~---~--~~ 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 app with authentication
Has anyone made available a simple cake built site with login/ registration built in similar to freakauth for code igniter http://www.4webby.com/freakauth/ I think starting from there makes starting a new framework much more painless as newbies always have to conquer both learning how to make composite layouts and authentication before they can start. Yes I know im lazy but rapid app development is what its all about ? Matt. --~--~-~--~~~---~--~~ 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: Two pagination on single page
Use the ajax pagination to fix this problem or else you can use custom params in the url for populating the paginator. On Jul 3, 6:16 am, "lalit kumar" <[EMAIL PROTECTED]> wrote: > hi, > > can u help me. i wanna to configure two pagination on single page in cake > php. the problem is that all the varibles of second pagination orverwrite > the first one pagination. > > Thanks > lalit > > Lalit Kumar > Software Engg. > Netsolutions > Chandigarh > 09888711687 --~--~-~--~~~---~--~~ 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: renderElement vs nesting views
On 7/2/07, Ski <[EMAIL PROTECTED]> wrote: > I am writing an application which enables editing of data for a > parent model and a data for a list of child models in a single view. > > To make the code easier to re-use, I would like to keep the views > for the parent and child separate - as they would be normally for each > controller, but I would still like to have these views exist on the > same page at the same time. If I understand you right, it sounds like you may wish to go down the ajax route. In essence, have an action for the parent that renders all the stuff it needs to do, but has placeholders (div's) that you preload with child actions (ie a form). You can then "firewall" add/update actions on the individual children controllers ( see a thread http://tinyurl.com/3c4fog for a little help) I've done this due to similar need to edit 2 different sets of children (lists of entities associated with a parent item) and it's worked well. If you've not done ajax I wouldn't worry, i hadn't done a lot previously but the examples and the libraries make it straightforward. The tweaks to forms to do ajax are pretty trivial and quite rewarding in the long run. HG --~--~-~--~~~---~--~~ 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: HABTM findAll problem
What does the view() function look like? On Jul 3, 10:18 am, Easter Egg <[EMAIL PROTECTED]> wrote: > Hi all, > I used a HABTM over Product and Tag. > > // TAG.PHP > > class Tag extends AppModel { > var $name = "Tag"; > var $hasAndBelongsToMany = array('Product' => >array('className'=> 'Product', > 'joinTable'=> > 'products_tags', > 'foreignKey' => 'tag_id', > 'associationForeignKey'=> > 'product_id', > 'conditions' => '', > 'order'=> '', > 'limit'=> '', > 'unique' => true, > 'finderQuery' => '', > 'deleteQuery' => '', >) >);} > > ?> > > // PRODUCT.PHP > > class Product extends AppModel { > var $name = "Product"; > var $hasAndBelongsToMany = array('Tag' => >array('className'=> 'Tag', > 'joinTable'=> > 'products_tags', > 'foreignKey' => 'product_id', > 'associationForeignKey'=> > 'tag_id', > 'conditions' => '', > 'order'=> '', > 'limit'=> '', > 'unique' => true, > 'finderQuery' => '', > 'deleteQuery' => '', >) >); > var $validate = array ( > "name"=> VALID_NOT_EMPTY, > "year"=> VALID_YEAR, > "price" => VALID_NUMBER, > "quantity"=> VALID_NUMBER, > "description"=>VALID_NOT_EMPTY);} > > ?> > > I defined a function view($id) that return all products of a single > tag. but it only and only recieve the first 5 products over that > query. like this: > Array > ( > [0] => Array > ( > [Tag] => Array > ( > [id] => 3 > [name] => مهییج > ) > > [Product] => Array > ( > [0] => Array > ( > [id] => 3 > [name] => توازن > [altname] => Equilibrium > [description] => توازن فیلمی است علمی- > تخیلی، در باب نظم جهان و دنیایی از آینده که در آن بشریت بالاجبار به > نظامهای سخت اجتماعی پناه برده است. > [year] => 2001 > [price] => 750 > [quantity] => 1 > [small_image] => winter.jpg > [big_image] => sunset.jpg > ) > > [1] => Array > ( > [id] => 4 > [name] => ماتریکس > [altname] => Matrix > [description] => فیلم قشنگیه! حال کنین! > [year] => 2001 > [price] => 800 > [quantity] => 1 > [small_image] => blood_and_chocolate.jpg > [big_image] => > madonna_confessions_tour.jpg > ) > > [2] => Array > ( > [id] => 5 > [name] => ناچو لیبره > [altname] => Nacho Libre > [description] => فیلمی مهیج، با بازی > بازیگران کمدی > [year] => 1999 > [price] => 780 > [quantity] => 1 > [small_image] => blood_and_chocolate.jpg > [big_image] => > arthur_and_the_invisibles.jpg > ) > > [3] => Array > ( > [id] => 8 > [name] => کوزهی سفالی > [altname] => The Pottery > [description] => جیمز در آغاز با کوزه گری > شروع میکند،اما در آینده به قهرمانی بدل میشود که کشورش را نجات > میدهد. > [year] => 2007 > [price] => 750 > [quantity] => 1 > [small_ima
HABTM findAll problem
Hi all, I used a HABTM over Product and Tag. // TAG.PHP array('className'=> 'Product', 'joinTable'=> 'products_tags', 'foreignKey' => 'tag_id', 'associationForeignKey'=> 'product_id', 'conditions' => '', 'order'=> '', 'limit'=> '', 'unique' => true, 'finderQuery' => '', 'deleteQuery' => '', ) ); } ?> // PRODUCT.PHP array('className'=> 'Tag', 'joinTable'=> 'products_tags', 'foreignKey' => 'product_id', 'associationForeignKey'=> 'tag_id', 'conditions' => '', 'order'=> '', 'limit'=> '', 'unique' => true, 'finderQuery' => '', 'deleteQuery' => '', ) ); var $validate = array ( "name" => VALID_NOT_EMPTY, "year" => VALID_YEAR, "price" => VALID_NUMBER, "quantity" => VALID_NUMBER, "description"=> VALID_NOT_EMPTY); } ?> I defined a function view($id) that return all products of a single tag. but it only and only recieve the first 5 products over that query. like this: Array ( [0] => Array ( [Tag] => Array ( [id] => 3 [name] => مهییج ) [Product] => Array ( [0] => Array ( [id] => 3 [name] => توازن [altname] => Equilibrium [description] => توازن فیلمی است علمی- تخیلی، در باب نظم جهان و دنیایی از آینده که در آن بشریت بالاجبار به نظامهای سخت اجتماعی پناه برده است. [year] => 2001 [price] => 750 [quantity] => 1 [small_image] => winter.jpg [big_image] => sunset.jpg ) [1] => Array ( [id] => 4 [name] => ماتریکس [altname] => Matrix [description] => فیلم قشنگیه! حال کنین! [year] => 2001 [price] => 800 [quantity] => 1 [small_image] => blood_and_chocolate.jpg [big_image] => madonna_confessions_tour.jpg ) [2] => Array ( [id] => 5 [name] => ناچو لیبره [altname] => Nacho Libre [description] => فیلمی مهیج، با بازی بازیگران کمدی [year] => 1999 [price] => 780 [quantity] => 1 [small_image] => blood_and_chocolate.jpg [big_image] => arthur_and_the_invisibles.jpg ) [3] => Array ( [id] => 8 [name] => کوزهی سفالی [altname] => The Pottery [description] => جیمز در آغاز با کوزه گری شروع میکند،اما در آینده به قهرمانی بدل میشود که کشورش را نجات میدهد. [year] => 2007 [price] => 750 [quantity] => 1 [small_image] => if_only.jpg [big_image] => little_children.jpg ) [4] => Array ( [id] => 17 [name] => ماتریکس 2 [altname] => شسی [description] => شسیشسی [year] => 2001 [price] => 200 [quantity] => 1 [small_image] => [big_image]
Re: renderElement vs nesting views
> you can send a variable to the element: > renderElement('my_element', array('data' => $data)); Hi, Thanks, I have been trying that, but the idea was to re-use the views I have already without having to change them. I "changed" the "standard" edit form over to an element by moving the file into the appropriate folder, but it does not render the model values in the form fields automatically, e.g. in my Food Menus edit view, I have a list of dishes that I want to have an edit form for - so I loop through them calling render element like so... renderElement('menu_dishes/admin_edit', array('data' => array('MenuDish' => $menuDish))); } ?> my simplified element is the same as a standard edit form for the MenuDish and is as follows: data = $data; //print_r($this->data); ?> labelTag('MenuDish/title', 'Title');?> input('MenuDish/title', array('size' => '10'));?> tagErrorMsg('MenuDish/title', 'Please enter the Title.');?> submit('Save');?> This does not render the values of the MenuDish in the input in the same way as it would in a standard view. That's what I want to happen with my "nested" views. Thanks Glen --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Fwd: CakePHP and Lighttpd
For anyone searching through the archives for lighttpd goodies, and has ran across this old post (http://groups.google.com/group/cake-php/ msg/4cb6e058233e6d40) ... Here's a wayback url that my good friend "b3ta" found for the blog entry mentioned here. You'll have to scroll past the first couple of messages, there doesn't seem to exist a page directly for that blog entry anymore. http://web.archive.org/web/20061105045557/www.johndavidanderson.net/blog/ Hope someone finds this usefull. Long live lighty ;-D rx On Jun 26 2006, 5:36 pm, John David Anderson <[EMAIL PROTECTED]> wrote: > I've been trying to create a setup for CakePHP that would allow me to > package up my application and have it work almost anywhere. I also > tire of mod_rewrite and .htaccess oddness from place to place, so > I've found a way to pair up CakePHP andlighttpdto have my own > little setup. I've recorded my steps on my blog, along with a script > you can download to ease the administration of the setup. > > http://www.johndavidanderson.net/blog/?p=60 > > I welcome any feedback! > > -- 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: 1.2 Pagination SQL Injection
On 7/3/07, AD7six <[EMAIL PROTECTED]> wrote: > > > > > On Jul 3, 2:54 am, AndyC <[EMAIL PROTECTED]> wrote: > > OK done. > > When you tested that, how did you do so and what did you see? > > I see: > ORDER BY `fi\'eld` asc. > > obviously that won't work but neither will it allow you to do much > (and it's not permitting injection either) +1 Was about to post something very similar. How was the injection achieved? Just being able to force an SQL error is not true injection T -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---