Re: semicolon usage in views
This has nothing to do with cake and everything to do with php for e.g. in any php file the following will work: but this won't The parser automatically assumes that if you close the tag you meant to put a semicolon there. Dustin Weber wrote: > Tried searching for this, but it's a tough search to refine. > > Basically, I am simply trying to understand when/if we need semicolons > in a view when using a helper. In fact, I've noticed that I don't > even need the semicolon when just 'echoing' a var in a view, so it > isn't just related to helpers. > > It's something I had never much paid attention to (probably b/c it > didn't throw any errors, so simply didn't notice). > > So, in simple terms: > > > ...seems to work the exact same as: > > (notice the missing semicolon) > And: > input('Widget/searchBox', array('size' => '30')); ?> > ...seems to work the exact same as: > input('Widget/searchBox', array('size' => '30')) ?> > > So, I assume Cake is doing some error checking for us? However, is > this a feature (ie: should I assume I never have to type the > semicolons again in the views), or should I still add them so that I > am following the rules? > > The manual isn't clear on this in it's examples. For instance, I > pulled this code directly out of the helper section of the manual: > - > ... > $html->textarea('Note/body', array('cols'=>'60', 'rows'=>'10')); > ?> > tagErrorMsg('Note/body', > 'Please enter in a body for this note.') ?> > ... > - > (notice the semicolon inconsistency) > > > Thanks for any help in advance! > > Dustin Weber > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cakephp 1.2 paginate
Thanks Tarique, your response is appreciated. */Jeremy Pointer/* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Dr. Tarique Sani wrote: > On 4/17/07, Jeremy Pointer <[EMAIL PROTECTED]> wrote: > >> I don't know what it is guys but every one of my questions I've asked so >> far seems to take a fair while to get answered (Maybe I'm asking them >> wrong, or maybe my problems are too complicated (or too stupid) and yes >> > > You are playing with Cake 1.2 which very few other than the core > developers know inside out so even though your problems are simple, > may be no one has encountered them before > > HTH > Tarique > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cakephp 1.2 paginate
For anyone interested I solved/got around this problem myself see https://trac.cakephp.org/ticket/2457 */Jeremy Pointer/* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Jeremy Pointer wrote: > I don't know what it is guys but every one of my questions I've asked so > far seems to take a fair while to get answered (Maybe I'm asking them > wrong, or maybe my problems are too complicated (or too stupid) and yes > I know we are all volunteers here so I'm not complaining just wondering > if there is something I can do to make my questions clearer), anyway as > it is I did spot a few bits of fog in last nights question when I reread > it, so I'm replying to myself to clarify a little. Comments in between > original question. > > */Jeremy Pointer/* > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > > Jeremy Pointer wrote: > >> In my orders controller I have the following (The idea is to use the >> orders index view to show a list of orders for a contact, the contact >> could be a patient or an Audiologist (If it's an audiologist they might >> be the dispensing or delivery audiologist (don't ask I also thought it >> was madness but anyway thats what the client needs)) I call this with a >> requestAction in the view. Mainly because I can't quite figure how to do >> this properly in the model for contacts I have the Orders model set up >> with BelongsTo for each contact type but my brain ain't working to work >> the other way around. >> belongsTo of order.php model >> var $belongsTo = array( >> >> 'DispensingPractice'=>array('className'=>'Practice','foreignKey'=>'disp_practice_id',), >>'DispensingAudiologist'=>array('className'=>'Contact', >> >> 'foreignKey'=>'disp_contact_id', >> >> 'conditions'=>"`DispensingAudiologist`.`type`='Audiologist'"), >> >> 'DeliveryPractice'=>array('className'=>'Practice','foreignKey'=>'deliv_practice_id'), >> >> 'DeliveryAudiologist'=>array('className'=>'Contact','foreignKey'=>'deliv_contact_id', >> >> 'conditions'=>"`DeliveryAudiologist`.`type`='Audiologist'"), >> >> 'Patient'=>array('className'=>'Contact','foreignKey'=>'patient_id', >> >> 'conditions'=>"`Patient`.`type`='Patient'"), >> ); >> >> >> > In my orders_controller I have : > >>function OrdersByContact($id) { >> $this->Order->recursive = 0; >> >> $conditions=array('OR'=>array("Order.patient_id"=>$id,"Order.disp_contact_id"=>$id,"Order.deliv_contact_id"=>$id)); >> >> $orders=$this->paginate('Order',array('conditions'=>$conditions)); >> if (!isset($type) || $type=='') $type='%'; >> $this->set(compact('orders','type')); >> $this->render('index'); >> } >> >> This generates the count query as below and a similar full query, >> unfortunately mysql is choking on this query I have to kill the process: >> >> SELECT COUNT(*) AS count FROM `orders` AS `Order` LEFT JOIN `practices` >> AS `DispensingPractice` ON (`Order`.`disp_practice_id` = >> `DispensingPractice`.`id`) LEFT JOIN `contacts` AS >> `DispensingAudiologist` ON (`DispensingAudiologist`.`type`='Audiologist' >> AND `Order`.`disp_contact_id` = `DispensingAudiologist`.`id`) LEFT JOIN >> `practices` AS `DeliveryPractice` ON (`Order`.`deliv_practice_id` = >> `DeliveryPractice`.`id`) LEFT JOIN `contacts` AS `DeliveryAudiologist` >> ON (`DeliveryAudiologist`.`type`='Audiologist' AND >> `Order`.`deliv_contact_id` = `DeliveryAudiologist`.`id`) LEFT JOIN >> `contacts` AS `Patient` ON (`Patient`.`type`='Patient' AND >> `Order`.`patie
Re: Only showing debug on main layout?
It's not exactly what you're asking but maybe it will help, I needed something similar for 'autocomplete' actions in the controller I ended up with some help from othersnputting the following in app_controller and calling it from the action for which I don't want debugging. function debugoff() { $db =& ConnectionManager::getInstance(); $connected =& $db->getDataSource('default'); $connected->debug = false; $connected->fullDebug = false; } */Jeremy Pointer/* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Tane Piper wrote: > Hey folks, > > Quick question. I'm using jQuery, rather than the Ajax helper to do > all my Ajax stuff on my site. I'm wondering if during debug mode > there is a way to switch off the queries table at the bottom of each > view that loads, and maybe even do an ajax update on that area for > each view that's loaded? > > It just looks messy and causes problems with my layout. If not I > suppose my only alternative it to test with JS disabled so it handles > normall, switch off debug once I'm happy then test Ajax? > > Thanks if anyone can give me some advice on this. > > Tane > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cakephp 1.2 paginate
I don't know what it is guys but every one of my questions I've asked so far seems to take a fair while to get answered (Maybe I'm asking them wrong, or maybe my problems are too complicated (or too stupid) and yes I know we are all volunteers here so I'm not complaining just wondering if there is something I can do to make my questions clearer), anyway as it is I did spot a few bits of fog in last nights question when I reread it, so I'm replying to myself to clarify a little. Comments in between original question. */Jeremy Pointer/* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Jeremy Pointer wrote: > In my orders controller I have the following (The idea is to use the > orders index view to show a list of orders for a contact, the contact > could be a patient or an Audiologist (If it's an audiologist they might > be the dispensing or delivery audiologist (don't ask I also thought it > was madness but anyway thats what the client needs)) I call this with a > requestAction in the view. Mainly because I can't quite figure how to do > this properly in the model for contacts I have the Orders model set up > with BelongsTo for each contact type but my brain ain't working to work > the other way around. > belongsTo of order.php model > var $belongsTo = array( > > 'DispensingPractice'=>array('className'=>'Practice','foreignKey'=>'disp_practice_id',), >'DispensingAudiologist'=>array('className'=>'Contact', > > 'foreignKey'=>'disp_contact_id', > > 'conditions'=>"`DispensingAudiologist`.`type`='Audiologist'"), > > 'DeliveryPractice'=>array('className'=>'Practice','foreignKey'=>'deliv_practice_id'), > > 'DeliveryAudiologist'=>array('className'=>'Contact','foreignKey'=>'deliv_contact_id', > > 'conditions'=>"`DeliveryAudiologist`.`type`='Audiologist'"), > > 'Patient'=>array('className'=>'Contact','foreignKey'=>'patient_id', > > 'conditions'=>"`Patient`.`type`='Patient'"), > ); > > In my orders_controller I have : >function OrdersByContact($id) { > $this->Order->recursive = 0; > > $conditions=array('OR'=>array("Order.patient_id"=>$id,"Order.disp_contact_id"=>$id,"Order.deliv_contact_id"=>$id)); > > $orders=$this->paginate('Order',array('conditions'=>$conditions)); > if (!isset($type) || $type=='') $type='%'; > $this->set(compact('orders','type')); > $this->render('index'); > } > > This generates the count query as below and a similar full query, > unfortunately mysql is choking on this query I have to kill the process: > > SELECT COUNT(*) AS count FROM `orders` AS `Order` LEFT JOIN `practices` > AS `DispensingPractice` ON (`Order`.`disp_practice_id` = > `DispensingPractice`.`id`) LEFT JOIN `contacts` AS > `DispensingAudiologist` ON (`DispensingAudiologist`.`type`='Audiologist' > AND `Order`.`disp_contact_id` = `DispensingAudiologist`.`id`) LEFT JOIN > `practices` AS `DeliveryPractice` ON (`Order`.`deliv_practice_id` = > `DeliveryPractice`.`id`) LEFT JOIN `contacts` AS `DeliveryAudiologist` > ON (`DeliveryAudiologist`.`type`='Audiologist' AND > `Order`.`deliv_contact_id` = `DeliveryAudiologist`.`id`) LEFT JOIN > `contacts` AS `Patient` ON (`Patient`.`type`='Patient' AND > `Order`.`patient_id` = `Patient`.`id`) LEFT JOIN `repairorders` AS > `Repairorder` ON (`Repairorder`.`order_id` = `Order`.`id` AND ( > `Order`.`patient_id` = 594) OR ( `Order`.`disp_contact_id` = 594) OR ( > `Order`.`deliv_contact_id` = 594)) LEFT JOIN `hearingaidorders` AS > `Hearingaidorder` ON (`Hearingaidorder`.`order_id` = `Order`.`id` AND ( > `Order`.`patient_id` = 594) OR ( `Order`.`disp_contact_id` = 594) OR ( > `Order`.`deliv_contact_id` = 594)) WHERE (`Order`.`patient_id` = 594) OR > (`Order`.`d
Cakephp 1.2 paginate
In my orders controller I have the following (The idea is to use the orders index view to show a list of orders for a contact, the contact could be a patient or an Audiologist (If it's an audiologist they might be the dispensing or delivery audiologist (don't ask I also thought it was madness but anyway thats what the client needs)) I call this with a requestAction in the view. Mainly because I can't quite figure how to do this properly in the model for contacts I have the Orders model set up with BelongsTo for each contact type but my brain ain't working to work the other way around. belongsTo of order.php model var $belongsTo = array( 'DispensingPractice'=>array('className'=>'Practice','foreignKey'=>'disp_practice_id',), 'DispensingAudiologist'=>array('className'=>'Contact', 'foreignKey'=>'disp_contact_id', 'conditions'=>"`DispensingAudiologist`.`type`='Audiologist'"), 'DeliveryPractice'=>array('className'=>'Practice','foreignKey'=>'deliv_practice_id'), 'DeliveryAudiologist'=>array('className'=>'Contact','foreignKey'=>'deliv_contact_id', 'conditions'=>"`DeliveryAudiologist`.`type`='Audiologist'"), 'Patient'=>array('className'=>'Contact','foreignKey'=>'patient_id', 'conditions'=>"`Patient`.`type`='Patient'"), ); function OrdersByContact($id) { $this->Order->recursive = 0; $conditions=array('OR'=>array("Order.patient_id"=>$id,"Order.disp_contact_id"=>$id,"Order.deliv_contact_id"=>$id)); $orders=$this->paginate('Order',array('conditions'=>$conditions)); if (!isset($type) || $type=='') $type='%'; $this->set(compact('orders','type')); $this->render('index'); } This generates the count query as below and a similar full query, unfortunately mysql is choking on this query I have to kill the process: SELECT COUNT(*) AS count FROM `orders` AS `Order` LEFT JOIN `practices` AS `DispensingPractice` ON (`Order`.`disp_practice_id` = `DispensingPractice`.`id`) LEFT JOIN `contacts` AS `DispensingAudiologist` ON (`DispensingAudiologist`.`type`='Audiologist' AND `Order`.`disp_contact_id` = `DispensingAudiologist`.`id`) LEFT JOIN `practices` AS `DeliveryPractice` ON (`Order`.`deliv_practice_id` = `DeliveryPractice`.`id`) LEFT JOIN `contacts` AS `DeliveryAudiologist` ON (`DeliveryAudiologist`.`type`='Audiologist' AND `Order`.`deliv_contact_id` = `DeliveryAudiologist`.`id`) LEFT JOIN `contacts` AS `Patient` ON (`Patient`.`type`='Patient' AND `Order`.`patient_id` = `Patient`.`id`) LEFT JOIN `repairorders` AS `Repairorder` ON (`Repairorder`.`order_id` = `Order`.`id` AND ( `Order`.`patient_id` = 594) OR ( `Order`.`disp_contact_id` = 594) OR ( `Order`.`deliv_contact_id` = 594)) LEFT JOIN `hearingaidorders` AS `Hearingaidorder` ON (`Hearingaidorder`.`order_id` = `Order`.`id` AND ( `Order`.`patient_id` = 594) OR ( `Order`.`disp_contact_id` = 594) OR ( `Order`.`deliv_contact_id` = 594)) WHERE (`Order`.`patient_id` = 594) OR (`Order`.`disp_contact_id` = 594) OR (`Order`.`deliv_contact_id` = 594) If however I remove the additional conditions from the JOIN ON's and only keep them in the WHERE and run the query manually mysql does not choke.So I wonder : a) why does paginate generate the conditions in every JOIN clause b) Is there a way for me to remove them. c) Should I set up the model better ( I haven't got a contact->orders relationship set up in my contact model if I wanted to what would it need to look like.) d) should that belongsTo be a hasOne? would it make any difference -- */Jeremy Pointer/* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> --~--~-~--~~~---~--~~ 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: XML output from cake controller/view
digital spaghetti wrote: > Instead of your method, check out this tutorial: > > http://bakery.cakephp.org/articles/view/2 > > Its an old article, but still works perfectly in Cake 1.2 > I had already tried that method i.e. created an xml layout with just header() and print("?xml but I was still getting the space all that example does is move the output from the view to layout+view. As it happens a new day brought an answer I simply removed the part from the output and problem solved, I'd still like to know where the space is coming from though. > Tane > > On 4/2/07, Jeremy Pointer <[EMAIL PROTECTED]> wrote: > >> I'm trying to output an xml document but I seem to be getting a space >> character just before > receiving the data (not mine) to cough and splutter and die. >> >> In my controller I am setting $this->layout=false; and my view is: >> > header("Content-type:text/xml"); >> print (""); >> print(""); >> foreach ($rows as $row) print("".$row['table']['field'].""); >> print(""); >> ?> >> >> DEBUG is 0 I also tried removing all beforeFilter and beforeRender >> settings in app_controller and the controller that calls this with no luck. >> >> Any ideas why I am getting a space, is there a different/better way to >> output XML. >> >> -- >> */Jeremy Pointer/* >> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >> >> > > > -- */Jeremy Pointer/* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
XML output from cake controller/view
I'm trying to output an xml document but I seem to be getting a space character just before layout=false; and my view is: "); print(""); foreach ($rows as $row) print("".$row['table']['field'].""); print(""); ?> DEBUG is 0 I also tried removing all beforeFilter and beforeRender settings in app_controller and the controller that calls this with no luck. Any ideas why I am getting a space, is there a different/better way to output XML. -- */Jeremy Pointer/* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> --~--~-~--~~~---~--~~ 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 prototype question
You Can't use and include js betweeen the script tags, i.e. you need this <html> <head> <title>Test</title> <script type="text/javascript" src="app/webroot/js/prototype.js"> function execute() { var item = $('sample'); Element.update(item, "Hello!"); } element element2 Click skyblueink wrote: > I know this is not a CakePHP problem, but related to it. The simple > example below does not work in IE and FireFox. I don't why, but the > PHPEd debugger gives a messge "OBJECT is required". I have some > experiences in using prototype in CakePHP, but I'm trying to go more > deep into prototype by learning itself. > > > > Test > http://localhost/test/</a> > prototype.js"> > function execute() { > var item = $('sample'); > Element.update(item, "Hello!"); > } > > > > > element > element2 > Click > > > > > > -- */Jeremy Pointer/* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> MSN: [EMAIL PROTECTED] My status Get Skype <http://www.skype.com/go/download> and call me for free. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Jeremy Pointer n:Pointer;Jeremy adr:;;Box 499;Krugersdorp;Gauteng;1740;South Africa email;internet:[EMAIL PROTECTED] tel;work:+27 11 665-2445 tel;fax:+27 86 5013109 tel;cell:+27 82 3724769 x-mozilla-html:TRUE version:2.1 end:vcard
Re: Autocompletion Options
It seems like you helped yourself a fair deal once you got started :-), I hadn't answered the other questions because I didn't have an immediate answer and have been too busy working on other things to spend any time on it. Anyway glad to give you the *jerm* that *pointer* you in the right direction to *worm* your way to an answer. */Jeremy Pointer/* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> robert.fulcher wrote: > I think I have everything working. To change the look of the > autocomplete I had to get the CSS and place it into the page that it > is being used in. I was unaware that I could look at the > script.aculo.us web site for details on things such as this. > > thanks for the help JermWorm > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Jeremy Pointer n:Pointer;Jeremy adr:;;Box 499;Krugersdorp;Gauteng;1740;South Africa email;internet:[EMAIL PROTECTED] tel;work:+27 11 665-2445 tel;fax:+27 86 5013109 tel;cell:+27 82 3724769 x-mozilla-html:TRUE version:2.1 end:vcard
Re: IIS reloaded with 1.2
Chambrln wrote: > Do you have Javascript as one of your helpers? That kind of sounds > like the problem, but not sure since I don't know the whole error. > Yes I do, as I said the application is working fine on my two apache based servers (one on linux and one on windows), it's only on the server where I'll be deploying to that there seems to be a problem. Seeing as deployment is only scheduled in another 2-4 weeks I'll only tackle the problem in detail later. I'm was just asking the question now to be prepared, if the worst comes to the worst I'll have them running from my server in the interim. > On Mar 27, 2:41 pm, Jeremy Pointer <[EMAIL PROTECTED]> wrote: > >> I already had that line uncommented, right now it seems to sort of run >> I'm getting php errors about $javascript not being an object which I >> imagine is due to the includes not finding the right paths, seeing as >> the IIS server is the server I am going to have to deploy on I do need >> to solve this problem, but in the meantime my apache based development >> and demo servers are working fine having deleted all the .htaccess >> files. It's something I'll dig into in a bit more detail in another week >> or so, in the meantime any other pointers would be appreciated. >> >> >> >> Chambrln wrote: >> >>> I am currently using 1.2 with IIS as well. I do not have ISAPI >>> Rewrite configured for use at the moment and was having similar >>> problems. >>> >>> There is a Constant defined in /app/config/core.php that you need to >>> uncomment on line 40 - define ('BASE_URL', env('SCRIPT_NAME')); >>> >>> This basically tells cake to use the full paths for any mode/action >>> you specify on forms or links. You don't get pretty URLs, but you do >>> get a working site. >>> >>> On Mar 26, 10:21 am, Jeremy Pointer <[EMAIL PROTECTED]> wrote: >>> >>>> Can anyone point me in the right direction to get 1.2 working on an IIS >>>> server without url rewriting and over which I have no control other than >>>> uploading pages, I've tried searching but either the links point to the >>>> discontinued wiki, or to someones blog from early last year on which I >>>> can't find the info. >>>> >>>> I know that somewhere along the line (probably with 1.1) I just had to >>>> set an IIS define in core/bootstrap. Is that still valid, if so where. >>>> >>>> BTW whatever I do I still need the app to work on my own apache server >>>> (preferably without having to be careful not to overwrite a file). >>>> -- >>>> */Jeremy Pointer/* >>>> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >>>> >>>> jerm.vcf >>>> 1KDownload >>>> >> -- >> */Jeremy Pointer/* >> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >> >> jerm.vcf >> 1KDownload >> > > > > -- */Jeremy Pointer/* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> MSN: [EMAIL PROTECTED] My status Get Skype <http://www.skype.com/go/download> and call me for free. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Jeremy Pointer n:Pointer;Jeremy adr:;;Box 499;Krugersdorp;Gauteng;1740;South Africa email;internet:[EMAIL PROTECTED] tel;work:+27 11 665-2445 tel;fax:+27 86 5013109 tel;cell:+27 82 3724769 x-mozilla-html:TRUE version:2.1 end:vcard
Re: Autocompletion Options
Below is an almost exactly similar question and my previous answer. HTH robert.fulcher wrote: > I want to use the autocomplete componenet and was wondering how to use > the options. I want to use it with a lookup field. I have a contact > that I want to assign a company to. I have it where I can lookup the > company by name in the autocomplete field. I need to assign a value > of the id from the company to a field to be submitted to the > controller. Anyone know how to do that. > > Thanks > > > > This is from something I did, No change in the controller but I've modified the below views, the key is to set the user id as the id of the tag in autocomplet, and then have a 'user_id' input and a touch of javascritpt in the send view to update the id field, then set the 'afterUpdateElement' option in $ajax->autocomplete() autocomplete.thtml: send.thtml: input('Message/user_id'); ?> function getSelectionId(text, li) { alert(li.id); document.getElementById('MessageUserId').value=li.id; } autocomplete('Message/user','/contacts/autocomplete', array('size' => 40, 'afterUpdateElement'=>'getSelectionId' ) ); ?> textarea('Message/message', array('cols' => '60', 'rows' => '10')); ?> submit('Send');?> HTH JermWorm Mike Griffin wrote: > On 3/16/07, fredBH <[EMAIL PROTECTED]> wrote: > >> can you post the code ? >> > > Sure, here is the sutocomplete.thtml file. It returns the username > and then the full name in brackets > > > '.$user['User']['lname'].')'; ?> > > > > The form is in send.thtml > > > autocomplete('Message/user', > '/Messages/autocomplete', array('size' => 40)); ?> > > textarea('Message/message', array('cols' => '60', > 'rows' => '10')); ?> > > submit('Send');?> > > > > And the autocomplete function from the messages controller: > function autocomplete() { > $this->set('users', $this->User->findAll(array('User.username' => > 'LIKE '.$this->data['Message']['user'].'%'), array('User.username', > 'User.fname', 'User.lname', 'User.id'), 'username DESC',null, null, > 0)); > $this->layout = "ajax"; > } > > So the function returns the User.id but I cant see how to pass that to > the view and back again. > > Mike. > > --~--~-~--~~~---~--~~ > 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 > -~--~~~~--~~--~--~--- > -- */Jeremy Pointer/* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Jeremy Pointer n:Pointer;Jeremy adr:;;Box 499;Krugersdorp;Gauteng;1740;South Africa email;internet:[EMAIL PROTECTED] tel;work:+27 11 665-2445 tel;fax:+27 86 5013109 tel;cell:+27 82 3724769 x-mozilla-html:TRUE version:2.1 end:vcard
Re: IIS reloaded with 1.2
I already had that line uncommented, right now it seems to sort of run I'm getting php errors about $javascript not being an object which I imagine is due to the includes not finding the right paths, seeing as the IIS server is the server I am going to have to deploy on I do need to solve this problem, but in the meantime my apache based development and demo servers are working fine having deleted all the .htaccess files. It's something I'll dig into in a bit more detail in another week or so, in the meantime any other pointers would be appreciated. Chambrln wrote: > I am currently using 1.2 with IIS as well. I do not have ISAPI > Rewrite configured for use at the moment and was having similar > problems. > > There is a Constant defined in /app/config/core.php that you need to > uncomment on line 40 - define ('BASE_URL', env('SCRIPT_NAME')); > > This basically tells cake to use the full paths for any mode/action > you specify on forms or links. You don't get pretty URLs, but you do > get a working site. > > > On Mar 26, 10:21 am, Jeremy Pointer <[EMAIL PROTECTED]> wrote: > >> Can anyone point me in the right direction to get 1.2 working on an IIS >> server without url rewriting and over which I have no control other than >> uploading pages, I've tried searching but either the links point to the >> discontinued wiki, or to someones blog from early last year on which I >> can't find the info. >> >> I know that somewhere along the line (probably with 1.1) I just had to >> set an IIS define in core/bootstrap. Is that still valid, if so where. >> >> BTW whatever I do I still need the app to work on my own apache server >> (preferably without having to be careful not to overwrite a file). >> -- >> */Jeremy Pointer/* >> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >> >> jerm.vcf >> 1KDownload >> > > > > -- */Jeremy Pointer/* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Jeremy Pointer n:Pointer;Jeremy adr:;;Box 499;Krugersdorp;Gauteng;1740;South Africa email;internet:[EMAIL PROTECTED] tel;work:+27 11 665-2445 tel;fax:+27 86 5013109 tel;cell:+27 82 3724769 x-mozilla-html:TRUE version:2.1 end:vcard
HABTM update with extra fields cake php 1.2
I searched high and low but couldn't really find a proper answer for doing this so with a bit of fiddling I managed to get something going. What I wanted was a way to have the equivalent of $form->input('Modelb/Modelb',.) but also with the extra column data in a table. I didn't get much clue from what to do in the view from the info I could find (I did notice Nate mentioning the 'with' option for habtm in the model) So after some fiddling I ended up setting an extra $modelb variable holding all the records from modelb and looping through that to show my 'options': In the controller: $modelb = $this->Modela->Modelb->findAll(); And in the view: (yes I know it's messy but it's late and I'm tired, suggestions for better way are more than welcome) data['Modelb'] as $cModelb) { if ($cModelb['id']==$modelb['Modelb']['id']) { // We have the right module $ModelaModelb=$cModule['Modelamodelb]; } } ?> value="1" /> value="1" /> So far so good except that on saving I was getting errors from trying to convert arrays to text, and then insert errors (came from model.php : __saveMulti). So I copied the function __saveMulti($joined, $id) into my model and modified the bit inside if (!empty($update)) {...} it so it now looks like this: if (!empty($update)) { $values[] = $db->value($id, $this->getColumnType($this->primaryKey)); if (is_array($update)) { $values[] = $db->value($key); foreach ($update as $fld => $val) { $keys[]='`'.$fld.'`'; $values[]=$db->value($val); } $aFields[$assoc][] = $fields[$assoc]. ','.join(',', $keys); unset($keys); } else { $values[] = $db->value($update); $aFields[$assoc][]=$fields[$assoc]; } $values= join(',', $values); $newValues[] = "({$values})"; unset ($values); } And then the $db->query for inserting is like so: $db->query("INSERT INTO {$table} ({$aFields[$loopAssoc][$x]}) VALUES {$newValue[$loopAssoc][$x]}"); I haven't tested my __saveMulti anywhere else but I can't see why it wouldn't work as normal everywhere else. Okay so having found a solution, two/three questions, 1. Is there a better way I can do the view bit. 2. Is there a better way instead of messing with __saveMulti, 2.5if not could I ask that someone more knowledgable than me get this submitted into model.php sometime in the future. -- */Jeremy Pointer/* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Jeremy Pointer n:Pointer;Jeremy adr:;;Box 499;Krugersdorp;Gauteng;1740;South Africa email;internet:[EMAIL PROTECTED] tel;work:+27 11 665-2445 tel;fax:+27 86 5013109 tel;cell:+27 82 3724769 x-mozilla-html:TRUE version:2.1 end:vcard
IIS reloaded with 1.2
Can anyone point me in the right direction to get 1.2 working on an IIS server without url rewriting and over which I have no control other than uploading pages, I've tried searching but either the links point to the discontinued wiki, or to someones blog from early last year on which I can't find the info. I know that somewhere along the line (probably with 1.1) I just had to set an IIS define in core/bootstrap. Is that still valid, if so where. BTW whatever I do I still need the app to work on my own apache server (preferably without having to be careful not to overwrite a file). -- */Jeremy Pointer/* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Jeremy Pointer n:Pointer;Jeremy adr:;;Box 499;Krugersdorp;Gauteng;1740;South Africa email;internet:[EMAIL PROTECTED] tel;work:+27 11 665-2445 tel;fax:+27 86 5013109 tel;cell:+27 82 3724769 x-mozilla-html:TRUE version:2.1 end:vcard
Re: findAllThreaded - The thread order output is different then expected
Message with id 6481 has the parent_id as 6263 it needs to have parent_id of 6469 Humble wrote: > Hi, > >I archived yahoo group messages and trying to display the messages > in thread format as yahoo group does. > >For eg. > >Original order > >Message 1 > Message 409 > Message 6263 >Message 6266 > Message 6469 >Message 6481 > Message 13728 > > I have table data as > > id parent_id thread_id sent_on > == > 1 0 1 2002-03-20 20:19:35 > 409 1 1 2003-01-10 18:47:15 > 62631 1 2005-04-02 09:15:45 > 626662631 2005-04-03 13:18:09 > 64691 1 2005-04-28 12:36:23 > 648162631 2005-05-02 05:21:15 > 13728 1 1 2006-09-15 04:18:44 > > But the findAllThreaded returns > > Message 1 > Message 409 > Message 6263 >Message 6266 >Message 6481 <-- This should come below 6469. > Message 6469 > Message 13728 > > I tried order by the message date, still it shows up this way. Is > there any way I can fix this issue? > > TIA > > > > -- */Jeremy Pointer/* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> MSN: [EMAIL PROTECTED] My status Get Skype <http://www.skype.com/go/download> and call me for free. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Jeremy Pointer n:Pointer;Jeremy adr:;;Box 499;Krugersdorp;Gauteng;1740;South Africa email;internet:[EMAIL PROTECTED] tel;work:+27 11 665-2445 tel;fax:+27 86 5013109 tel;cell:+27 82 3724769 x-mozilla-html:TRUE version:2.1 end:vcard
Re: webroot
Fix the data ? SQL> update table set fieldname=replace(fieldname,'src="img/"','src="chocolate_cake/img/"); korcs wrote: > Hi, > > I have a little problem with my webroot. > > I have my whole cake dir structure in a dir called 'cholocate_cake'. > > I am using a database, where the html code of the pages stored. > This code contains some links and images as well. > > All of these links and images are working with relative adresses (f.e. > for images: 'src="img/picture.jpg"', where the picture.jpg is in the > './img/' directory). > > Now I found, that when I copy the content of the old img directory > into the app/webroot/img directory, then the pictures are not > displayed. Only if I change the links to 'src="chocolate_cake/img/ > picture.jpg"'. > > Do you know which is an elegant solution for this? > > Best, > > korcs > > > > -- */Jeremy Pointer/* <mailto:[EMAIL PROTECTED]> --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Jeremy Pointer n:Pointer;Jeremy adr:;;Box 499;Krugersdorp;Gauteng;1740;South Africa email;internet:[EMAIL PROTECTED] tel;work:+27 11 665-2445 tel;fax:+27 86 5013109 tel;cell:+27 82 3724769 x-mozilla-html:TRUE version:2.1 end:vcard
Re: Autocomplete on 1.1.13
Isn't it a small world This is from something I did, No change in the controller but I've modified the below views, the key is to set the user id as the id of the tag in autocomplet, and then have a 'user_id' input and a touch of javascritpt in the send view to update the id field, then set the 'afterUpdateElement' option in $ajax->autocomplete() autocomplete.thtml: send.thtml: input('Message/user_id'); ?> function getSelectionId(text, li) { alert(li.id); document.getElementById('MessageUserId').value=li.id; } autocomplete('Message/user','/contacts/autocomplete', array('size' => 40, 'afterUpdateElement'=>'getSelectionId' ) ); ?> textarea('Message/message', array('cols' => '60', 'rows' => '10')); ?> submit('Send');?> HTH JermWorm Mike Griffin wrote: > On 3/16/07, fredBH <[EMAIL PROTECTED]> wrote: > >> can you post the code ? >> > > Sure, here is the sutocomplete.thtml file. It returns the username > and then the full name in brackets > > > '.$user['User']['lname'].')'; ?> > > > > The form is in send.thtml > > > autocomplete('Message/user', > '/Messages/autocomplete', array('size' => 40)); ?> > > textarea('Message/message', array('cols' => '60', > 'rows' => '10')); ?> > > submit('Send');?> > > > > And the autocomplete function from the messages controller: > function autocomplete() { > $this->set('users', $this->User->findAll(array('User.username' => > 'LIKE '.$this->data['Message']['user'].'%'), array('User.username', > 'User.fname', 'User.lname', 'User.id'), 'username DESC',null, null, > 0)); > $this->layout = "ajax"; > } > > So the function returns the User.id but I cant see how to pass that to > the view and back again. > > Mike. > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Jeremy Pointer n:Pointer;Jeremy adr:;;Box 499;Krugersdorp;Gauteng;1740;South Africa email;internet:[EMAIL PROTECTED] tel;work:+27 11 665-2445 tel;fax:+27 86 5013109 tel;cell:+27 82 3724769 x-mozilla-html:TRUE version:2.1 end:vcard