Re: Can i get $webroot for a vendor library?
A good way to have a component in a view: class ImageComponent extends Object { function startup($controller) { $this-controller = $controller; $this-controller-set('image', $this); } function hello() { return hi!; } } it will be available in views: echo $image-hello(); --~--~-~--~~~---~--~~ 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: custom foreignKey not working in depper associations
Has been fixed yesterday, phew :) --~--~-~--~~~---~--~~ 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: How to update multiple divs with one ajax call
This works for me in IE for a single div, I have not tried multiple divs in IE yet. nate wrote: Okay, this is working fine on the following: PC: Firefox 1.5.0.4 Mac: Firefox 1.5.0.4, and 1.0.7 Clearly there's something else at issue here. --~--~-~--~~~---~--~~ 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: How to update multiple divs with one ajax call
Yes, it works in IE too. It was tested in all major browsers on all major platforms before being released. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Ajax multiple div update using render in controller
Hi All, I am playing with Ajax in Cake more and more and I like it. I just upgraded the Cake version and found out that we can update multiple Div in a single ajax call. I have seen here some topics about this, but none answer to my question : can we update multiple div in a controller action by returning a view ? for example : index.thtml div id=main_head h1Main Head/h1 /div div id=sub_head h2Sub head/h2 /div ?php echo $ajax-link('test', '/app/test/, array('update' = array('main_head', 'sub_head')); ? now in the controller function test() { render('test', 'ajax'); } in the test.thtml div id=main_head !-- this is where I miss somehing, or maybe not possible? -- h1Main Head Updated/h1 /div div id=sub_head h2Sub head updated/h2 /div Well I hope it's clear enough, any help to guide me would be great .. 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 -~--~~~~--~~--~--~---
Re: Ajax multiple div update using render in controller
Using AjaxHelper::div( ) and AjaxHelper::divEnd( ), you can create sections of your view that can be rendered and updated on the client side. And although you could update one view with the contents of another, the whole point of this feature is to allow you to use a single view/action for regular web requests, as well as Ajax and Ajax update requests. See here for a code example: http://groups.google.com/group/cake-php/msg/cf10b929a33db24e --~--~-~--~~~---~--~~ 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: Ajax multiple div update using render in controller
I think you're over-thinking this, it's really quite simple. In your example, you just need to make the following change: // test.thtml ?php e($ajax-div(main_head)); ? h1Main Head Updated/h1 ?php e($ajax-divEnd(main_head)); ? ?php e($ajax-div(sub_head)); ? h2Sub head updated/h2 ?php e($ajax-divEnd(sub_head)); ? No requestAction( ) required, and your link above can include GET parameters just like any other link. --~--~-~--~~~---~--~~ 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: Ajax multiple div update using render in controller
Thanks a lot, I have tested the given example and it does not work on my side ... When I press the link, the div are not updated (neither time or variable).. I must have got something wrong, into some tricky variable ? layout ? controllers ?? But I have other part of Ajax working (the one updating 1 div and rendering view in view).. Thanks anyway --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Ajax multiple div update using render in controller
Short checklist: (1) Have you checked your paths? The /controller/test URL in the example code was just a fill-in-the-blank. (2) Have you checked your JavaScript console to see if you are getting any errors there? (3) Do you have the Prototype library loaded properly? (4) Paste your code: http://cakephp.org/pastes/add You can paste your controller and view code at the link above, which can help us figure out whether or not you're doing something wrong. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Ajax multiple div update using render in controller
Thanks fpr help, I figured out that I mistype one of the link ..(I did check it 100 times, but maybe too long looking at this code). Anyway after cleaning the cahe, it works ... Now I have another question : on a simple view for I want to put a button to go back to the previous page ..So I can make a submit with some javascript ...but I am very light in Java, I have some scriptaclous lib and others stuff, but maybe you have a quicker way to do this ? Of course I could set en empty form on the view, handle it in controller that would redirect to the referrer..but maybe there is a shorcut ? Thanks again for you help --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Cake setup on OS X - no CSS/img t
Hi I've just been struggling over the past few days to get Cake running on my Macbook Pro. Everything works fine, except for the default setup page lacking images and Research suggested this was a mod_rewrite issue, but I haven't tracked down the correct solution. My httpd.conf is set to AllowOverride All , my .htaccess files are all there correct... I've saved everything into my default webroot (i.e. what I access when i go to http://127.0.0.1/coeus ) (coeus is just the name of the software I'm writing) ie coeus/ app/ cake/ vendors/ .htaccess index.php Basically, the link to the CSS in the source is /css/cake.basic.css - which doesn't exist from the browsers' perspective when it accesses coeus/ I can provide any 'debugging' info you want :-) 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 -~--~~~~--~~--~--~---
Re: File uploads, image uploads
jb- thanks for the input but that isn't exactly the issue. What I don't quite get is a) why I'm getting an index error, and b) how to populate the db (with the imageFile [name] value in addition to the other values passed by the form) at the same time I'm uploading the file into a specific directory. BTW enctype is not the issue, it is in the form tag correctly (I mentioned that in the original post). Just still trying to get the hang of Cake overall; I'm getting most things to work here and there but it seems like every new thing I want to do takes 6 hrs to figure out. Then it's like, ooh, sh---... --~--~-~--~~~---~--~~ 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 i get $webroot for a vendor library?
Great Tip RosSoft, ginstrom. Thanks! One more thing. The Image library extends File but the components extends Object. I know i could use the File class by agregation but i wanted to inherit the File methods in Image. Any tips about that? --~--~-~--~~~---~--~~ 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: Add script to head dynamically in controller or view
Wow - HeadHelper just made my site run much faster (no unnecessary js loads!) and saved me a ton of work. It should really be a core part of CakePHP, not a separate snippet! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
mod_rewrite on Netfirms
Is there anyone here has a cakephp installed on Netfirms with mod_rewrite enabled? I tried to setup a cakephp on Netfirms and need some helps to get the mod_rewrite running properly. Here is my url: http://devindoz.com By default (without modifying anything on .htaccess file) I got this error message: Not Found The requested URL /w/d47/s23/b0285409/www/devindoz.com/app/webroot/index.php was not found on this server. After I add RewriteBase /devindoz.com I got cakephp runs but for some reasons css won't load. I may need to modify the other .htaccess files but I am not sure how. FYI, main directory of a domain hosted on Netfirms is www/domainname.com And I uploaded all cake files on to that directory. Thanks for your help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Ajax Back button
did you have any success with this rossoft? 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 -~--~~~~--~~--~--~---
Re: Ajax Back button
did you have any success with this rossoft? 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 -~--~~~~--~~--~--~---
Re: Cake setup on OS X - no CSS/img t
Is coeus inside your webserver document root, or are you using an alias? If you are using an alias, then you need to modify your app/webroot/index.php and app/webroot/.htaccess. Modify app/webroot/index.php to have: define('WEBROOT_DIR', 'coeus'); instead of the default WEBROOT_DIR define, and modify app/webroot/.htaccess to have: RewriteBase /coeus just put that after the RewriteEngine On line. This is all assuming that coeus is your Apache alias. --~--~-~--~~~---~--~~ 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 i get $webroot for a vendor library?
Sorry. I Just realize that FIle extends Object. So ill guess ill turn Image class into a component. ;) Thank you All!! --~--~-~--~~~---~--~~ 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: mod_rewrite on Netfirms
See my reply for the topic right below this - Cake setup on OS X - no CSS/img t http://groups.google.com/group/cake-php/browse_thread/thread/1a00532bd07e4de0/b6638df4ec10993c#b6638df4ec10993c (I'm not sure if that link will work...) Basically, when using Apache aliases you need to modify the WEBROOT_DIR define in your app/index.php , to the same alias (in your case, devindoz.com). However, while I am not familiar with Netfirms, there shouldn't be any aliases going on just to have a domain name pointing at a folder like that... I would have thought it was just a VirtualHost with appropriate DocumentRoot. --~--~-~--~~~---~--~~ 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: mod_rewrite on Netfirms
Thanks for your reply Grant Cox. I have read your post on the other thread as well. Tried your suggestion but it won't solve my problem :( Considering to give up mod_rewrite and just use cakephp nice url but then I have problem with the incorrect link. When I am at let's say index.php/thread/edit and have a form with action to index.php/thread/post cakephp append the action url to the current url so it becomes: action=index.php/thread/edit/thread/post This is the same problem as raised by Zach Cox at http://groups.google.com/group/cake-php/browse_thread/thread/4f93c0be118289ab/214f2a71e172f81d?q=netfirmsrnum=2#214f2a71e172f81d Not sure if this is a bug or it is just Netfirms configuration. --~--~-~--~~~---~--~~ 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: mod_rewrite on Netfirms
I have found a way to make the cakephp nice url link works properly (at least in my case). I edited html.php file located at cake/libs/view/helpers/ on line 132 : $base = strip_plugin($this-base, $this-plugin); I changed it to $base = '/index.php'; I am not sure if this is a proper work-around but it works for me. However I actually still prefer to use mod_rewrite. Anyone who has been able to use mod_rewrite on Netfirms please share your experience. 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 -~--~~~~--~~--~--~---
Re: Web host doesn't use AllowOverride
Zach Cox, have you been able to solve your problem? If not, please refer to this thread: http://groups.google.com/group/cake-php/browse_thread/thread/e86def1583d50760/0f4bc3ae1402d278 Hope that helps. 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 -~--~~~~--~~--~--~---