Installation Problem: CakePHP 1.2.3.8166 on CENTOS and database.php
Hello all, I'm having a little trouble with a particular installation of cake (1.2.3.8166) I have it running fine on my windows machine but on my Centos machine I get a strange error when renaming the database.php.sample to database.php The messages appear but the wrapper and any associated bits an pieces fail to load (including the validity of the db connection), no errors in the logs - I'm stumped. Anyone else has this problem? Cheers Joel --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
database functionality/design and cake
Hi all, I'm using cake for a CMS system that breaks the page in to blocks that may be html, flash, image etc... So there is a "pages" table, a "blocks" table with "page_id", then the block needs to have detail. So, there are "htmls", "images" and "flashs" tables with "block_id"s to relate them back. However, if i only want the detail for the relevant block type (blocks also has a block_type_id). I could unbind model based on the type, but is there a way to automate this using behaviours or extra model logic? If so is there an advantage (reduced db requests)? If not maybe it doesn't matter if all data is pulled back eve if it is empty. What do you all think? Thanks TWIOF --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: replacement for beforeFilter?
Cool thanks, so that's all you need! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
replacement for beforeFilter?
Hello all, now that cake 1.2 returns: "beforeFilter property usage is deprecated" on class AppController extends Controller { #var $components = array('Auth'); var $beforeFilter = array('funcname'); function funcname() { } } What is the new way of using this type of functionality? Thanks TWIOF --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: mutliple domains on 1 site
Might be easier to do it in the app_controller with a statement to setect the appropriate layour via: var $layout = 'layout_name'; On Apr 2, 12:03 pm, Barry <[EMAIL PROTECTED]> wrote: > How do I set a different layout in the bootstrap.php file? > > On Apr 1, 1:02 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote: > > > > Another more elegant, and much more Cakey approach would be to set the > > > viewPaths in the bootstrap based on the $_SERVER['HTTP_HOST']. > > > Or (still based on $_SERVER['HTTP_HOST']) set a different layout, or > > use ThemeView with the same trick again. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: mutliple domains on 1 site
Thanks Simon, I was arriving at this conclustion myself. I guess I'd use $_SERVER(http_host) to select $useDbConfig in the app model, and set a default files path in app controller. Managing the whole thing from a "root" user controll panel might be tricky. Unless when loged in as root you could pass relevant database selector via a url to the app model. Does this all make sense, or could I be missing a better solution? TWIOF On Apr 2, 10:28 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Another thing we use here is dirty hack includes in config files: > > This is my standard database.php file: > switch (strtolower($_SERVER['SERVER_NAME'])) { > case 'site.local': > case 'site': > include APP . DS . 'config' . DS . 'database_local.php'; > break; > case 'test.site.example.com': > include APP . DS . 'config' . DS . 'database_test.php'; > break; > default: > include APP . DS . 'config' . DS . 'database_live.php'; > break;} > > ?> > > Which we use to save having to mess about with config on deployment. A > similar solution would work for TWIOF's case, and may be the simplest > option. > > Simonhttp://www.simonellistonball.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: mutliple domains on 1 site
I'm after a similar solution, however insted of a different look and feel for different sub-domains I have the following: One CMS managing similar mini sites (all same functionality), each with it's own db and static files (images, styles etc..). So using a separate apps dirs seems a little exessive, would loading separate config files dependent on $_SERVER['HTTP_HOST'] make sense? Also being abale to use a "root" user to add/remove/manage all sites would be usefull (could this user have a separate db, two at once?). Any thoughts much appreciated. Cheers TWIOF --~--~-~--~~~---~--~~ 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 symbols () ! Help
Hi I don't know if anyone else out there gets this problem, on my test server (xampp on pc) all pages and elements render just fine. On most client's servers it's ok too.But on the odd one i get the following symbols appearing at the top of rendered pages or elements. I've been sing notepad++ on pc for editing and have had problems with while space getting in to the tops of files where there should be none. Could this be it? Or is it a server setting? I'm really confused, cheers TWIOF --~--~-~--~~~---~--~~ 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: selectTag with optgroup, how?
OK if anyone elase gets confused over this try this post: http://groups.google.com/group/cake-php/browse_thread/thread/a6d1767796a5af18/a6e4d4b5be99f518?lnk=gst&q=optgroup&rnum=1#a6e4d4b5be99f518 create the new helper and remember to call it using echo $Morehtml->selectOptTag rather than the ususal $html->selecttag --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
selectTag with optgroup, how?
HI everyone, i'm trying to set up a selectTag with optgroupes and have seen this: http://api.cakephp.org/class_html_helper.html#dc661e84e1710023d94691fad33f40ec but what do i put in? $ fieldName, $ optionElements = array(), $ selected = null, $ selectAttr = array(), $ optionAttr = array(), $ showEmpty = true, $ return = false a nested array doesn't work do i need separate arrays for selectAttr and optionAttr? If anyone has an example of this working it would be much appreciated. Cheers TWIOF --~--~-~--~~~---~--~~ 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 with no db - forgotten how
So no need to alter the database.php? Even simpler than i thought! 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 -~--~~~~--~~--~--~---
cake with no db - forgotten how
Hi, I remember setting up cake with no db recently (to use cakes validation and various other helpfull bits) but have forgotten how I did it. I had a search of the group and didn't find much. Any pointers would be much apreciated Thanks TWIOF --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
View this page "redirecting to a completely different site/url"
Click on http://groups.google.com/group/cake-php/web/redirecting-to-a-completely-different-site-url - or copy & paste it into your browser's address bar if that doesn't work. --~--~-~--~~~---~--~~ Group Pages is a new feature of Groups Beta - http://groups-beta.google.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 -~--~~~~--~~--~--~---
redirecting out of the cake dir???
Hi everyone, I have a form that passes data to a url outside the cake dir on the server i'm working on, which in-turn redirects back to the cake site. I can't do it with these: $this->render ($url); or $this->redirect($url); any ideas? Cheers TWIOF --~--~-~--~~~---~--~~ 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 csv files (import? convert to xml? any ideas?)
perfect --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
using csv files (import? convert to xml? any ideas?)
Hi everyone, this doesn't have allot to do with cake directly, but I thought someone out there might have come across a similar problem/solution. I'm trying to incorporate regularly updated csv file into my site. The csv file comes from a ticket selling service. The file is can be downloaded/parsed from their site (it updates 3 times a day). I would like to make this searchable (e.g. type the name of the show, get the relevant data) so it would seem that the obvious solution would be to import it into my database. However, this might not be the most efficient way of doing things as there is allot of data that would be unnecessary (rows and columns). Plus it changes so often i don't want to have to drop and refill the db table so ofen. Is there a way to search csv files with php? Could i convert it to xml and do it that way? Any ideas would be much appreciated. Thanks TWIOF --~--~-~--~~~---~--~~ 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: Still having problems with retrieving data from HABTM relationships.
right i'm getting somewhere, by reffering to the habtm relationship directly* in my model function i get 2 sql queries generated. ONe for the habtm data one for the related model. *return $this->nameOfModel->findAll($conditions, $fields, $order, $limit, null, 1) but this doesn't offer enough controll over the data, what if i want to search data with multipl habtms? I'm sure i'm not explaining this correctly. Would i be better off witht the custom queries? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Still having problems with retrieving data from HABTM relationships.
Hello everyone. I've asked similar Q's before but not found the right solution yet. When retrieving HABTM data a $this->That->findAll() works fine in the controller. BUT, if I use a function in the model it wont get the HABTM data: return $this->findAll($conditions, $fields, $order, $limit, null, 2) it wont work! I've tried various changes to recursive but no joy. Am i doing something wrong. I've resorted to custom queries to get the data i want. I'm using it as part of an Ajax search feature so the data returned at various stages needs to be pretty specific. Hope that all make sense Thanks TWIOF --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Another best practice question.
Hello everyone, my question today regards a search system I'm making. If I retrieve a bunch of results and and want to refine them should I submit a new request to the database OR filter the array? Which method is better for the server and response time of the page. What would you guys do? Cheers TWIOF --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Retrieving HABTM data
My latest problem: I can get data from my HABTM with: $this->set('x', $this->thing->findall()) but can't when using a more specific custom model: $conditions = "(This.that_id = '1') AND (That.active = 'y')"; $fields = array('This.name', 'That.name'); return $this->findAll($conditions, $fields, null, null, null, 0); with "this" and "that" being joined by habtm. When the sql that is produced the first method is fine, but with the second method it doesn't join the habtm stuff. How do I do this, I'm building a search feature and want to search by with basic info from HABTM relationships Thanks in advance TWIOF --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Slightly naughty but is it an acceptable way of doing things?
HI Everyone, I've been making an images system for my site. There are various types of image (e.g. thumb nails and illustrations). As far as the models go an article might use hasOne for the thumb nails and hasMany for illustrations. BUT, i'm using one db table for all images (there won't be that many over all) - so can i have a hasOne and add a condition to only pick thumbs, and a hasMany with a condition only to pick illustrations. I know I should probably separate them into different tables, but would it be that bad? Cheers TWIOF --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Getting data from "hasMany" relationship.
Cheers Mikee, doesn't seem to work though, if i change the relationship top hasOne it finds it. But I'd like to do it with hasMany --~--~-~--~~~---~--~~ 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: 2 noobie questions
Woops, replied to wrong post, thick ot what! --~--~-~--~~~---~--~~ 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: 2 noobie questions
Cheers Christoph, doesn't seem to work though, if i change the relationship top hasOne it finds it. But I'd like to do it with hasMany --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Getting data from "hasMany" relationship.
Hi everyone, I've got a custom model function that gets titles to blog posts (and their "belongs to" data e.g. author). I have related images as "hasMany" but can't call them in a simple fashion... I'm using this in the model: $fields = array('blog.title', 'blog.date', 'author.name'); return $this->findAll($conditions, $fields, $order, $limit, null, 0); This doesn't retrivev data from "hasMany" models, so then I use another function in the Images model to get the relevant images. Is there a way to do it all in the blogs model? Or have I done something wrong? Thanks in advance TWIOF --~--~-~--~~~---~--~~ 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: Can't figure out this Error
Nice one, I've got that sorted in the model (and reduced the number of lines of code/repetition by quite a bit). My final question (i think) is: what is the best way to access the model's function. If i use multiple models on the controllers that need the data will that effect the performance? Is there a downside to using multiple models? (as that look like my easiest fix) Thanks for all you help AD7six, it is much appreciated. TWIOF --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Can't figure out this Error
Thanks for the advice AD7six, I'm still a bit confused. I've not used functions within models before and was wondering if you had a link to an example or turorial (I haven't found any yet) - I think I'm nearly there understanding it. Also, is my current method going to slow the site down alot (in comparison to putting the functions in the controller). It's a revamp of an existing site that gets a fairly large volume of users. (this is probably due to my lack of understanding, but) if the logic comes before the comtroller does that improve performance? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Can't figure out this Error
Thanks AD7six, I think I'm understanding. Although I'm not sure of the best route for my site now. When i request action im doing it to a function like the following, toget an array (no html): in the home page controller: $this->set("listings",$this->requestAction("/listings/tonight")); and that function looks like: function tonight(){ $this->Listing->unbindModel(array('hasMany' => array('Image')));... ... case 'Club': $conditions = "(ltype.name = 'Club') AND (listing.date >= '$today') AND (listing.date < '$nW')"; $fields = array('Ltype.name', 'Listing.name', 'Listing.date', 'Club.name', 'Venue.name'); break; default: $conditions = "(listing.date >= '$today') AND (listing.date < '$nW')"; $fields = array('Ltype.name', 'Listing.name', 'Listing.date', 'Club.name', 'Venue.name'); break; } $order = "Listing.date ASC"; return $this->Listing->findAll($conditions, $fields, $order, 10, null, 0); } I've just tried putting this into the home page controller (using multiple models) and it works fine. But this way (above) I can reuse the code rather than have it repeated on each page. It also lets me use more logic to refine the array. Would a component do this better? Would --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Can't figure out this Error
Figured it out, was a typing error in a switch statement. On another note, how would you query a model directyl? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Can't figure out this Error
Hi, I have a problem with requestAction (i think) i have a number of eements that are used accross various pages that display data from variious requestActions. It worked fine for two controllers, but this one isn't and i can't see why. MAybe because the controller uses a different model? I get the following error: "Warning: array_merge_recursive() [function.array-merge-recursive]: Argument #1 is not an array in C:\wamp\www\mad_final1.0\cake\libs\view\view.php on line 371 Warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\wamp\www\mad_final1.0\cake\libs\view\view.php on line 372 Warning: extract() [function.extract]: First argument should be an array in C:\wamp\www\mad_final1.0\cake\libs\view\view.php on line 571" this is a working controller: class ClubsController extends AppController { var $name = 'Clubs'; var $helpers = array('Html','Javascript', 'Ajax'); function index() { $this->pageTitle = 'Manchester Clubbing'; $this->set('data','Nothing Yet'); $this->set("listings",$this->requestAction("/listings/tonight")); $this->set("recommended",$this->requestAction("/listings/recommended")); $this->set("features",$this->requestAction("/features/short")); $this->set("photoevents",$this->requestAction("/photoevents/shortPE")); $this->set("competitions",$this->requestAction("/competitions/smallComp")); $this->set("madreviews",$this->requestAction("/madreviews/shortRev")); $this->set("userreviews",$this->requestAction("/userreviews/shortRev")); } } this is the broken one: class BarsController extends AppController { var $name = 'Bars'; var $helpers = array('Html', 'Form', 'Javascript', 'Ajax' ); var $uses = 'Venue'; function index() { $this->pageTitle = 'ManchesterAD mk2 Final Dev'; $this->set('data','Nothing Yet'); $this->set("listings",$this->requestAction("/listings/tonight")); $this->set("recommended",$this->requestAction("/listings/recommended")); $this->set("features",$this->requestAction("/features/short")); $this->set("photoevents",$this->requestAction("/photoevents/shortPE")); $this->set("competitions",$this->requestAction("/competitions/smallComp")); $this->set("madreviews",$this->requestAction("/madreviews/shortRev")); $this->set("userreviews",$this->requestAction("/userreviews/shortRev")); } } --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: global variable confsion
Thanks AD7six, I think i was getting side tracked trying to reuse as much code as possible - when it is probably less efficent to do so. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: global variable confsion
That's quite usefull, but i suppose my problem goes a bit further. $currentDir = (explode("/", $_SERVER["REQUEST_URI"])); would change to: $currentDir = (explode("/", $this->here)); it's the way i use it to make different queries depending on the section: if ($currentDir[2] == ''){ $conditions = "(listing.date >= '$today') AND (listing.date < '$nW')"; $fields = array('Ltype.name', 'Listing.name', 'Listing.date', 'Venue.name'); }else{ $ltypeName = substr($currentDir[2], 0, -1); $conditions = "(ltype.name = $ltypeName) AND (listing.date >= '$today') AND (listing.date < '$nW')"; $fields = array('Ltype.name', 'Listing.name', 'Listing.date', 'Venue.name'); } Is it worth making $currentDir a global array? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
global variable confsion
Hi, I'm reusing elements on various pages accross my site and their controller functions need them to perform differnt tasks in each section. To work out the current dir i'm create the following: $currentDir = (explode("/", $_SERVER["REQUEST_URI"])); And use that array to decide what tasks are performed. could $currentDir be global, I can't figure out how to make it so (i have global $currentDir; $currentDir = (explode("/", $_SERVER["REQUEST_URI"])); in my bootstrap.php) can't figure out what next. Is there a more simplke way? Cheers TWIOF --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Debug mysql query confusion
Cheers AD7six, all better now --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Debug mysql query confusion
Hi, I'm refining my controller functions to reduce the load on the server when retreiving data. I've been experimenting with unbinde and recursive to make smaller queries. To check the speed I've set DEBUG to 2,and the output i get confuses me. The number of queries seems to large. The important query is shown last and has sped up, but i get 26 other queries shown with details like "17DESC `userdetails`" and a time taken. It seems to be taking a quick look at all the tables in the bd! I've set recursive to 1 and unbound some models. So why is it making all those samll queries that don't seem to do anything? Hope that makes sense? TWIOF --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Mini Models? Best practice for retrieving small amounts of data.
My current problem: I have a large nightlife listings system, with many db tables all with a lot of relationships. On my index page I want to show small sets of information from a few of the tables. At the moment I'm using requestAction to retrieve the data arrays from various models. The problem is some of those arrays will be huge once the real data is inserted into the db. For example if I want to display 5 imminent events I'm retrieving all related data in an array, when all I need is the date, name and type (stored in only 2 tables, overall the listings table relates to around 5 large tables). The page will have a few other sections like this, so I don't think it would be a good idea to be making really heavy demands on the db on the site's index page. I'm aiming for the minimum load on the server. So, what's the best method for dealing with this? My thinking was a few 'mini' models that don't have all the relationships defined (or maybe even custom queries that only pull out relevant fields). Any ideas would be 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 -~--~~~~--~~--~--~---
Re: Cake error: Warning: Unknown: 1 result set(s) not freed
Nice one, I've got vertrigo running and the errors are gone! However, I no longer seem to be able to run the bake script on the command line, when i access it through command prompt it tries toget me to select a program to open it! Any ideas? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Cake error: Warning: Unknown: 1 result set(s) not freed
Hi I have cake running on apache2triad on windows and i get the following error message on all pages within cake: "Warning: Unknown: 1 result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query() in Unknown on line 0" I don't get it when doing regular php work. Can't figure it out. Does anyone else use apache2triad with cake and get this problem? If so any ideas for a fix? Cheers TWIOF --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: View what scaffolding does?
If you go to: your_server\htdocs\cake_root_dir\cake\scripts\ using command prompt (win) or the shell on linux (i think) and run cake.php you can get it to build the same output as the scaffold, it inserts the controller and view in the appropriate directories. Hope that's what you meant. TWIOF --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
display enum values in dropdown
I Know this has been posted before. I've been using an example from an earlier post but it only produces one of my 5 my options. This is in the model: function generateRatingList() { foreach($this->_tableInfo->value AS $field) { if($field['name'] == 'rating') { $enum = $field['type']; break; } } foreach(split("','", substr($enum, 6, -2)) AS $num => $name) { $return[$name] = $name; return $return; } } and this in the controller: $this->set('ratingArray',$this->Userreview->generateRatingList()); any ideas? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: $javascript->link question
Perfect! 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 -~--~~~~--~~--~--~---
$javascript->link question
Hi, I have a the following code in my default.thtml layout: echo $javascript->link('scriptaculous.js?load=effects') it works on my index page but doesn't on deeper pages. I Get the following error: Notice: Undefined variable: javascript in C:\apache2triad I have also tried: if(isset($javascript)){ echo $javascript->link('common'); echo $javascript->link('prototype'); echo $javascript->link('scriptaculous.js?load=effects'); echo $javascript->link('flashobject'); } which, again, works on the home page but not on any others (it simply doesn't echo the link) Any help would be mutch appreciated TWIOF --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
model conditions - scaffold
Hello all, I've created a model with the following var: var $belongsTo = array('Venue' => array('className' => 'Venue', 'conditions' => "Venue.vtype_id = '3'", 'order' => '', 'foreignKey' => 'veune_id' ), when I view the scaffold index it only displays records with the venue id 3. This is what I want. However, when it comes to adding or editing records it allows me to any venue in the dropdown regardless of its type. Is this a fault on my part or does the scaffolding not go that far? Thanks TWIOF --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: hasAndBelongsToMany scaffolding
fixed, was using incorrectly named tables --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
hasAndBelongsToMany scaffolding
Hi, I've just finnished a db design and I'm just setting cake up to use it with the scaffolding. I'm going well so far witht the belongsTo. I can see all the options for the parent tables in a drop down. So all good there. I'm having difficulty when it comes to hasAndBelongsToMany. The relationship seems fine (no errors reported): var $hasAndBelongsToMany = array('Venue' => array('className' => 'Venue', 'joinTable' => 'btypes_venues', 'foreignKey' => 'btype_id', 'associationForeignKey'=> 'venue_id', 'conditions' => '', 'order' => '', 'limit' => '', 'unique' => true, 'finderSql' => '', 'deleteQuery'=> '' ) ); but the scoffold doesn't offer a select box for Venues, can the scaffold do this, or is it to complicated for it? Or am I doing something wrong? Cheers --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
DB design, Foreign Key, and link tables Confusion
Hi, I'm having a problem with my database design. I'm creating a nightlife listings site and there are a few tables that rely on FK constraints. The most important is the 'listings' table, which stores events that can be viewed from a calendar. The listing can be of a few types e.g. an event at a night club, a gig, a special event at a bar etc... There are tables that hold data about the place that is hosting the event e.g. there are 'clubs' 'bars' and gigs' tables. So, each listing needs a parent in one of these tables, and that's where I'm getting confused. If I give each parent a FK in the listing table there will be problems leaving fields blank, and all listings will only have one parent. I know I could break it up into a separate listings table for each type but I'd like to be able to add types with out having to make a new table each time. Also, with cake how do you name the fields in a link table? Just a bit confused there too. Any advice would be much appreciated. Cheers TWIOF Foreign --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
is cake rihgt for me?
Hi all, I'm about a week into sing cake and like what I've been able to do so far. However, I'm currently a t the early stages of developing a reasonable sized nightlife listings site. And I'm not sure i can achieve everything i need with cake. Basically I'm confused about mixing data from numerous db tables. For example a night club would have a venue, music type, gallerys and user reviews. The music types would be referenced agaist a table holding that data, as would music type. Then the gallery would have to be shown on a link (easy i know), but the reviews in the same page. How would this be approched join the data at the model, or using requestAction's to mix controllers. Most of the examples I've seen are one controller to one db, I'd ideally like multiple dbs to various controllers. e.g many events sharing the same venueetc.. Hope that makes some sort of vague sense Cheers TWIOF --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Is cake right for my needs?
ahh, the var $uses seems to be what i was after, mixed with models using multiple dbs and some requestaction stuff too. Nice one --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Is cake right for my needs?
Cheers Dieter, I meant to say tables reather than dbs, I've been making that mistake for two years (foolish I know), I'll have to check that part of the manual more closely. One quick question, how do yhou create controllers with no model? Is it in the manual? Joel --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---