Re: Alternate Pagination question
The most efficient way database-wise would be to have a char(1) database column that you populate with whatever the first letter of the field you're using... that way it could be indexed and easily counted. It would be slightly slower when saving data but (I assume) much faster retrieving it. If you didn't want to do that, you could use the mysql substring function: Here is mysql the query string(tested) SELECT SUBSTRING(name, 1, 1) as letter, COUNT(SUBSTRING(name, 1, 1)) as count FROM people GROUP BY letter ORDER BY letter; Here is a cake query(untested) $this->People->find('list', array( 'fields' => array('SUBSTRING(name, 1, 1) as letter', 'COUNT(SUBSTRING(name, 1, 1)) AS COUNT'), 'group' => 'letter', 'order' => array('letter' => 'ASC') ) ); On Sep 3, 4:02 pm, "Dave Maharaj" wrote: > Sorry , my first thought would be to do a looping find->first of each letter > and so if it found a record starting with A set that link true, if nothing > for B then just the letter no link and co on... > > The only problem I see is 26 queries just to build the paging links. > > Other ideas? > > Thanks > > From: Dave Maharaj [mailto:m...@davemaharaj.com] > Sent: September-03-10 6:22 PM > To: cake-php@googlegroups.com > Subject: Alternate Pagination question > > Has anyone created, thought of , started on the idea of an alphabetical > character paging system? > > So rather than 1 | 2 | 3 it spits out A |B |C? > > The ABC part seems rather simple just getting the letters to be links if > there are records for that letter seems to be the real issue. Any ideas on > how to approach this one before I start? > > Thanks, > > Dave > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Query help
Dave, 'conditions' => array('Profile.company LIKE' => $i . '%'), http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html Andras Kende http://www.kende.com/ On Sep 3, 2010, at 5:49 PM, Dave Maharaj wrote: > I have this query in the model > > $params = array( > 'conditions' => array( > 'Profile.company LIKE' => $i.'*'), > 'fields' => array( > 'Profile.company', > 'Profile.id'), > 'contain' => false); > > $this->find('first', $params); > > Where $i is a single letter so I am trying to get the first record starting > with A for example produces this SQL query > > SELECT `Profile`.`company`, `Profile`.`id` FROM `profiles` AS `Profile` WHERE > `Profile`.`company` LIKE 'A*' LIMIT 1 > > And even though I have a Profile.company record in the database starting with > ‘A’ nothing is found. Where am I going wrong? I simply want to find 1 record > where the Profile.company starts with $i. > > Thanks, > > Dave > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Query help
You should use % instead of * On Sep 3, 4:49 pm, "Dave Maharaj" wrote: > I have this query in the model > > $params = array( > > 'conditions' => array( > > 'Profile.company LIKE' => $i.'*'), > > 'fields' => array( > > 'Profile.company', > > 'Profile.id'), > > 'contain' => false); > > $this->find('first', $params); > > Where $i is a single letter so I am trying to get the first record starting > with A for example produces this SQL query > > SELECT `Profile`.`company`, `Profile`.`id` FROM `profiles` AS `Profile` > WHERE `Profile`.`company` LIKE 'A*' LIMIT 1 > > And even though I have a Profile.company record in the database starting > with 'A' nothing is found. Where am I going wrong? I simply want to find 1 > record where the Profile.company starts with $i. > > Thanks, > > Dave Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Null date fields in scaffolding
Hello, I'd like to have date fields that allow null values to default to a null selection in the date/time menus when generating pages from the admin scaffold. I found ticket 5702 that suggests a patch, but that's for Cake 1.2, I wasn't able to work out a fix for 1.3. Has anyone worked this out or is there something I'm missing? Thanks, -aries Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Query help
I have this query in the model $params = array( 'conditions' => array( 'Profile.company LIKE' => $i.'*'), 'fields' => array( 'Profile.company', 'Profile.id'), 'contain' => false); $this->find('first', $params); Where $i is a single letter so I am trying to get the first record starting with A for example produces this SQL query SELECT `Profile`.`company`, `Profile`.`id` FROM `profiles` AS `Profile` WHERE `Profile`.`company` LIKE 'A*' LIMIT 1 And even though I have a Profile.company record in the database starting with 'A' nothing is found. Where am I going wrong? I simply want to find 1 record where the Profile.company starts with $i. Thanks, Dave Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
cakePHP + openid on windows XP
Hi I have use openId component from cakebaker (http://code.42dh.com/ openid/) and when I'm trying to authentificate fom google I'm getting an errors: handleOpenIDResponse Notice (8): Undefined variable: sregContents [APP\controllers \users_controller.php, line 229] Auth_OpenID_FailureResponse Object ( [status] => failure [endpoint] => [identity_url] => [message] => Server denied check_authentication [contact] => [reference] => ) my config is OS Win XP PHP 5.2.12 cakePHP 1.2.6 I have double check is openSSL and curl enabled, also I have added a patch from http://www.pixelastic.com/blog/171:adding-openid-support for windows Maybe someone stuck in the same trouble? I really appreciate any help. Thank you. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
RE: Alternate Pagination question
Sorry , my first thought would be to do a looping find->first of each letter and so if it found a record starting with A set that link true, if nothing for B then just the letter no link and co on... The only problem I see is 26 queries just to build the paging links. Other ideas? Thanks From: Dave Maharaj [mailto:m...@davemaharaj.com] Sent: September-03-10 6:22 PM To: cake-php@googlegroups.com Subject: Alternate Pagination question Has anyone created, thought of , started on the idea of an alphabetical character paging system? So rather than 1 | 2 | 3 it spits out A |B |C? The ABC part seems rather simple just getting the letters to be links if there are records for that letter seems to be the real issue. Any ideas on how to approach this one before I start? Thanks, Dave Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Alternate Pagination question
Has anyone created, thought of , started on the idea of an alphabetical character paging system? So rather than 1 | 2 | 3 it spits out A |B |C? The ABC part seems rather simple just getting the letters to be links if there are records for that letter seems to be the real issue. Any ideas on how to approach this one before I start? Thanks, Dave Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: autotesting with web test cases - brainstorming
a self written crawler basically it collects all links and puts them into two arrays a worklist and a "all links" list after a while there are no new links so the worklist empties itself as soon as its empty the crawler is done On 3 Sep., 21:25, Sam wrote: > Just curious, > What did you use to crawl the urls? > > On Sep 3, 8:09 am, euromark wrote: > > > juhuu > > at least the crawler works now > > after a few minutes he found all 3500 public urls > > > the testsuite then iterates over this array and performs some basic > > tests > > it seems all 3500 pages dont produce any fatal errors, errors, > > warnings or notices :) > > > not sure how to test the backend (user, admin route + specific roles > > (retailer, customer etc)), though > > especially because delete links should not be crawled^^ we dont check > > on post on delete actions yet > > > i'd appreciate any ideas > > thx > > > On 3 Sep., 11:15, euromark wrote: > > > > our application gets bigger and bigger > > > every time we change a component we make sure the test cases for it > > > pass > > > > but often times there might be some unforeseen consequences for the > > > output in the views. > > > i was wondering how this could me automated > > > > ideas: > > > - level 1: build a crawler and index all available views and test them > > > for errors, warnings, ... > > > - level 2: add specific urls not reachable by the crawler > > > - level 3: add manual test cases for backend (logged in) > > > > every time we update the live branch we run the web test > > > > what do you think? a coverage of 99% for all sites checking for any > > > errors and warnings would be a huge help > > > > we could index all urls in a table > > > by using some custom HtmlHelper::url() we could save all generated > > > urls in this table automatically (saves some crawling time). > > > > if we save the differences between tests we could even evaluate those > > > differences compared to the errors occuring etc > > > > the biggest problem as of right now is a suitable crawler... > > > the ones i tried seem not to fit to the framework Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Ajax Pagination - rearrange pages after item deleting
put something like $("#itemlist").load("/items/index/page:$page #itemlist"); into your delete function On 2 Sep., 16:36, "Mariano C." wrote: > Suppose to have 3 page, I delete an object from page 2, so I would > take the first element from page 3 and use it as last element of page > 2, and so on... > > There's an article or tutorial to explain that? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
my happiness!
Dear friend, A good news for you! I bought a laptop from Frioffere. Luckily, I was one of their first 100 customers that day, so they sold it to me at half price. Only 5 days later, I received my laptop. It is really high-quality. Same products, much lower prices! Share my happiness quickly. Come to visit www.frioffere.org They also sell mobiles, cameras and other electronic products. Now they have a promotion: every day the first 100 customers will be given big discount. Good luck! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: autotesting with web test cases - brainstorming
Just curious, What did you use to crawl the urls? On Sep 3, 8:09 am, euromark wrote: > juhuu > at least the crawler works now > after a few minutes he found all 3500 public urls > > the testsuite then iterates over this array and performs some basic > tests > it seems all 3500 pages dont produce any fatal errors, errors, > warnings or notices :) > > not sure how to test the backend (user, admin route + specific roles > (retailer, customer etc)), though > especially because delete links should not be crawled^^ we dont check > on post on delete actions yet > > i'd appreciate any ideas > thx > > On 3 Sep., 11:15, euromark wrote: > > > > > our application gets bigger and bigger > > every time we change a component we make sure the test cases for it > > pass > > > but often times there might be some unforeseen consequences for the > > output in the views. > > i was wondering how this could me automated > > > ideas: > > - level 1: build a crawler and index all available views and test them > > for errors, warnings, ... > > - level 2: add specific urls not reachable by the crawler > > - level 3: add manual test cases for backend (logged in) > > > every time we update the live branch we run the web test > > > what do you think? a coverage of 99% for all sites checking for any > > errors and warnings would be a huge help > > > we could index all urls in a table > > by using some custom HtmlHelper::url() we could save all generated > > urls in this table automatically (saves some crawling time). > > > if we save the differences between tests we could even evaluate those > > differences compared to the errors occuring etc > > > the biggest problem as of right now is a suitable crawler... > > the ones i tried seem not to fit to the framework Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Excel file uploading and converting to csv
You can export to csv directly from excel. http://vegdave.wordpress.com/2007/05/19/import-a-csv-file-to-mysql-via-phpmyadmin/ On Sep 3, 2:11 pm, Muthuvel Subramani wrote: > hello I am new to cakephp.. i need to import files from excel to mysql > database.. so for this i need to upload the excel file... > after uploading i need to convert excel to csv file.. > after converting to csv, i need to import csv file to mysql.. > how should i approach for this scenario.. > thanks.. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Excel file uploading and converting to csv
hello I am new to cakephp.. i need to import files from excel to mysql database.. so for this i need to upload the excel file... after uploading i need to convert excel to csv file.. after converting to csv, i need to import csv file to mysql.. how should i approach for this scenario.. thanks.. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: How to determine if the current page is a Flash() or not
You could probably check $this->Session for that, although I'm not sure, offhand, what to look for. On Fri, Sep 3, 2010 at 10:10 AM, Ernesto wrote: > Hello. > > is there any way to determine if the current page is loaded by a > controller::flash() call? > > i'm working in the controller::beforeRender(). > > Thx > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Ajax Pagination - rearrange pages after item deleting
On Fri, Sep 3, 2010 at 6:35 AM, Mariano C. wrote: > Yes, this is what I do actually. > collection() function create my paginated list, after object removing > I recall collection() function but this display first page of list, > even if during deleting process I was at page 3. Create the link in the view so that it will pass the page number (get it from $this->params['page']) in the AJAX request. Then, adjust the 'page' option when calling paginate(). Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Question about ACL
Hi there. I'm starting with a project which will need the use of ACL to control permissions. These are the tables involved in permissions: Users (a user always will belong to a group) Groups Operations Permissions will be established only between Groups and Operations like: Group 1 are granted access for the Operation 1, Operation 2, and Operation 3. Group 2 are granted access only for Operation 2, and so on. New groups can be added. I just created the db schema for cake acl tables, and I'm noticing that aros_acos table has the fields: _create, _read, _update, _delete which I believe are used for permissions on controllers actions, is this correct? So in my scenario, as I won't establish permissions based on controllers actions, these fields wouldn't be used right? Or am I designing permissions in a wrong way? Thanks in advance Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
How to determine if the current page is a Flash() or not
Hello. is there any way to determine if the current page is loaded by a controller::flash() call? i'm working in the controller::beforeRender(). Thx Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Undefined variable in view
if it is not passed this part of the code in your action is NOT REACHED try die('XYZ') right in front of it you will see that it is probably not even invoked maybe some "return" in front of it? On 3 Sep., 14:10, Richard wrote: > Hello Anja, > > I also did that, returns also 'Undefined variable'. > However I found a way, I added the following function to the > controller: > function beforeRender() { > parent::beforeRender(); > $this->set('categories', $this->Category->find('all', > array('recursive'=>0))); > > } > > This works now as expected, however I do not really understand why it > didn't worked in the first place. > > greeting, Richard > > On 3 sep, 11:58, Anja Liebermann > > > > wrote: > > And how about > > var_dump($categories); > > In the view? > > > Anja > > > -Ursprüngliche Nachricht- > > Von: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] Im > > Auftrag von Richard > > Gesendet: Freitag, 3. September 2010 09:25 > > An: CakePHP > > Betreff: Re: Undefined variable in view > > > Hello Milos, thanks for you reply! If I define the variable in the > > controller as follows it states again that it's undefined in the view. > > > $this->set('categories', 'TestValue'); > > > When I echo the variable in the controller everything looks alright: > > var_dump($this->viewVars['categories']); > > > However it does not pass all of the viewVars for some reason to the view. > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com To > > unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > cake-php+athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: autotesting with web test cases - brainstorming
juhuu at least the crawler works now after a few minutes he found all 3500 public urls the testsuite then iterates over this array and performs some basic tests it seems all 3500 pages dont produce any fatal errors, errors, warnings or notices :) not sure how to test the backend (user, admin route + specific roles (retailer, customer etc)), though especially because delete links should not be crawled^^ we dont check on post on delete actions yet i'd appreciate any ideas thx On 3 Sep., 11:15, euromark wrote: > our application gets bigger and bigger > every time we change a component we make sure the test cases for it > pass > > but often times there might be some unforeseen consequences for the > output in the views. > i was wondering how this could me automated > > ideas: > - level 1: build a crawler and index all available views and test them > for errors, warnings, ... > - level 2: add specific urls not reachable by the crawler > - level 3: add manual test cases for backend (logged in) > > every time we update the live branch we run the web test > > what do you think? a coverage of 99% for all sites checking for any > errors and warnings would be a huge help > > we could index all urls in a table > by using some custom HtmlHelper::url() we could save all generated > urls in this table automatically (saves some crawling time). > > if we save the differences between tests we could even evaluate those > differences compared to the errors occuring etc > > the biggest problem as of right now is a suitable crawler... > the ones i tried seem not to fit to the framework Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Undefined variable in view
Hello Anja, I also did that, returns also 'Undefined variable'. However I found a way, I added the following function to the controller: function beforeRender() { parent::beforeRender(); $this->set('categories', $this->Category->find('all', array('recursive'=>0))); } This works now as expected, however I do not really understand why it didn't worked in the first place. greeting, Richard On 3 sep, 11:58, Anja Liebermann wrote: > And how about > var_dump($categories); > In the view? > > Anja > > -Ursprüngliche Nachricht- > Von: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] Im Auftrag > von Richard > Gesendet: Freitag, 3. September 2010 09:25 > An: CakePHP > Betreff: Re: Undefined variable in view > > Hello Milos, thanks for you reply! If I define the variable in the controller > as follows it states again that it's undefined in the view. > > $this->set('categories', 'TestValue'); > > When I echo the variable in the controller everything looks alright: > var_dump($this->viewVars['categories']); > > However it does not pass all of the viewVars for some reason to the view. > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with > their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com To unsubscribe > from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > cake-php+athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Ajax Pagination - rearrange pages after item deleting
Yes, this is what I do actually. collection() function create my paginated list, after object removing I recall collection() function but this display first page of list, even if during deleting process I was at page 3. On 3 Set, 06:22, Miloš Vučinić wrote: > I think you should refresh your view and then the pagiation should be > set as it is supposed to be. I do not have much experience in Ajax so > I can't really advise you better on how to make your own paginaton .. > > On Sep 2, 4:36 pm, "Mariano C." wrote: > > > > > Suppose to have 3 page, I delete an object from page 2, so I would > > take the first element from page 3 and use it as last element of page > > 2, and so on... > > > There's an article or tutorial to explain that? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
AW: Undefined variable in view
And how about var_dump($categories); In the view? Anja -Ursprüngliche Nachricht- Von: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] Im Auftrag von Richard Gesendet: Freitag, 3. September 2010 09:25 An: CakePHP Betreff: Re: Undefined variable in view Hello Milos, thanks for you reply! If I define the variable in the controller as follows it states again that it's undefined in the view. $this->set('categories', 'TestValue'); When I echo the variable in the controller everything looks alright: var_dump($this->viewVars['categories']); However it does not pass all of the viewVars for some reason to the view. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group cake-php+at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Lots of cakephp warnings in the log
ok i looked in to this a bit more this only happens when I'm not in debug mode and this is becous in the error handling function fron debugger there is this: if (error_reporting() == 0 || $code === 2048 || $code === 8192) { return; } and in the normal production error handling: if ($code === 2048 || $code === 8192) { return; } so in production it doesn't check if error_reporting() is suppressed On Aug 25, 10:15 am, Thunderstriker wrote: > ok i digged a bit deeper and found that even when i remove all queries > (->find, uses, ..) and i check in debug mode the only connection to > the db it makes is for my sessions becous i save my sessions to the db > and i still get thesewarningsbut only wen debug is turned of > > then i switched the sessions to php and the errors where gone but as > soon as i added any model->find they were back > > any ideas? > > On Aug 24, 9:56 pm, Jeremy Burns | Class Outfit > > wrote: > > I'd guess that model->query is your culprit. If it were me I'd want to find > > out what's awry because I'd need to know the impact and fix it. > > > Jeremy Burns > > Class Outfit > > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > > On 24 Aug 2010, at 20:49, Thunderstriker wrote: > > > > there are no errors poping up when debug set to 2 and everiting is > > > working fine > > > i am only using the model->find() and model->query() functions > > > > On 24 aug, 21:26, "j.blotus" wrote: > > >> is there a reason you are running those ms sql functions directly > > >> instead of using model->find() etc? > > > >> On Aug 24, 9:41 am, Thunderstriker wrote: > > > >>> i get a lot ofwarningsin my logs like: > > >>> 2010-08-24 09:34:01 Warning: Warning (2): mssql_num_rows(): supplied > > >>> argument is not a valid MS SQL-result resource in [C:\xampp\htdocs\cake > > >>> \libs\model\datasources\dbo\dbo_mssql.php, line 468] > > >>> 2010-08-24 09:34:01 Warning: Warning (2): mssql_free_result(): > > >>> supplied argument is not a valid MS SQL-result resource in [C:\xampp > > >>> \htdocs\cake\libs\model\datasources\dbo\dbo_mssql.php, line 180] > > >>> 2010-08-24 09:34:01 Warning: Warning (2): mssql_free_result(): > > >>> supplied argument is not a valid MS SQL-result resource in [C:\xampp > > >>> \htdocs\cake\libs\model\datasources\dbo\dbo_mssql.php, line 180] > > > >>> thesewarningsjust overun my log files and make them almost useless. > > >>> i looked up the lines and they used the @ sign to suppress these > > >>> errors like: > > >>> @mssql_free_result($this->results); > > > >>> and still the show up in my log is there anyway to really suppress > > >>> them without changing the cake code? > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > > with their CakePHP related questions. > > > > You received this message because you are subscribed to the Google Groups > > > "CakePHP" group. > > > To post to this group, send email to cake-php@googlegroups.com > > > To unsubscribe from this group, send email to > > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
autotesting with web test cases - brainstorming
our application gets bigger and bigger every time we change a component we make sure the test cases for it pass but often times there might be some unforeseen consequences for the output in the views. i was wondering how this could me automated ideas: - level 1: build a crawler and index all available views and test them for errors, warnings, ... - level 2: add specific urls not reachable by the crawler - level 3: add manual test cases for backend (logged in) every time we update the live branch we run the web test what do you think? a coverage of 99% for all sites checking for any errors and warnings would be a huge help we could index all urls in a table by using some custom HtmlHelper::url() we could save all generated urls in this table automatically (saves some crawling time). if we save the differences between tests we could even evaluate those differences compared to the errors occuring etc the biggest problem as of right now is a suitable crawler... the ones i tried seem not to fit to the framework Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Component code
Hello, You can call a model function from a component. Here's a way to do it: - class MyComponent { private $controller; public function initialize(&$controller) { $this->controller = $controller; } public function my_function() { $this->controller->Order->function(); } } - Just test if $this->controller->Order and/or $this->OrderItem->Order are set, depending on your needs. Regards, Nico On 3 sep, 07:05, Jeremy Burns | Class Outfit wrote: > I should mention that I both read from and write to the session... > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.com > (t) +44 (0) 208 123 3822 > (m) +44 (0) 7973 481949 > Skype: jeremy_burnshttp://www.classoutfit.com > > On 3 Sep 2010, at 06:00, Dave Maharaj wrote: > > > Place the code in the model and pass the Session data as vars from the > > controller? > > > -Original Message- > > From: Jeremy Burns [mailto:jeremybu...@classoutfit.com] > > Sent: September-03-10 2:24 AM > > To: CakePHP > > Subject: Component code > > > I have a chunk of code that appears in two controllers > > (orders_controller and order_items_controller) that is virtually > > identical in each case. I'd like to move it to a single location, so > > this sounds like an ideal candidate for a component. > > > Part of the code calls a function in the Order model, so whilst one > > calls it via $this->Order->function() the other calls it via $this- > >> OrderItem->Order->function(); hence the difference. > > > I could also consider moving the code into the Order model and calling > > it from both controllers, but unfortunately the code also refers to > > $this->Session, which is not allowed in models. > > > So I'm stuck. I can't move it to a component because a component can't > > call a model function, and I can't move it to a model because a model > > can't talk to the Session. > > > Any ideas? > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > >http://groups.google.com/group/cake-php?hl=en > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Undefined variable in view
Hello Milos, thanks for you reply! If I define the variable in the controller as follows it states again that it's undefined in the view. $this->set('categories', 'TestValue'); When I echo the variable in the controller everything looks alright: var_dump($this->viewVars['categories']); However it does not pass all of the viewVars for some reason to the view. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en