Re: flashplayer for cake
Yeah, that's a really good one, I use it a lot too! On Jul 11, 11:40 pm, mastorna <[EMAIL PROTECTED]> wrote: > While Flash doesn't have much in the way to do with Cake (its > exclusively an artifact of the view being a plugin and all), I would > recommend this xml driven player: > > http://www.jeroenwijering.com/?item=JW_MP3_Player > > You've probably seen this one before on several sites. Very easy to > use. > > -lm > > On Jul 11, 12:05 pm, Michael Augustyniak > > <[EMAIL PROTECTED]> wrote: > > Dear group > > > I am looking for goog flash mp3 player based on mysql > > I was trying wimpy but seems to not have goog mysql support , hard to > > figure out what they did, no samples , they sacks if going about mysql > > support. > > Another player which I checked was flamplayer, but not working for me > > totaly, not loading a playlist or on different machine just no playlist > > at all. > > Just can not get this working. > > > I am confused now. > > Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Strange beforeFilter behaviour
> I'd add a check you are trying to add to an array. I added a check to see if the system is trying to add to an array: (count($queryData['conditions']) < 1) And, though I can't completely follow why, this solves the problem! Can you elaborate a bit more on why this solves my problem? Anyway, thanx a lot for your help, because I've been trying to solve this for months now! Gerben. On Jul 11, 3:53 pm, AD7six <[EMAIL PROTECTED]> wrote: > On Jul 11, 3:26 pm, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > Anyone? > > Just a guess but: > > More than likley somewhere you have a constrfaint that is a string > and includes "WHERE" as the first word /of/ the constraint. you are > replacing the first character of the constraint with your additional > constraint, but only the value. > > I'd add a check you are trying to add to an array. > > An e.g. may help, I bet this does the same, or leads you to a > conclusion: > > $conditions = "WHERE X = Y"; > $conditions['look ma a string'] = 1; > pr ($conditions); > > hth, > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Strange beforeFilter behaviour
Anyone? On Jul 3, 8:41 pm, gerbenzomp <[EMAIL PROTECTED]> wrote: > I have the following beforefilter, to make sure some queries have the > additional condition "WHERE sitename = 'x'". > > function beforeFind(&$queryData) { > > if ($this->hasField('siteindex') && !in_array('siteindex', > array_keys($queryData)) && !in_array($this->name . '.siteindex', > array_keys($queryData))) { > $queryData['conditions'][$this->name . '.siteindex'] = > Configure::read('siteid'); > } > > return $queryData; > > } > > The beforefilter looks okay to me, but in some cases queries turn out > like this: > > ...WHERE 1HERE layerid = '2' AND siteindex = '1' ORDER BY `order_id` > ASC, `id` ASC; > > (look at the 1HERE part) > > And thus I get mysql errors. > > What am I doing wrong? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Strange beforeFilter behaviour
I have the following beforefilter, to make sure some queries have the additional condition "WHERE sitename = 'x'". function beforeFind(&$queryData) { if ($this->hasField('siteindex') && !in_array('siteindex', array_keys($queryData)) && !in_array($this->name . '.siteindex', array_keys($queryData))) { $queryData['conditions'][$this->name . '.siteindex'] = Configure::read('siteid'); } return $queryData; } The beforefilter looks okay to me, but in some cases queries turn out like this: ...WHERE 1HERE layerid = '2' AND siteindex = '1' ORDER BY `order_id` ASC, `id` ASC; (look at the 1HERE part) And thus I get mysql errors. What am I doing wrong? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
routing and pagination
I use AD7six's pagination helper/component, and it works great! But right now I'm changing the default routes, so the user's sitename comes before every controller->action. Like this: $Route->connect("/:sitename/posts/edit/*", array("controller" => "posts", "action" => "edit")); This works fine for most controllers/actions, but I can't seem to "resurrect" the pagination part in this new setup. Right now I have the routing for the pagination like this: $Route->connect("/:sitename/Posts/index/page/*", array("controller" => "posts", "action" => "index")); But this way, I get the first "posts" page on every pagination link I click. How can I make sure the pagination works 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: everything belongs to Site
I don't understand, which way? On 4 jun, 18:26, Dan Bair <[EMAIL PROTECTED]> wrote: > I haven't done that before, but to me, that seems like a very logical > way to do it. > > On Jun 4, 7:00 am, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > I've started a new project, and in that site everything should belong > > to the Site model. So articles, posts, users, products, etc. all > > belong to a site, and should only be visible to users that belong to > > that site. > > > To make it clearer: a user belongs to a site, and once that user logs > > in he or she sees all articles, posts, products etc. belonging to that > > site. There are multiple sites. Users that are not logged should not > > be able to see anything. > > > What would be the best way to do this? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
everything belongs to Site
I've started a new project, and in that site everything should belong to the Site model. So articles, posts, users, products, etc. all belong to a site, and should only be visible to users that belong to that site. To make it clearer: a user belongs to a site, and once that user logs in he or she sees all articles, posts, products etc. belonging to that site. There are multiple sites. Users that are not logged should not be able to see anything. What would be the best way to do this? --~--~-~--~~~---~--~~ 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: Update two models with one form
Sorry, my actual question is: How to update another model's table when there is no association between them? On 16 mei, 03:57, Pento <[EMAIL PROTECTED]> wrote: > So what problem to use for names of input elements of the form names > like > Users/field1,Sites/field1 and in controller call save methods for > both models? > > On 16 май, 07:33, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > I have a form where users can register (model: users), but they should > > also be able to create a sitename (model: sites) in that same form. > > How should I approach this? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Update two models with one form
I have a form where users can register (model: users), but they should also be able to create a sitename (model: sites) in that same form. How should I approach this? --~--~-~--~~~---~--~~ 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: Routing and html helper
Thanx for the replies! I'm using 1.1, but this array-based URL feature is surely just what I'm looking for! For now, I'll try to create my own html helper, as Tulio suggested, because I don't know if I'm ready for 1.2 yet. I did come a long way though by setting the base in app_controller beforeFilter: $this->base = 'http://www.mysite.com/'.$this->params['sitename']; But I don't know if this is a very clean approach. On 3 mei, 07:13, themanfrombucharest <[EMAIL PROTECTED]> wrote: > If you're using 1.2 then maybe the new array based URL are what you > need: > > $html->link('link', array('sitename' => 'a_site_name', 'controller' => > 'posts', 'action' => 'index')); > > On May 3, 1:54 am, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > I've changed the routes in my app, so that my paths are like this: > > > $Route->connect("/:sitename/", array("controller" => "posts", "action" > > => "index")); > > > and urls are like this: > > > site.com/sitename/controller/action/ > > > But the html helper automatically creates links like this: > > > site.com/controller/action/ > > > Is there a way I can adjust the html helper so that the current > > sitename is added to each link in the app? --~--~-~--~~~---~--~~ 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: change element path in renderElement
> Why not just move this (surely generic) plugin element to your app > view element folder? Because the plugin contains much more than just the element: it contains a model, views and a controller as well. My plan is to use renderElement to get the main view of each widget to load quickly (using your method), and then load the edit view of a widget after the user presses an ajax link. The edit view will reside in the plugins folder. The reason I really would like to have everything in one folder, is because this is the only part of my app that users can contribute to: they can write new widgets, and other users should be able to easily install them by just dropping the widget folder into the plugins folder. I want users with no knowledge of Cake to be able to easily expand the app's functionality, instead of saying: drop this file here, and that file there, an another one there... I know this is the Cake way of working, and it's great for me as a programmer, but I don't want to bother users with technicalities. So -just for this tiny part of the app- I'd like to override the default path of elements and components. I've seen this being done in the themeable view class (http://abing.gotdns.com/posts/2006/themeable- view-class-for-cakephp/) which I use in my app, so would it take a similar approach to add a path for cake to look for elements? Something like: if (file_exists(APP . 'plugins' . DS . $this->plugin . DS . 'views' . DS . 'elements' . DS . $name . $this->ext)) { $elementFileName = APP . 'plugins' . DS . $this->plugin . DS . 'views' . DS . 'elements' . DS . $name . $this->ext; } I am aware that what I want goes against the Cake framework, but as I explained above, in this case I feel I have a good reason to. So can someone please explain how to roughly accomplish this? I can then decide if I want to do it or not. On 3 mei, 13:55, AD7six <[EMAIL PROTECTED]> wrote: > On 3 mayo, 02:48, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > A while ago AD7six told me that it is possible to override the default > > path of an element when calling renderElement(). Up to now, it hasn't > > become clear to me how to change that path, and what the path should > > look like. > > > When an element resides in app/plugins/my_plugin/views/elements/ > > my_element.thtml, how would I point to that location using > > renderElement(); ? > > Hi gerbenzomp, > > If something is a bit difficult to do, it's wise to think if you are > trying to do something a 'wrong' way. > > You can easily make cake look for an element in a subfolder of where > it would normally look (echo $this->renderElement('folder/subfolder/ > file');) it is very difficult to make cake look for an element in a > plugin, when you are not in it unless you write the code to do so > yourself. > > Why not just move this (surely generic) plugin element to your app > view element folder? > > hth, > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
change element path in renderElement
A while ago AD7six told me that it is possible to override the default path of an element when calling renderElement(). Up to now, it hasn't become clear to me how to change that path, and what the path should look like. When an element resides in app/plugins/my_plugin/views/elements/ my_element.thtml, how would I point to that location using renderElement(); ? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Routing and html helper
I've changed the routes in my app, so that my paths are like this: $Route->connect("/:sitename/", array("controller" => "posts", "action" => "index")); and urls are like this: site.com/sitename/controller/action/ But the html helper automatically creates links like this: site.com/controller/action/ Is there a way I can adjust the html helper so that the current sitename is added to each link in the app? --~--~-~--~~~---~--~~ 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: Routing and FindAll();
Ok, I found the problem: For some reason when I use the beforeFind function, the first letter of the sitename gets inserted into the read(); query. That's where the 'm' came from. So the code works when there are no other conditions, but when there are, it causes a problem. My current code is: function beforeFind($queryData) { if ($this->hasField('sitename') && !in_array('sitename', array_keys($queryData)) && !in_array($this->name . '.sitename', array_keys($queryData)) { $queryData['conditions'][$this->name . '.sitename'] = Configure::read('site'); } return $queryData; } Any idea what could cause this problem? Sorry for the amount of posts in a row, b.t.w... On 30 apr, 01:07, gerbenzomp <[EMAIL PROTECTED]> wrote: > Your example works great, I only get errors when I go to /sitename/ > posts/view/ > > For some reason the $this->Post->read(); query is executed like this: > ... WHERE mPost`.`id` = '134' LIMIT 1 > > No idea where the 'm' comes from, but it's gone when I remove the > beforeFind(); function. > > Any ideas? > > On 29 apr, 22:29, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > I still get the errors, even with your updated example. > > > To fix it, I changed: > > array_keys($queryData['conditions']) > > to: > > array_keys($queryData) > > > Does that make sense? > > > A related question: > > > Is there a way to use the same method for changing the links sitewide > > from: > > > /controller/action/ > > > to: > > > /sitename/controller/action/ > > > So the sitename is automatically used in each $html->link(); ? > > > That would be great! > > > On 29 apr, 19:28, "Mariano Iglesias" <[EMAIL PROTECTED]> > > wrote: > > > > Oh yeah sorry, that's because I pasted an example from a behavior, change > > > it > > > to: > > > > function beforeFind($queryData) { > > > if ($this->hasField('sitename') && !in_array('sitename', > > > array_keys($queryData['conditions'])) && !in_array($this->name . > > > '.sitename', array_keys($queryData['conditions']))) { > > > $queryData['conditions'][$this->name . '.sitename'] = > > > Configure::read('site'); > > > } > > > > return $queryData; > > > > } > > > > -MI > > > > --- > > > > Remember, smart coders answer ten questions for every question they ask. > > > So be smart, be cool, and share your knowledge. > > > > BAKE ON! > > > > blog:http://www.MarianoIglesias.com.ar > > > > -Mensaje original- > > > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre > > > de gerbenzomp > > > Enviado el: Domingo, 29 de Abril de 2007 11:18 a.m. > > > Para: Cake PHP > > > Asunto: Re: Routing and FindAll(); > > > > I added a field called "sitename" to the posts table and to some posts > > > added the sitename value "mysite". --~--~-~--~~~---~--~~ 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: Routing and FindAll();
Your example works great, I only get errors when I go to /sitename/ posts/view/ For some reason the $this->Post->read(); query is executed like this: ... WHERE mPost`.`id` = '134' LIMIT 1 No idea where the 'm' comes from, but it's gone when I remove the beforeFind(); function. Any ideas? On 29 apr, 22:29, gerbenzomp <[EMAIL PROTECTED]> wrote: > I still get the errors, even with your updated example. > > To fix it, I changed: > array_keys($queryData['conditions']) > to: > array_keys($queryData) > > Does that make sense? > > A related question: > > Is there a way to use the same method for changing the links sitewide > from: > > /controller/action/ > > to: > > /sitename/controller/action/ > > So the sitename is automatically used in each $html->link(); ? > > That would be great! > > On 29 apr, 19:28, "Mariano Iglesias" <[EMAIL PROTECTED]> > wrote: > > > Oh yeah sorry, that's because I pasted an example from a behavior, change it > > to: > > > function beforeFind($queryData) { > > if ($this->hasField('sitename') && !in_array('sitename', > > array_keys($queryData['conditions'])) && !in_array($this->name . > > '.sitename', array_keys($queryData['conditions']))) { > > $queryData['conditions'][$this->name . '.sitename'] = > > Configure::read('site'); > > } > > > return $queryData; > > > } > > > -MI > > > ------- > > > Remember, smart coders answer ten questions for every question they ask. > > So be smart, be cool, and share your knowledge. > > > BAKE ON! > > > blog:http://www.MarianoIglesias.com.ar > > > -Mensaje original- > > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre > > de gerbenzomp > > Enviado el: Domingo, 29 de Abril de 2007 11:18 a.m. > > Para: Cake PHP > > Asunto: Re: Routing and FindAll(); > > > I added a field called "sitename" to the posts table and to some posts > > added the sitename value "mysite". --~--~-~--~~~---~--~~ 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: Routing and FindAll();
I still get the errors, even with your updated example. To fix it, I changed: array_keys($queryData['conditions']) to: array_keys($queryData) Does that make sense? A related question: Is there a way to use the same method for changing the links sitewide from: /controller/action/ to: /sitename/controller/action/ So the sitename is automatically used in each $html->link(); ? That would be great! On 29 apr, 19:28, "Mariano Iglesias" <[EMAIL PROTECTED]> wrote: > Oh yeah sorry, that's because I pasted an example from a behavior, change it > to: > > function beforeFind($queryData) { > if ($this->hasField('sitename') && !in_array('sitename', > array_keys($queryData['conditions'])) && !in_array($this->name . > '.sitename', array_keys($queryData['conditions']))) { > $queryData['conditions'][$this->name . '.sitename'] = > Configure::read('site'); > } > > return $queryData; > > } > > -MI > > --- > > Remember, smart coders answer ten questions for every question they ask. > So be smart, be cool, and share your knowledge. > > BAKE ON! > > blog:http://www.MarianoIglesias.com.ar > > -Mensaje original- > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre > de gerbenzomp > Enviado el: Domingo, 29 de Abril de 2007 11:18 a.m. > Para: Cake PHP > Asunto: Re: Routing and FindAll(); > > I added a field called "sitename" to the posts table and to some posts > added the sitename value "mysite". --~--~-~--~~~---~--~~ 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: Routing and FindAll();
I've tried your example: I added a field called "sitename" to the posts table and to some posts added the sitename value "mysite". In routes.php in have: $Route->connect("/:sitename/posts/*", array("controller" => "posts", "action" => "index")); But when I call http://www.zomp.nl/cake_folder/mysite/posts/ I get the errors: Warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/vhosts/zomp.nl/httpdocs/framework/app/ app_model.php on line 6 Warning: in_array() [function.in-array]: Wrong datatype for second argument in /var/www/vhosts/zomp.nl/httpdocs/framework/app/ app_model.php on line 6 Notice: Undefined variable: model in /var/www/vhosts/zomp.nl/httpdocs/ framework/app/app_model.php on line 6 Notice: Trying to get property of non-object in /var/www/vhosts/ zomp.nl/httpdocs/framework/app/app_model.php on line 6 To simply things, I then removed the last two conditions in the if- statements and changed $model->name to $this->name, so it reads: function beforeFind($queryData) { if ($this->hasField('sitename')) { $queryData['conditions'][$this->name . '.sitename'] = Configure::read('site'); } return $queryData; } The errors are gone now, but no posts are displayed. Does anyone know what I'm doing wrong? On 22 apr, 21:21, gerbenzomp <[EMAIL PROTECTED]> wrote: > Cool! That will save me a lot of code rewriting ;) > > Thanks for the reply, Mariano! I'm going to try it out! > > On 22 apr, 18:58, "Mariano Iglesias" <[EMAIL PROTECTED]> > wrote: > > > Sure, write sitename on your AppController::beforeFilter() to the Configure > > instance: > > > Configure::write('site', 'sitename'); > > > Then on AppModel::beforeFind() you can add a condition to set the sitename: > > > function beforeFind($queryData) { > > if ($this->hasField('sitename') && !in_array('sitename', > > array_keys($queryData['conditions'])) && !in_array($model->name . > > '.sitename', array_keys($queryData['conditions']))) { > > $queryData['conditions'][$model->name . '.sitename'] = > > Configure::read('site'); > > } > > > return $queryData; > > > } > > > -MI > > > --- > > > Remember, smart coders answer ten questions for every question they ask. > > So be smart, be cool, and share your knowledge. > > > BAKE ON! > > > blog:http://www.MarianoIglesias.com.ar > > > -Mensaje original- > > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre > > de gerbenzomp > > Enviado el: Domingo, 22 de Abril de 2007 11:07 a.m. > > Para: Cake PHP > > Asunto: Routing and FindAll(); > > > But does this mean I have to add "WHERE sitename = > > $this->params[sitename];" to every findAll(), query(), etc in every > > > controller in my system? Or is there an easier way, so Cake > > automatically knows it should use the sitename in the url in every > > query? --~--~-~--~~~---~--~~ 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: Possible to put components and elements in plugin?
> You can't (if I am guessing correctly?) from one of your app views render > an element from a plugin unless you explicitly tell cake exactly where > the file is (3rd parameter iirc). Can anyone explain how to do this exactly? --~--~-~--~~~---~--~~ 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: In Place Editing
It's easily done using cake! Just put all content you want to be replaced in a div, and use ajax.updater to replace it with the edit view (forms fields). Something like this: link("edit this", "/content/edit", array('update' => "mydiv"),null,false); ?> your content here This should do the trick! Gerben. On 28 apr, 14:28, "robert.fulcher" <[EMAIL PROTECTED]> wrote: > I want to build a page that will be a view and in place editing. Is > this possible. I have individual in place editors but want to do a > whole page with an autocomplete. > > 1. Is this possible? > 2. Is there another way? > 3. Is there any examples or resources? > > Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Routing and FindAll();
Cool! That will save me a lot of code rewriting ;) Thanks for the reply, Mariano! I'm going to try it out! On 22 apr, 18:58, "Mariano Iglesias" <[EMAIL PROTECTED]> wrote: > Sure, write sitename on your AppController::beforeFilter() to the Configure > instance: > > Configure::write('site', 'sitename'); > > Then on AppModel::beforeFind() you can add a condition to set the sitename: > > function beforeFind($queryData) { > if ($this->hasField('sitename') && !in_array('sitename', > array_keys($queryData['conditions'])) && !in_array($model->name . > '.sitename', array_keys($queryData['conditions']))) { > $queryData['conditions'][$model->name . '.sitename'] = > Configure::read('site'); > } > > return $queryData; > > } > > -MI > > --- > > Remember, smart coders answer ten questions for every question they ask. > So be smart, be cool, and share your knowledge. > > BAKE ON! > > blog:http://www.MarianoIglesias.com.ar > > -Mensaje original- > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre > de gerbenzomp > Enviado el: Domingo, 22 de Abril de 2007 11:07 a.m. > Para: Cake PHP > Asunto: Routing and FindAll(); > > But does this mean I have to add "WHERE sitename = $this->params[sitename];" > to every findAll(), query(), etc in every > > controller in my system? Or is there an easier way, so Cake > automatically knows it should use the sitename in the url in every > query? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Routing and FindAll();
I want different users to be able to use my whole system, and I want them to have their own sitename before the controller and action, like this: www.domain.com/sitename/controller/action/ With help from people on the forum, I've discovered I can best use this approach in routes.php: $Route->connect("/:sitename/posts/*, array("controller" => "posts", "action" => "index")); $Route->connect("/:sitename/categories/*, array("controller" => "categories", "action" => "index")); // etc... But does this mean I have to add "WHERE sitename = $this- >params[sitename];" to every findAll(), query(), etc in every controller in my system? Or is there an easier way, so Cake automatically knows it should use the sitename in the url in every query? --~--~-~--~~~---~--~~ 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: integration with other software
Here's some links: Wordpress: http://www.webdevkungfu.com/accessing-wordpress-with-cakephp/ ... there was another good wordpress/cake integration article, but I can't find the link right now... Joomla: http://dev.sypad.com/projects/jake/ Drupal: http://www.thinkingphp.org/2006/01/25/drake-drupal-cakephp-is-making-progress/ Gerben. On 22 apr, 12:42, laptop <[EMAIL PROTECTED]> wrote: > hi there, has anyone completed an integration with other software like > wordpress or vbulletin?? I would like the same layout template to be > used which I could do relatively easy, my main problem is that there > is a little welcome box in the top right which uses my User model... > > any help would be appreciated.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: hasMany's order question
As far as I can see, you just forgot to set the order clause in categoriescontroller: Change: 'Blog.created DESC' to 'order' => 'Blog.created DESC' It must have been a slip of the keys, because in the BlogsController you've done it the right way. Gerben. On 21 apr, 15:20, matlin <[EMAIL PROTECTED]> wrote: > The BlogsController:http://bin.cakephp.org/view/616075649 > and the CategoriesController:http://bin.cakephp.org/view/1748048905 > > Staring myself blind I think ... ;) > > On Apr 21, 1:44 am, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > What is your current code? > > > On 21 apr, 00:26,matlin<[EMAIL PROTECTED]> wrote: > > > > A short question, does $hasMany honor the the 'order' directive? > > > > It doesn't seem to be so. To me. I can't get it to work anyway. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: I cant get my js file work?where to put js files?
You should put your js files in the js folder in webroot, so: app/webroot/js/myscript.js And then call it like: link('myscript'); ?> On 21 apr, 16:13, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > where to put js files? and how to refence it? --~--~-~--~~~---~--~~ 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: SWFupload
I suppose you followed the instructions in http://bakery.cakephp.org/articles/view/swfupload-and-multipurpose-uploader ? Make sure you've created an upload folder in the files folder in webroot: that is where the files get uploaded. So check there to see if it works. Also, play around with the settings in init.js, because the names of one or more files are a little different in the download, than in the example. Adjust those names to fit those filenames. That's how I got it to work. For debugging info, and other related info, please see http://swfupload.mammon.se/, they have quite good documentation on such things. On 22 apr, 11:16, Enchy <[EMAIL PROTECTED]> wrote: > Hi > > I need some help with SWFupload for cakephp. > Installed it herehttp://capeseo.com/admin/ > The bottom form is a normal straightforward uploader. > When you upload something with that it works and you can see results. > The top one is the fancy flash uploader but it pretends to be working > but when I View results there is nothing. I really don't know what > todo or look for. Also don't know how I can debug this thing. > > Please help. > > Louis --~--~-~--~~~---~--~~ 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: submitting Ajax->form with javascript freezes browser
I vaguely remember your approach could cause some issues Try this approach: // your form fields here '/test/controls', 'update'=> 'controls'); echo $ajax->submit('Save', $options); ?> Gerben. On 20 apr, 06:06, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have an ajax form that i want to submit using javascript. I created > a input button that onclick submits my form. When i use this method > (button test1) firefox freezes/crashes. If i click the normal submit > button, everything works as expected. > > Why cant i submit the ajax form via javascript? Is there a work > around. > > Below is what my code looks like. > > form( '/test/controls', > 'POST', > array( 'update' => 'controls', >'name' => 'controls_form')) ?> > > > > > --~--~-~--~~~---~--~~ 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: hasMany's order question
What is your current code? On 21 apr, 00:26, matlin <[EMAIL PROTECTED]> wrote: > A short question, does $hasMany honor the the 'order' directive? > > It doesn't seem to be so. To me. I can't get it to work anyway. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: when I create my own layout file ,where to put all the related pics and swfs?
Images are best put in the "img" folder in the webroot, because this way you can use Cake's built in html helper: $html->image('myimage.jpg'); > what is the webroot dir for? when and what to put into this dir? The webroot is meant for all external files your layout uses, so images, css, javascripts, etc. Gerben. On 20 apr, 17:21, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > when I create my own layout file ,where to put all the related pics > and swfs?my layout file is in cake\app\views\layouts > > what is the webroot dir for? when and what to put into this dir? --~--~-~--~~~---~--~~ 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: Possible to put components and elements in plugin?
Thanks for the reply! Your guess was right: I want to expand your mini- contollers approach, by giving each widget a "settings" page, which is loaded through ajax after a user clicks the "edit" button on a widget. This means I'll have to create controller and a view for the widget (edit.thml for example). In this case I would really like all the files belonging to a widget in one folder (element, component, model,view controller). It's not really a problem if it makes my code more complex, because it would make the widget-stucture easier to grasp. Good to know it's possible, but I didn't quite understand your expanation on how to do this: "(3rd parameter iirc)". What does iirc stand for? On 12 apr, 08:38, "AD7six" <[EMAIL PROTECTED]> wrote: > On 10 abr, 15:38, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > I heavily use AD7six's mini-controllers approach > > (http://www.noswad.me.uk/MiBlog/MiniControllers) and because I combine this > > approach with the normal approach of having a model, controller, view, > > it would really be nice if I could bundle all this into a plugin. > > > Is it possible to have components and elements insie a plugin, and if > > so, how can I make sure Cake finds them? > > MiniControllers and Plugins are not the same, so while the answer is > "Yes" Cake is only going to find your my_plugin component/helper/ > element etc. if you are in "my_plugin"/aController at the time. You > can't (if I am guessing correctly?) from one of your app views render > an element from a plugin unless you explicitly tell cake exactly where > the file is (3rd parameter iirc). But that's adding complexity and > making things rather messy ;). > > hth, > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how should I set up these complex associations?
I've been thinking about this problem some more, and maybe I need HABTM-associations between the pages and widgets, as well as between the layers and the widgets? Or would that make it unneccesarily complex? I want to generate an array based on the current page, and then print the layers, and the widgets each layer contains, so maybe there's a much simpler approach. It's just that I can't see how to do this. On 13 apr, 16:18, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > You mean in the model? I've tried that before, but it doesn't change > the error. > > I think there's something wrong with my associations in general, > because I get an array that looks different from what I had hoped for, > and the error stays too. (It goes away when I remove the page->widget > association, which is in a way understandable, because a page contains > no widgets: a page contains layers, which in turn contain widgets. > > It's hard for me to have a clear understanding of how I should set > this up. > > On 13 apr, 13:38, "Mike Griffin" <[EMAIL PROTECTED]> wrote: > > > On 4/13/07, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > > But I think this isn't the right approach, because I get the error: > > > SQL Error in model Page: 1052: Column 'id' in order clause is > > > ambiguous > > > You need to use the model name in front of the id as well. > > Something like Page.id or Widget.id, depending on which one you want. > > > Mike. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [EMAIL PROTECTED] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how should I set up these complex associations?
You mean in the model? I've tried that before, but it doesn't change the error. I think there's something wrong with my associations in general, because I get an array that looks different from what I had hoped for, and the error stays too. (It goes away when I remove the page->widget association, which is in a way understandable, because a page contains no widgets: a page contains layers, which in turn contain widgets. It's hard for me to have a clear understanding of how I should set this up. On 13 apr, 13:38, "Mike Griffin" <[EMAIL PROTECTED]> wrote: > On 4/13/07, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > But I think this isn't the right approach, because I get the error: > > SQL Error in model Page: 1052: Column 'id' in order clause is > > ambiguous > > You need to use the model name in front of the id as well. > Something like Page.id or Widget.id, depending on which one you want. > > Mike. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [EMAIL PROTECTED] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how should I set up these complex associations?
I'll try to be a bit more specific: my main problem is that a Widget belongs only to the combination of layer and page, and is linked through layer_id and page_id. A page in turn only has an association with a layer through the design model. Right now I have this: class Page extends AppModel { var $name = 'Page'; var $belongsTo = array('Design' => array('className' => 'Design', 'conditions'=> '', 'order' => '', 'foreignKey'=> 'design_id' ) ); var $hasMany = array('Widget' => array('className' => 'Widget', 'conditions'=> '', 'order' => 'Page.url', 'foreignKey'=> 'page_id' ) ); } class Layer extends AppModel { var $name = 'Layer'; // a layer holds many widgets var $hasMany = array('Widget' => array('className' => 'Widget', 'conditions'=> '', 'order' => 'Widget.order_id DESC', 'limit' => '', 'foreignKey'=> 'layer_id', 'dependent' => true, 'exclusive' => false, 'finderQuery' => '' ) ); // a layer belongs to a design var $belongsTo = array('Design' => array('className' => 'Design', 'conditions'=> '', 'order' => 'Design.id DESC', 'limit' => '', 'foreignKey'=> 'design_id', 'dependent' => true, 'exclusive' => false, 'finderQuery' => '' ) ); } But I think this isn't the right approach, because I get the error: SQL Error in model Page: 1052: Column 'id' in order clause is ambiguous The error only goes away when I remove the association between Page- >Widget I could also do a custom query: query("SELECT * from widgets_table WHERE page_id = $page_id AND layer_id = $layer_id); but I think that would be a hack. I just don't know how to set up the associations. Any help is appreciated! On 13 apr, 00:03, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > I've been trying to get the associations right, but I somehow got lost > in my thinking about how every model relates to the other. Maybe > someone can have a fresh view on my problem. > > I've put all my models between "" in this explanation, so it is easier > to read. > > I have several models: > > All the "Pages" in a "Site" share the same "Design" > Each "Design" has many "Layers", and each "Layer" can have many > "Widgets", BUT the widgets in each layer are also dependant of the > current "Page". > > Every "Page" in a site uses the same "Design" and thus the same > "Layers", but the widgets in the layers can vary from page to page. > > I hope I'm being clear in my description above. > > I was able to set up the relations to a good degree, but got stuck > when I realised that widgets don't belong to a layer, but ONLY to the > combination of "Page" and "Layer". And layers belong to a design, but > widgets DON'T belong to a design. > > Any ideas how this would translate to Cake associations? > > Any help in my thinking about this would be appreciated as well :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [EMAIL PROTECTED] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how to create new flash layout and a corresponding function
Take a look at RosSoft's excellent pdf: http://rossoft.wordpress.com/2006/06/24/blog-tutorial-chapter-3-done/ It contains a section about how to create your own custom flash layouts, and how to write a function that calls this layout. I've found it quite useful. Gerben. On 12 apr, 16:16, "rajasekhar" <[EMAIL PROTECTED]> wrote: > hallo, > > i have some doubts in generating a new flash layout, and which > function want to use to execute/call this flash layout. > > Rajasekhar. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [EMAIL PROTECTED] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
how should I set up these complex associations?
I've been trying to get the associations right, but I somehow got lost in my thinking about how every model relates to the other. Maybe someone can have a fresh view on my problem. I've put all my models between "" in this explanation, so it is easier to read. I have several models: All the "Pages" in a "Site" share the same "Design" Each "Design" has many "Layers", and each "Layer" can have many "Widgets", BUT the widgets in each layer are also dependant of the current "Page". Every "Page" in a site uses the same "Design" and thus the same "Layers", but the widgets in the layers can vary from page to page. I hope I'm being clear in my description above. I was able to set up the relations to a good degree, but got stuck when I realised that widgets don't belong to a layer, but ONLY to the combination of "Page" and "Layer". And layers belong to a design, but widgets DON'T belong to a design. Any ideas how this would translate to Cake associations? Any help in my thinking about this would be appreciated as well :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [EMAIL PROTECTED] 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 -~--~~~~--~~--~--~---
FindBy and recursive?
I've just discovered the magic of setting the recursive value using FindAll(). It's really exiting to see how easy it is to make complex associations, and how well Cake can search up and down the association tree! My question is: how do I use recursive with FindBy? I want to have nice urls, so I use FindByUrl($url); But how do I set the recursive value in this case? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [EMAIL PROTECTED] 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 a whole view be loaded inside a hidden out of the screen..
So you've been able to load the add view into the div already? Then you just need to change a few things in the add form: // start the form // normal form fields input('MyModel/title', array('size' => '35'))?> // etc // ajax submit button ''url_for_submit', 'update'=> 'div_to_update', 'complete' => $complete."some effects here maybe...?"); echo $ajax->submit('Save', $options); ?> // end form Now, if you submit the form, it is processed by the controller, just like a non-ajax form, so in the controller for the add-action you go: if ($this->MyModel->save($this->data)) { // now render the view as ajax $this->render('view_to_render', 'ajax'); } Hope this helps, Gerben. On 11 apr, 16:38, "rstuker" <[EMAIL PROTECTED]> wrote: > got the aim, but not the way, sorry. May you be so kind to show me a > whole example? I've a form in a view (controllers/add) which contained > value to be entered, using ---$html->input('Model/fielname')... -- > $html->submit("save"). I loaded this view inside the div hidden using the > > echo $ajax->link('Link text', '/controllers/add'...), right?In the > method of that controller, the usual > "if (!empty($this->data['Jurado'])) { >if($this->Jurado->save($this->data['Jurado'])) { $this->flash(); > $this->log();}" > > Now..should i use $ajax->...for each option in my view representing > each ModelName/fieldname?And how the controller will be told data is > being,now, submitted by $ajax helper instead of $html?only $this->render();, > what should change in the Contr..?. I do apologise, i'm > > really newbie at php,cake.Do thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: associations in page model: (namespace) conflicts?
The reason I transformed the "pages" architecture from static to dynamic is that I wanted to use the name "pages" in my url, instead of something like "sections" or "articles". And the pages model is going to be the most important part of my app, so I wanted to give it a clear name. I'm not going to use the static pages functionality anyway. > And if you removed your route for the pages controller, how are you > performing the logic? I didn't remove it actually, I just changed it from: $Route->connect('/pages/*', array('controller' => 'pages', 'action' => 'display')); to $Route->connect('/pages/*', array('controller' => 'pages', 'action' => 'index')); So I can use it as a normal controller. I thought I'd just try it, and it works okay, apart from the error checking. > I'd probably stick to using a basic controller to perform your logic. To be clear: I just created my own basic pages controller, I didn't adapt Cake's default static pages controller. Do you really think there will be any trouble in doing it this way? I've seen other people do it here on the forum. On 11 apr, 16:38, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'd probably stick to using a basic controller to perform your logic. > What was your reasoning for retrieving pages as dynamic instead of > static? > And if you removed your route for the pages controller, how are you > performing the logic? > > On Apr 11, 10:22 am, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > I've changed Cake's default static "pages" architecture to be dynamic, > > and also commented out the default route for this controller. All went > > fine, until I tried to get some associations up and running. > > > I tried to link pages to sites, using belongsTo, but when I do a > > pr($data); in the view, nothing is shown. When I remove the > > association it shows a normal array of all the pages. I tried several > > kinds of associations, but they all have the same effect (nothing is > > printed). > > > I have no problems making associations in any other model, just the > > pages one. Could there be some sort of (namespace?) conflict with the > > inner workings of Cake? And if so, is there a solution, because I'd > > really like to use the name "pages" in the url. --~--~-~--~~~---~--~~ 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: Ajax Sortable List Confusion
Nice job, I recently built something quite like this, only in my set- up the widgets themselves are in fact "mini-controllers" using a component and an element. On 11 apr, 16:15, "Dustin" <[EMAIL PROTECTED]> wrote: > Just an update to anyone looking for help with building a drag & drop > interface in Cake. I wrote a brief tutorial on my blog that should > help resolve most basic issues/confusion with this particular aspect > of Cake. I tried to write it from the perspective of someone new to > Cake and or with no previous experience with the $ajax->sortable() > helper built into Cake. > > So, if you are stuck or scared of building your drag & drop interface, > check it out: > > http://www.dustinweber.com/blog/_archives/2007/4/4/2859177.html > > Thanks! > 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: associations in page model: (namespace) conflicts?
Sorry, forget this post. The problem was ambiguity in the "order by" clause. The only strange thing is that Cake didn't show an error to let me know which was the problem, while it does this for any other model... Could this (not showing errors) have something to do with the fact that I changed the default pages architecture? Gerben. On 11 apr, 16:22, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > I've changed Cake's default static "pages" architecture to be dynamic, > and also commented out the default route for this controller. All went > fine, until I tried to get some associations up and running. > > I tried to link pages to sites, using belongsTo, but when I do a > pr($data); in the view, nothing is shown. When I remove the > association it shows a normal array of all the pages. I tried several > kinds of associations, but they all have the same effect (nothing is > printed). > > I have no problems making associations in any other model, just the > pages one. Could there be some sort of (namespace?) conflict with the > inner workings of Cake? And if so, is there a solution, because I'd > really like to use the name "pages" in the url. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
associations in page model: (namespace) conflicts?
I've changed Cake's default static "pages" architecture to be dynamic, and also commented out the default route for this controller. All went fine, until I tried to get some associations up and running. I tried to link pages to sites, using belongsTo, but when I do a pr($data); in the view, nothing is shown. When I remove the association it shows a normal array of all the pages. I tried several kinds of associations, but they all have the same effect (nothing is printed). I have no problems making associations in any other model, just the pages one. Could there be some sort of (namespace?) conflict with the inner workings of Cake? And if so, is there a solution, because I'd really like to use the name "pages" in the url. --~--~-~--~~~---~--~~ 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 a whole view be loaded inside a hidden out of the screen..
You can just do an ajax->submit ''url_for_submit', 'update'=> 'div_to_update', 'complete' => $complete."some effects here maybe...?"); echo $ajax->submit('Save', $options); ?> Then in your controller you could make sure the from you had is rendered again. $this->render('myform' 'ajax'); The first parameter is a view, and the second parameter tells Cake the view should be rendered as ajax (which means: with an empty layout). Gerben. On 11 apr, 13:36, "rstuker" <[EMAIL PROTECTED]> wrote: > thanks gerbezomp!. I tried it and is ok. Is there a way to do the same > when it comes about submitting the same form using $ajax->? i mean no > reload,because when it happens( the user click the submit button) it > gets out of my .Obviously, it is expected to do that, just i > wanna commit new data & remain with no reloading in the same div. --~--~-~--~~~---~--~~ 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 a whole view be loaded inside a hidden out of the screen..
Wouldn't it be much easier (and less memory-intensive) to load the view through ajax only when it is needed. This way there will still be no page reloads, and it's a much cleaner way to accomplish it. link('link text', '/view/to/load/', array('update' => 'div_to_update', 'complete' => 'new Effect.Appear(\'div_to_update \')'), null, false); ?> Gerben. On 10 apr, 23:24, "rstuker" <[EMAIL PROTECTED]> wrote: > I'm trying to load a views as soon as the user logs in, inside > tag which is hidden out of the screen, so that it remaind there until > it is called. My animated menu (yui) in a certain moment call this > to move towards the center of the screen, with the view already > loaded.Later, moving the mouse over a certain place, the div moves > backwards to its initial position. I know that I certainly face many > problems. Instead of submitting a form, i will be using ajax to > accomplish the $this->model->save() method task...In general the idea > is to give the site the effect that never a page is reloaded. Anyway, > this is just an aim. Thanks in advance!. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Possible to put components and elements in plugin?
I heavily use AD7six's mini-controllers approach (http:// www.noswad.me.uk/MiBlog/MiniControllers) and because I combine this approach with the normal approach of having a model, controller, view, it would really be nice if I could bundle all this into a plugin. Is it possible to have components and elements insie a plugin, and if so, how can I make sure Cake finds them? I tried the normal way: var $components ('users'); -> should look in /plugins/my_plugin/ contollers/components/users.php and $this->renderElement('users'); -> should look in /plugins/my_plugin/ views/elements/users.thtml But for some reason this doesn't work. Any suggestions? --~--~-~--~~~---~--~~ 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: routing: custom sitename before EACH controller
Is this really not possible? I've tried to achieve this in a number of ways. On 7 apr, 23:41, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > I've read the article on routing (http://bakery.cakephp.org/articles/ > view/86) and serached through this group, but couldn't really find an > answer to this question: > > How can I enable users to have their custom sitename, like this: > > http://www.site.com/users_custom_sitename/controller/action/ > > So each user has their own sitename, and ALL controllers and actions > come after that in the URL. > > Is there a way to do this without having to make custom routes for > every controller and action? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
routing: custom sitename before EACH controller
I've read the article on routing (http://bakery.cakephp.org/articles/ view/86) and serached through this group, but couldn't really find an answer to this question: How can I enable users to have their custom sitename, like this: http://www.site.com/users_custom_sitename/controller/action/ So each user has their own sitename, and ALL controllers and actions come after that in the URL. Is there a way to do this without having to make custom routes for every controller and action? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to link the CSS
> background: url(/img/template/content_box/big-content_box-bg.jpg) Why do you keep your templates in the img folder? If you use more then one template of theme, you should take a look at the themeableView class: http://abing.gotdns.com/posts/2006/themeable-view-class-for-cakephp/ On 5 apr, 00:50, "Olwen Williams" <[EMAIL PROTECTED]> wrote: > Images used in css are relative to the the location of the css File > > On 05/04/07, rtconner <[EMAIL PROTECTED]> wrote: > > > > > Same problem here. I still dont know the answer, but putting the > > images in my css folder works. > > > Anyone have other ideas or practices they use? > > > On Mar 9, 1:55 am, "jaideepj" <[EMAIL PROTECTED]> wrote: > > > I have a doubt, > > > The thtml file has a link which refers href="/css/aptusa.css" its in > > > my server i have downloaded it and now the path added to it is / > > > amateurpokertour/trunk/app . > > > > > > media="screen" title="Amateur Poker Tour USA stylesheet" > > > charset="utf-8" /> > > > > Thecssfile consists of background like > > > > background: url(/img/template/content_box/big-content_box- > > > bg.jpg) > > > repeat-y; > > > > how can i link thecssfile with the thtml file with out adding this > > > extra urls /amateurpokertour/trunk/app . --~--~-~--~~~---~--~~ 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: subfolders in elements folder?
Ok, I described the issue: https://trac.cakephp.org/ticket/2345 Would be great if this enhancement could be made. For now, maybe the only solution is to use prefixes. Gerben. On 5 apr, 00:23, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > Nope, I already tried, but doing: > > var $components = array('widgets/wdgtRecentposts'); > > really doesn't work... > > I tried with a slash in front of the widgets folder as well. > > I would like to get this to work, because I use AD7six's "mini- > controllers" method for widgets (http://www.noswad.me.uk/MiBlog/ > MiniControllers), but because it saves so much loading time compared > to requestAction, it really comes in handy on many more occasions. The > components folder has become a mess ;) > > Also, it would be a logical way to show the link between the > components and the views (when using the "mini-controllers" method). > > One of the main reasons I started using Cake, was that I wanted to > code in a more organised, easy to understand way. And somehow things > are turning into a mess again, now I'm trying to avoid using > requestaction :) > > Thx for your thoughts everyone! I haven't found a ticket in Trac about > this, so I'll add one. > > Gerben. > > On 4 apr, 23:44, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > > > try it, if it doesn't work look for a ticket at trac.cakephp.org, if > > there isn't one make one > > > Sam D > > > On 4/4/07, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > > It's good to know there's a way to customize the paths for models, > > > views and controllers (I might use that option as well), but is there > > > REALLY no way to organize components in subfolders? That would really > > > be a solution for me, because I use components a lot. > > > > Anyway, the elements solution is already really working out! > > > > On 4 apr, 19:32, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > > > > I think he was asking about organizing you components folder with > > > > sub-folders > > > > > On 4/4/07, majna <[EMAIL PROTECTED]> wrote: > > > > > > Works for views, models, controllers and (test it) components. > > > > > Put this to config/bootstrap.php > > > > > Only add your custom paths... > > > > > > $modelPaths = array(APP.'myFolder'.DS.'models'.DS); > > > > > $viewPaths = array(APP.'myFolder'.DS.'views'.DS); > > > > > $controllerPaths = array(APP.'myFolder'.DS.'controllers'.DS); > > > > > $helperPaths = array(APP.'myFolder'.DS.'views'.DS.'helpers'.DS); > > > > > > On Apr 4, 5:07 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > > > > > > mainly I use it to keep admin stuff together, menu pieces together > > > > > > and > > > > > > form elements together > > > > > > > I don't think it works for helpers or components (but does for > > > > > > vendors) > > > > > > > On 4/4/07, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > > > > > > Oops! I figured that wouldn't be possible, because I never saw > > > > > > > anyone > > > > > > > do it. I'll try it! > > > > > > > > Good to hear you're doing it all the time, I thought this would > > > > > > > be a > > > > > > > really strange question ;) > > > > > > > > Is it also possible for components? > > > > > > > > Gerben. > > > > > > > > On 4 apr, 16:54, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > > > > > > > > I use sub folders all the time > > > > > > > > > $this->renderElement('this/that/and/the/other/thing'); > > > > > > > > > Did you try it and not have it work? > > > > > > > > > On 4/4/07, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > > > > > > > > Maybe a strange question, but is there a way I can have > > > > > > > > > subfolders in > > > > > > > > > the elements folder? I have so many elements I really need a > > > > > > > > > way to > > > > > > > > > organize them. Right now I give the elements a prefix_ but > &
Re: subfolders in elements folder?
Nope, I already tried, but doing: var $components = array('widgets/wdgtRecentposts'); really doesn't work... I tried with a slash in front of the widgets folder as well. I would like to get this to work, because I use AD7six's "mini- controllers" method for widgets (http://www.noswad.me.uk/MiBlog/ MiniControllers), but because it saves so much loading time compared to requestAction, it really comes in handy on many more occasions. The components folder has become a mess ;) Also, it would be a logical way to show the link between the components and the views (when using the "mini-controllers" method). One of the main reasons I started using Cake, was that I wanted to code in a more organised, easy to understand way. And somehow things are turning into a mess again, now I'm trying to avoid using requestaction :) Thx for your thoughts everyone! I haven't found a ticket in Trac about this, so I'll add one. Gerben. On 4 apr, 23:44, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > try it, if it doesn't work look for a ticket at trac.cakephp.org, if > there isn't one make one > > Sam D > > On 4/4/07, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > > > > > It's good to know there's a way to customize the paths for models, > > views and controllers (I might use that option as well), but is there > > REALLY no way to organize components in subfolders? That would really > > be a solution for me, because I use components a lot. > > > Anyway, the elements solution is already really working out! > > > On 4 apr, 19:32, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > > > I think he was asking about organizing you components folder with > > > sub-folders > > > > On 4/4/07, majna <[EMAIL PROTECTED]> wrote: > > > > > Works for views, models, controllers and (test it) components. > > > > Put this to config/bootstrap.php > > > > Only add your custom paths... > > > > > $modelPaths = array(APP.'myFolder'.DS.'models'.DS); > > > > $viewPaths = array(APP.'myFolder'.DS.'views'.DS); > > > > $controllerPaths = array(APP.'myFolder'.DS.'controllers'.DS); > > > > $helperPaths = array(APP.'myFolder'.DS.'views'.DS.'helpers'.DS); > > > > > On Apr 4, 5:07 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > > > > > mainly I use it to keep admin stuff together, menu pieces together and > > > > > form elements together > > > > > > I don't think it works for helpers or components (but does for > > > > > vendors) > > > > > > On 4/4/07, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > > > > > Oops! I figured that wouldn't be possible, because I never saw > > > > > > anyone > > > > > > do it. I'll try it! > > > > > > > Good to hear you're doing it all the time, I thought this would be a > > > > > > really strange question ;) > > > > > > > Is it also possible for components? > > > > > > > Gerben. > > > > > > > On 4 apr, 16:54, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > > > > > > > I use sub folders all the time > > > > > > > > $this->renderElement('this/that/and/the/other/thing'); > > > > > > > > Did you try it and not have it work? > > > > > > > > On 4/4/07, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > > > > > > > Maybe a strange question, but is there a way I can have > > > > > > > > subfolders in > > > > > > > > the elements folder? I have so many elements I really need a > > > > > > > > way to > > > > > > > > organize them. Right now I give the elements a prefix_ but but > > > > > > > > putting > > > > > > > > them in subfolders would be so much easier, and easier to read. > > > > > > > > > Or do I have to change the core code? I do have the themeable > > > > > > > > view > > > > > > > > class installed, so maybe I could change some paths there? > > > > > > > > -- > > > > > > > (the old fart) the advice is free, the lack of crankiness will > > > > > > > cost you > > > > > > > > - its a fine line bet
Re: subfolders in elements folder?
It's good to know there's a way to customize the paths for models, views and controllers (I might use that option as well), but is there REALLY no way to organize components in subfolders? That would really be a solution for me, because I use components a lot. Anyway, the elements solution is already really working out! On 4 apr, 19:32, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > I think he was asking about organizing you components folder with sub-folders > > On 4/4/07, majna <[EMAIL PROTECTED]> wrote: > > > > > > > Works for views, models, controllers and (test it) components. > > Put this to config/bootstrap.php > > Only add your custom paths... > > > $modelPaths = array(APP.'myFolder'.DS.'models'.DS); > > $viewPaths = array(APP.'myFolder'.DS.'views'.DS); > > $controllerPaths = array(APP.'myFolder'.DS.'controllers'.DS); > > $helperPaths = array(APP.'myFolder'.DS.'views'.DS.'helpers'.DS); > > > On Apr 4, 5:07 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > > > mainly I use it to keep admin stuff together, menu pieces together and > > > form elements together > > > > I don't think it works for helpers or components (but does for vendors) > > > > On 4/4/07, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > > > Oops! I figured that wouldn't be possible, because I never saw anyone > > > > do it. I'll try it! > > > > > Good to hear you're doing it all the time, I thought this would be a > > > > really strange question ;) > > > > > Is it also possible for components? > > > > > Gerben. > > > > > On 4 apr, 16:54, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > > > > > I use sub folders all the time > > > > > > $this->renderElement('this/that/and/the/other/thing'); > > > > > > Did you try it and not have it work? > > > > > > On 4/4/07, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > > > > > Maybe a strange question, but is there a way I can have subfolders > > > > > > in > > > > > > the elements folder? I have so many elements I really need a way to > > > > > > organize them. Right now I give the elements a prefix_ but but > > > > > > putting > > > > > > them in subfolders would be so much easier, and easier to read. > > > > > > > Or do I have to change the core code? I do have the themeable view > > > > > > class installed, so maybe I could change some paths there? > > > > > > -- > > > > > (the old fart) the advice is free, the lack of crankiness will cost > > > > > you > > > > > > - its a fine line between a real question and an idiot > > > > > >http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ > > > > -- > > > (the old fart) the advice is free, the lack of crankiness will cost you > > > > - its a fine line between a real question and an idiot > > > >http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ > > -- > (the old fart) the advice is free, the lack of crankiness will cost you > > - its a fine line between a real question and an idiot > > http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ 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: subfolders in elements folder?
Oops! I figured that wouldn't be possible, because I never saw anyone do it. I'll try it! Good to hear you're doing it all the time, I thought this would be a really strange question ;) Is it also possible for components? Gerben. On 4 apr, 16:54, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > I use sub folders all the time > > $this->renderElement('this/that/and/the/other/thing'); > > Did you try it and not have it work? > > On 4/4/07, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > > > Maybe a strange question, but is there a way I can have subfolders in > > the elements folder? I have so many elements I really need a way to > > organize them. Right now I give the elements a prefix_ but but putting > > them in subfolders would be so much easier, and easier to read. > > > Or do I have to change the core code? I do have the themeable view > > class installed, so maybe I could change some paths there? > > -- > (the old fart) the advice is free, the lack of crankiness will cost you > > - its a fine line between a real question and an idiot > > http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
subfolders in elements folder?
Maybe a strange question, but is there a way I can have subfolders in the elements folder? I have so many elements I really need a way to organize them. Right now I give the elements a prefix_ but but putting them in subfolders would be so much easier, and easier to read. Or do I have to change the core code? I do have the themeable view class installed, so maybe I could change some paths there? --~--~-~--~~~---~--~~ 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: window.onload and ajax
I believe it's the same problem as described about TinyMCE: http://bakery.cakephp.org/articles/view/140 -> "In response to point 2" But I can't see that solution fit with my example, because it's TinyMCE-specific. On 2 apr, 15:10, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > does it help you ? > >http://groups.google.com/group/cake-php/browse_thread/thread/1742022f... > > I'm not sure... I don't think I'm looking for a remote call on onload > of the entire page, I just need a way to initialize the uploader after > a user presses an $ajax->link. > > So I have a /posts/index/, and if a user presses the $ajax->link, a > div on the page is updated to display the uploader on that page (/ > files/upload/). > > The javascript configuration of the uploader is by default triggered > by window.onload, but because this time it's an ajax call, there is no > window.onload behaviour I can use to initialize the uploader. > > I've tried Mandy's example, but for some reason the function in > init.js isn't triggered. > > When I do something like this: > > alert('loaded'); > > > I DO see the alert after the ajax call is done. > > Strange... > > On 2 apr, 12:29, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > does it help you ? > > >http://groups.google.com/group/cake-php/browse_thread/thread/1742022f... > > > On Apr 2, 7:11 am, "Mandy" <[EMAIL PROTECTED]> wrote: > > > > You can just give a call to the function at the bottom of your ajax'd > > > response like this - > > > > > > > init_uploader(); > > > > > > > Just make sure evalScripts is set to 'true' while doing the ajax call > > > - it is used for evaluating the script received in an ajax response. > > > > Thanks, > > > Mandy.http://mandysingh.blogspot.com > > > > On Apr 1, 8:03 pm, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > > > I just built my own swfupload script using the new article in the > > > > bakery: > > > > >http://bakery.cakephp.org/articles/view/296 > > > > > It's a great article, and the uploader works fantastically! > > > > Everybody's talking about "ajax upload", but this is the first good > > > > implementation I've seen. > > > > > One question though: > > > > > The uploader is in my posts/add/ view, which I load into another view > > > > through ajax (only after the user presses the "add" button). In the > > > > article the uploader is initialized at window.onload using this line: > > > > > window.onload = init_uploader; > > > > > But of course this doesn't work with ajax. > > > > > How can I initialize the uploader once the ajax-call is made? --~--~-~--~~~---~--~~ 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: window.onload and ajax
> does it help you ? > http://groups.google.com/group/cake-php/browse_thread/thread/1742022f... I'm not sure... I don't think I'm looking for a remote call on onload of the entire page, I just need a way to initialize the uploader after a user presses an $ajax->link. So I have a /posts/index/, and if a user presses the $ajax->link, a div on the page is updated to display the uploader on that page (/ files/upload/). The javascript configuration of the uploader is by default triggered by window.onload, but because this time it's an ajax call, there is no window.onload behaviour I can use to initialize the uploader. I've tried Mandy's example, but for some reason the function in init.js isn't triggered. When I do something like this: alert('loaded'); I DO see the alert after the ajax call is done. Strange... On 2 apr, 12:29, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > does it help you ? > > http://groups.google.com/group/cake-php/browse_thread/thread/1742022f... > > On Apr 2, 7:11 am, "Mandy" <[EMAIL PROTECTED]> wrote: > > > You can just give a call to the function at the bottom of your ajax'd > > response like this - > > > > > init_uploader(); > > > > > Just make sure evalScripts is set to 'true' while doing the ajax call > > - it is used for evaluating the script received in an ajax response. > > > Thanks, > > Mandy.http://mandysingh.blogspot.com > > > On Apr 1, 8:03 pm, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > > I just built my own swfupload script using the new article in the > > > bakery: > > > >http://bakery.cakephp.org/articles/view/296 > > > > It's a great article, and the uploader works fantastically! > > > Everybody's talking about "ajax upload", but this is the first good > > > implementation I've seen. > > > > One question though: > > > > The uploader is in my posts/add/ view, which I load into another view > > > through ajax (only after the user presses the "add" button). In the > > > article the uploader is initialized at window.onload using this line: > > > > window.onload = init_uploader; > > > > But of course this doesn't work with ajax. > > > > How can I initialize the uploader once the ajax-call is made? --~--~-~--~~~---~--~~ 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: Determine current action using different method than $this->name
> One thing that might be relevant and becomes interesting in 1.2 is the > ability to cache elements (which I alluded to covertly in my previous > message); so instead of putting effort into the component/controller > side of things, you /could/ put requestAction or other logic in your > element and cache the result. If I understand you correctly, this means in 1.2 using requestAction within elements won't affect loading times so dramatically? That's good news! But it is probably still good practice to keep our systems light ;) One more question about the mini-contollers method in combination with plugins: I've put my component in: app/plugins/plugin_name/controllers/components/component_name.php The model I want to load from the component resides in plugins/models/ model_name.php but has a different name than the main plugin. When I use loadmodel('model_name'); Cake doesn't find the model I'm looking for, and when I use loadPluginModels('model_name'); it seems to find the plugin's app_model, not the model in the "models" folder (which has a different name from the plugin's app_model, because I want to be able to have several models in one plugin folder). How can I acces that model from within the component? thx for the great job you did on the mini-contollers, I really use them a lot! Gerben. On 2 apr, 14:01, "AD7six" <[EMAIL PROTECTED]> wrote: > On Apr 2, 1:40 pm, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > The problem seemed to be that I cannot pass the variable $this->name > > through requestaction. > > It would probably get overwritten if you put it in the params as > 'name', but you could have passed it either > > in the url > echo $this->requestAction ('/url/stuff/camefrom:'.$this->name.'.'. > $this->action.. > > or as a a differently named parameter. > echo $this->requestAction ('/url/stuff', array('camefrom'=>'.$this- > > >name.'.'.$this->action.. > > So that's another reason (apart from loading > > times) to use your 'mini-controllers' approach in this case. Thnx, > > it's working now! > > Cool. > > > > > Is your mini-controllers method ever going to be a standard part of > > Cake? Because if requestAction is so heavy this is a great workaround! > > I wouldn't expect so, it's not really adding to cake but using it. > Also I don't know if it duplicates something that is planned or > already present. But who knows. > > One thing that might be relevant and becomes interesting in 1.2 is the > ability to cache elements (which I alluded to covertly in my previous > message); so instead of putting effort into the component/controller > side of things, you /could/ put requestAction or other logic in your > element and cache the result. > it works like this echo $this->element('elementname',array('cache'=>'1 > week',other=>sfuff,if=>necessary)); > > Anyway, glad you found a solution, > > cheers, > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Determine current action using different method than $this->name
The problem seemed to be that I cannot pass the variable $this->name through requestaction. So that's another reason (apart from loading times) to use your 'mini-controllers' approach in this case. Thnx, it's working now! Is your mini-controllers method ever going to be a standard part of Cake? Because if requestAction is so heavy this is a great workaround! On 2 apr, 12:30, "AD7six" <[EMAIL PROTECTED]> wrote: > On Apr 2, 12:19 pm, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > I tried both your examples, but the problem seems to be that I use the > > requestaction within default.thtml, and it seems there's no data > > available about the parent action... > > > Is there some other way, because now I use the $_GET['url'] method, > > which is just very dirty and unreliable. > > a layout is processed by an instance of the class view (as is a > 'view') and $this->name and $this-action will be available for you to > use; aswell as other bits of info which you'll see with pr($this); > die; in the layout. When in the layout there is no parent action, as > you don't get a layout using requestAction. > > You may find though that using requestAction on every page (does this > change at all?) will add significantly (approx 30% min.) to your page > load times. You are probably better off simply using a component to > get whatever this plugin is processing, and an element to display it. > If the data doesn't change the component and/or element can refer to a > cached source of info. > > HTH, > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Determine current action using different method than $this->name
I tried both your examples, but the problem seems to be that I use the requestaction within default.thtml, and it seems there's no data available about the parent action... Is there some other way, because now I use the $_GET['url'] method, which is just very dirty and unreliable. On 2 apr, 08:23, "jitka" <[EMAIL PROTECTED]> wrote: > No 'standard' way how to determine action where requestAction was > called from (except for $_GET['url'] which is not 'clean usage of > cake' as You obviously do not need to use $_GET directly in cake). > > But: You can pass some parameter to requestAction like > > $a = $this->requestAction('/some/url', array('parent_action' => > 'whatever'); > > and then (inside of called method) > > if (!empty($this->params['requested'])) look for content of $this- > > >params['parent_action'] --~--~-~--~~~---~--~~ 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: Determine current action using different method than $this->name
Sorry, I meant controller, instead of action in the above post. On 2 apr, 02:29, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > I've made a plugin which is included in every page using > requestAction, but I need to show and hide different parts of the view > depending on the current main action (the action which is visible in > the url). > > I've tried using > > if($this->name == 'my_action'){ > //} > > else > { > // > > } > > But that method always returns the name of the plugin action, not the > main action in which the plugin view is included. > > Is there a good way to do this? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Determine current action using different method than $this->name
I've made a plugin which is included in every page using requestAction, but I need to show and hide different parts of the view depending on the current main action (the action which is visible in the url). I've tried using if($this->name == 'my_action'){ // } else { // } But that method always returns the name of the plugin action, not the main action in which the plugin view is included. Is there a good way to do this? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
window.onload and ajax
I just built my own swfupload script using the new article in the bakery: http://bakery.cakephp.org/articles/view/296 It's a great article, and the uploader works fantastically! Everybody's talking about "ajax upload", but this is the first good implementation I've seen. One question though: The uploader is in my posts/add/ view, which I load into another view through ajax (only after the user presses the "add" button). In the article the uploader is initialized at window.onload using this line: window.onload = init_uploader; But of course this doesn't work with ajax. How can I initialize the uploader once the ajax-call is made? --~--~-~--~~~---~--~~ 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: include another model's view
Works great! Thanks so much for the article on your blog, and for helping me out here on the group! I really wanted to get this working, because it's a good concept, and requestAction was really taking its toll in loading times. The menu widgets now get loaded dynamically through the database, and are draggable, so you can reorder them! Seeing it all work now is just awesome! Thx! Gerben. On 29 mrt, 14:19, "AD7six" <[EMAIL PROTECTED]> wrote: > On Mar 29, 1:27 pm, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > > > I've put it to rest for a while, and focussed on the development of > > other parts of my Cake app. Today I tried getting your example to work > > again, and this time it worked! I guess that I just didn't understand > > enough of Cake a few weeks ago. > > > One more question though: > > > I want to have the same kind of modular menu in every view of all my > > controllers, so I put my components in app_controller, like this: > > > var $components = array('Test', 'Recent'); > > > The "Recent" component fetches the lastest 10 posts, using: > > > $data= $this->controller->Post->findAll(NULL, NULL, 'Post.id DESC', > > 10); > > > When the pr($MenuContext); was in my "posts" view, everything worked > > fine, > > > but since i moved it into my widget_controller's view, I get the error > > "call to a member function on a non-object". > > > My actual question is: > > How should I reference objects (posts, articles, comments) from within > > the component, when I want to access them in another controller's > > view. > > do it the 'safe' way: > > loadModel('MyModel'); > $Instance = new MyModel(); > $resuls = $Instance->findAll(); > $stuff = $Instance->AssociatedModel->findAll(); > etc. > ... > > assuming that the controller has the model you want to use in the > component is in reality a bad practice - I think I should change > that :). > > hth, > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: include another model's view
I've put it to rest for a while, and focussed on the development of other parts of my Cake app. Today I tried getting your example to work again, and this time it worked! I guess that I just didn't understand enough of Cake a few weeks ago. One more question though: I want to have the same kind of modular menu in every view of all my controllers, so I put my components in app_controller, like this: var $components = array('Test', 'Recent'); The "Recent" component fetches the lastest 10 posts, using: $data= $this->controller->Post->findAll(NULL, NULL, 'Post.id DESC', 10); When the pr($MenuContext); was in my "posts" view, everything worked fine, but since i moved it into my widget_controller's view, I get the error "call to a member function on a non-object". My actual question is: How should I reference objects (posts, articles, comments) from within the component, when I want to access them in another controller's view. On 12 mrt, 16:40, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > Strange, I do use the requestHandler in my app_controller. > > Line 213 is: > if ((!$this->auto) || isset ($controller->params['requested']) || > $controller->RequestHandler->isAjax() || ($this->Session- > > >read('Config.components') === '0')) { > //... > } > > Gerben. > > On 12 mrt, 11:40, "AD7six" <[EMAIL PROTECTED]> wrote: > > > On Mar 12, 10:28 am, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > > Hi AD! > > > > Thanks for your reply! > > > > Ok, I'm beginning to see it: > > > > I've created a new component: test.php in controllers/components > > > > class TestComponent extends TemplateComponent { > > > var $name= 'Test'; > > > > function _getData() { > > > // some data for testing purposes > > > $data = 'hello world'; > > > return $data; > > > } > > > > } > > > > In my posts_controller I added: > > > > var $components = array ('Test'); > > > > And in views/posts/index.thtml: > > > > > > > > But I keep getting the error: > > > > Call to a member function on a non-object in /var/www/vhosts/zomp.nl/ > > > httpdocs/framework/app/controllers/components/template.php on line 213 > > > > Maybe I'm still doing something silly, but I don't see it now. > > > HI Gerbenzomp, > > > What is line 213 for you. > > > I would guess that you are currently not using thre requestHandler > > component, the code assumes you have it declared in your app > > controller. You can just remove that test, which isn't in that form > > any more in my dev env. > > > HTH, > > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Thank You for CakePHP
There's so much love put into the development of Cake, that anyone who uses it, cannot but love it! Thanks so much, Cake has been an eye- opener and is such a pleasure to work with! Gerben. On 18 mrt, 04:45, "phirschybar" <[EMAIL PROTECTED]> wrote: > true that. > > On Mar 17, 2:38 pm, "yolabingo" <[EMAIL PROTECTED]> wrote: > > > Ditto all above. --~--~-~--~~~---~--~~ 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: view saved post after ajax form submit
I've also tried requestAction, but that doen't seem to work either. On 16 mrt, 14:42, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > I've created an ajax form, which submits its data to /posts/add/. > > After that I want the ajax call to update a div, showing the view of > the post the user just submitted. The div to be updated should thus > contain the following view: > > /posts/view/id > > I know how I can update the div to display any view by doing the > following in my posts controller: > > if ($this->Post->save($this->data)) > { > $this->render('view_to_display', 'ajax'); > } > > And I know I can get the id of the post by doing: > > $post_id = $this->Post->getLastInsertId(); > > But how can I display the latest post in that div? --~--~-~--~~~---~--~~ 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 saved post after ajax form submit
I've created an ajax form, which submits its data to /posts/add/. After that I want the ajax call to update a div, showing the view of the post the user just submitted. The div to be updated should thus contain the following view: /posts/view/id I know how I can update the div to display any view by doing the following in my posts controller: if ($this->Post->save($this->data)) { $this->render('view_to_display', 'ajax'); } And I know I can get the id of the post by doing: $post_id = $this->Post->getLastInsertId(); But how can I display the latest post in that div? --~--~-~--~~~---~--~~ 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: Web Services in Cake 1.2.x.x
That's a good one ;) On 14 mrt, 18:24, "djiize" <[EMAIL PROTECTED]> wrote: > to avoid this little space at the end, don't close php tags > (forget the ?> at the end of the file) > seems dirty, but PHP automatically close php tags when reaching end of > file ;) > > On 14 mar, 18:07, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > Found it! There was one tiny little space after the php closing-tag of > > my app_model.php :) > > > Php isn't a picky programming-language, but with spaces it is ;) > > Spaces seem to be the only the invisible programming-errors we can > > make ;) > > > Feed is up-and running! I like the fact that your example is so nicely > > extendible: I have it set up like this: > > > mysite.com/xml/feeds/posts/ > > mysite.com/xml/feeds/comments/ > > mysite.com/xml/feeds/tags/ > > > etc. > > > By the way, I love your motto! Read your post, and can only agree: > > often you learn while building, and there's always things you couldn't > > foresee. Keep on building! > > > Gerben. > > > On 14 mrt, 17:47, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > > > > On 3/14/07, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > > > Hi Chris, > > > > > Thanks for the tutorial! Because I use version 1.1, I used your > > > > previous example (http://www.littlehart.net/atthekeyboard/2006/11/29/ > > > > using-cakephps-native-web-service-support/). It worked just fine > > > > (although it seems a lot easier in 1.2!), but I found a strange > > > > particularity when I wanted to use the Post-model (var $uses = > > > > 'Post';) to generate the feed from: > > > > Can't help you there as I haven't moved beyond that simple example. :) > > > > -- > > > Chris Hartjes > > > > My motto for 2007: "Just build it, damnit!" > > > > rallyhat.com - digital photo scavenger hunt > > > @TheBallpark -http://www.littlehart.net/attheballpark > > > @TheKeyboard -http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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: Web Services in Cake 1.2.x.x
Found it! There was one tiny little space after the php closing-tag of my app_model.php :) Php isn't a picky programming-language, but with spaces it is ;) Spaces seem to be the only the invisible programming-errors we can make ;) Feed is up-and running! I like the fact that your example is so nicely extendible: I have it set up like this: mysite.com/xml/feeds/posts/ mysite.com/xml/feeds/comments/ mysite.com/xml/feeds/tags/ etc. By the way, I love your motto! Read your post, and can only agree: often you learn while building, and there's always things you couldn't foresee. Keep on building! Gerben. On 14 mrt, 17:47, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On 3/14/07, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > > > Hi Chris, > > > Thanks for the tutorial! Because I use version 1.1, I used your > > previous example (http://www.littlehart.net/atthekeyboard/2006/11/29/ > > using-cakephps-native-web-service-support/). It worked just fine > > (although it seems a lot easier in 1.2!), but I found a strange > > particularity when I wanted to use the Post-model (var $uses = > > 'Post';) to generate the feed from: > > Can't help you there as I haven't moved beyond that simple example. :) > > -- > Chris Hartjes > > My motto for 2007: "Just build it, damnit!" > > rallyhat.com - digital photo scavenger hunt > @TheBallpark -http://www.littlehart.net/attheballpark > @TheKeyboard -http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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: Web Services in Cake 1.2.x.x
Hi Chris, Thanks for the tutorial! Because I use version 1.1, I used your previous example (http://www.littlehart.net/atthekeyboard/2006/11/29/ using-cakephps-native-web-service-support/). It worked just fine (although it seems a lot easier in 1.2!), but I found a strange particularity when I wanted to use the Post-model (var $uses = 'Post';) to generate the feed from: In some strange way a single space gets added before the "http://wordpress.org/support/topic/88581 It seems that the single space before the xml declaration is causing the feed to be unreadable. Then, of course I looked at the Post model, to see if I could find where that space came from, but I wasn't able to find it anywhere. Strange, isn't it? If I don't use the post model (or the comments- model, or any other model) the feed works perfectly fine, and validates. Does anyone know where the space might come from? On 14 mrt, 04:38, "dizz" <[EMAIL PROTECTED]> wrote: > Just took a look, looks pretty simple. Does CakePHP have any SOAP > functionality built in? > > On Mar 14, 9:58 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > > > Hey guys, with some help from Nate I just put together a little blog > > entry on my experiences building a web service with Cake 1.2.x.x. > > >http://www.littlehart.net/atthekeyboard/2007/03/13/how-easy-are-web-s... > > > (If the link above is destroyed by your mailer, just go > > tohttp://www.littlehart.net/atthekeyboardandit will be there). > > > Comments and feedback always welcome, as I am a self-promoting whore > > who loves the attention. > > > -- > > Chris Hartjes > > > My motto for 2007: "Just build it, damnit!" > > > rallyhat.com - digital photo scavenger hunt > > @TheBallpark -http://www.littlehart.net/attheballpark > > @TheKeyboard -http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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: email form
@ Mariano: Forget my remarks above: I think I've already solved it: I forgot to create the email view, containing: Which will very likely solve both issues described above :) On 14 mrt, 13:58, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > I think it would be wise to get familiar with 1.1 first, as that's the > > version the manual and most available documentation/info refers to. > > Cool, I'll stay on the safe side ;) There's still a lot to learn. > > Is the Cake-code backwards-compatible, or would I have to update parts > of my code once 1.2 is stable? > > @Mariano: > The code works now, so that's cool! But in the emails I send I get the > error: > > (Error rendering Element: email/text/default) > > The email also displays my whole default.thtml as plain text in the > email. Is your script supposed to send along the contents of > default.thtml, or just email_layout.thtml? > > Thanks for all your help! > > Gerben. > > On 14 mrt, 11:43, "AD7six" <[EMAIL PROTECTED]> wrote: > > > On Mar 14, 10:53 am, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > > BTW: Are you all working with version 1.2, and should I upgrade? Or > > > wait till it's stable? > > > I think it would be wise to get familiar with 1.1 first, as that's the > > version the manual and most available documentation/info refers to. > > > Cheers, > > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: email form
> I think it would be wise to get familiar with 1.1 first, as that's the > version the manual and most available documentation/info refers to. Cool, I'll stay on the safe side ;) There's still a lot to learn. Is the Cake-code backwards-compatible, or would I have to update parts of my code once 1.2 is stable? @Mariano: The code works now, so that's cool! But in the emails I send I get the error: (Error rendering Element: email/text/default) The email also displays my whole default.thtml as plain text in the email. Is your script supposed to send along the contents of default.thtml, or just email_layout.thtml? Thanks for all your help! Gerben. On 14 mrt, 11:43, "AD7six" <[EMAIL PROTECTED]> wrote: > On Mar 14, 10:53 am, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > BTW: Are you all working with version 1.2, and should I upgrade? Or > > wait till it's stable? > > I think it would be wise to get familiar with 1.1 first, as that's the > version the manual and most available documentation/info refers to. > > Cheers, > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: email form
BTW: Are you all working with version 1.2, and should I upgrade? Or wait till it's stable? Gerben. On 14 mrt, 01:34, "Mariano Iglesias" <[EMAIL PROTECTED]> wrote: > My bad. > > Good thing I asked him to do new Sanitize() and then pr > > -MI > > --- > > Remember, smart coders answer ten questions for every question they ask. > So be smart, be cool, and share your knowledge. > > BAKE ON! > > blog:http://www.MarianoIglesias.com.ar > > -Mensaje original- > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre > de gwoo > Enviado el: Martes, 13 de Marzo de 2007 09:27 p.m. > Para: Cake PHP > Asunto: Re: email form > > Sanitize cleanArray can not be called statically in 1.1. That was part > of the reason for the switch to clean. Also in 1.1 cleanArray uses a > reference of whatever you pass it, so you do not have to do $this- > > >data =. > > To sum it up, in 1.1 using Sanitize you must create an instance, while > in 1.2 you can call it either statically or after creating the > instance. --~--~-~--~~~---~--~~ 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: email form
Sorry, my mistake: I do have version 1.1 So what should the code read now? When I do this: uses('Sanitize'); $sanitize = new Sanitize(); pr($sanitize); and then exit; I get this: sanitize Object ( ) If I remove "exit;" to let the script go on, the email is sent, but in the email I get: (Error rendering Element: email/text/default) On 14 mrt, 01:34, "Mariano Iglesias" <[EMAIL PROTECTED]> wrote: > My bad. > > Good thing I asked him to do new Sanitize() and then pr > > -MI > > --- > > Remember, smart coders answer ten questions for every question they ask. > So be smart, be cool, and share your knowledge. > > BAKE ON! > > blog:http://www.MarianoIglesias.com.ar > > -Mensaje original- > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre > de gwoo > Enviado el: Martes, 13 de Marzo de 2007 09:27 p.m. > Para: Cake PHP > Asunto: Re: email form > > Sanitize cleanArray can not be called statically in 1.1. That was part > of the reason for the switch to clean. Also in 1.1 cleanArray uses a > reference of whatever you pass it, so you do not have to do $this- > > >data =. > > To sum it up, in 1.1 using Sanitize you must create an instance, while > in 1.2 you can call it either statically or after creating the > instance. --~--~-~--~~~---~--~~ 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: email form
This is the controller code as I have it: data)) { // no data has been passed to page from form $this->render(); } else { // data has been passed from form // validate model using ->validates() not ->save() if($this->Contact->set($this->data) && $this->Contact- >validates()) // update to the original { // Validation passed uses('Sanitize'); $this->data = Sanitize::cleanArray($this->data); $defaultLayout = $this->layout; $this->layout = 'email'; $this->Email->headers = "Content-type: text/plain; charset=iso-8859-1\n"; $this->Email->to = "[EMAIL PROTECTED]"; $this->Email->from = $this->data['Contact']['name'].' <'.$this- >data['Contact']['email'].'>'; $this->Email->subject = 'website contact'; $this->Email->thtml = 'email_layout'; $this->Email->controller = &$this; $this->set('data',$this->data); $this->Email->send(); $this->set('sent',1); $this->render('index',$defaultLayout); } else { // Validation failed $this->validateErrors($this->Contact); // for triggering $html- >tagErroMsg() } } /* $this->set('email', $this->data['User']['email']); $this->set('password', $passwordOrig); //Send email */ } } ?> On 13 mrt, 16:42, "Mariano Iglesias" <[EMAIL PROTECTED]> wrote: > Eventhough one calls the other, use cleanArray(), not cleanArrayr() > > Can you paste the code as you have it? > > -MI > > --- > > Remember, smart coders answer ten questions for every question they ask. > So be smart, be cool, and share your knowledge. > > BAKE ON! > > blog:http://www.MarianoIglesias.com.ar > > -Mensaje original- > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre > de gerbenzomp > Enviado el: Martes, 13 de Marzo de 2007 10:47 a.m. > Para: Cake PHP > Asunto: Re: email form > > Changed that, but get a fatal error: > > Fatal error: Call to undefined function: cleanarrayr() --~--~-~--~~~---~--~~ 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: email form
> Should be: > > uses('Sanitize'); > $this->data = Sanitize::cleanArray($this->data); Changed that, but get a fatal error: Fatal error: Call to undefined function: cleanarrayr() I looked at sanitize.php and the cleanArrayR(); function is present. On 13 mrt, 13:26, "Mariano Iglesias" <[EMAIL PROTECTED]> wrote: > This: > > $this->Sanitize->cleanArray($this->data); > > Should be: > > uses('Sanitize'); > $this->data = Sanitize::cleanArray($this->data); > > -MI > > --- > > Remember, smart coders answer ten questions for every question they ask. > So be smart, be cool, and share your knowledge. > > BAKE ON! > > blog:http://www.MarianoIglesias.com.ar > > -Mensaje original- > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre > de gerbenzomp > Enviado el: Martes, 13 de Marzo de 2007 08:36 a.m. > Para: Cake PHP > Asunto: Re: email form > > I'm using Mariano's email form code as well, and updated it to work > with 1.2, but it still throws errors over this line: > > $this->Sanitize->cleanArray($this->data); > > error: "Call to a member-function on a non-object" > > Any idea what could be the problem? Maybe I use the wrong email- > component? --~--~-~--~~~---~--~~ 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: Categories dropdown
Sorry, I'm still getting used to the concepts. I guess I was just unsure about how to access data from another model, but I found out I can just acces the category model by doing this: $this->Post->Category->generateList(); // notice the Post->Category part Wow, Cake amazes me with its intuïtivity all the time! Thanks for pointing to the link, it helped me out! Gerben. On 13 mrt, 13:45, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > On 3/13/07, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > In my app, a post can belong to one category, and I want to list all > > categories in a dropdown, with the current category selected. > > Hmmm... why do I have a sinking feeling that you have not really read > the manual? > > http://manual.cakephp.org/chapter/modelslook up generateList and > then explore the HTML helper a bit > > Tarique > > -- > = > PHP for E-Biz:http://sanisoft.com > Cheesecake-Photoblog:http://cheesecake-photoblog.org > = --~--~-~--~~~---~--~~ 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: email form
I'm using Mariano's email form code as well, and updated it to work with 1.2, but it still throws errors over this line: $this->Sanitize->cleanArray($this->data); error: "Call to a member-function on a non-object" Any idea what could be the problem? Maybe I use the wrong email- component? On 13 mrt, 11:01, "Mariano Iglesias" <[EMAIL PROTECTED]> wrote: > Also see: > > https://trac.cakephp.org/ticket/2241 > > -MI > > --- > > Remember, smart coders answer ten questions for every question they ask. > So be smart, be cool, and share your knowledge. > > BAKE ON! > > blog:http://www.MarianoIglesias.com.ar > > -Mensaje original- > De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre > de GreyCells > Enviado el: Martes, 13 de Marzo de 2007 06:06 a.m. > Para: Cake PHP > Asunto: Re: email form > > This is not a bug - I thought it was too, but see: > > https://trac.cakephp.org/ticket/2026 > > You need to override loadInfo() in the model.. --~--~-~--~~~---~--~~ 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: Categories dropdown
Thanks, that worked, but now I get other errors about undefined indexes and undefined variables... Looking at my code it doesn't really make sense either. Maybe the example I found isn't really suitable for what I'm trying to achieve? In my app, a post can belong to one category, and I want to list all categories in a dropdown, with the current category selected. This is the code now: function edit($id = null) { if (empty($this->data)) { //getting the categories $categories = $this->Post->Category->findAll(); foreach($categories as $pass) { foreach ($pass as $key => $value) { $cats[$value['id']] = $value['title']; if ($value['id'] === $data['post']['category_id']) // where does the $cats array come from? { $catselected = $value['id']; } //end if } //end foreach } //end foreach $this->set('cats', $cats); $this->set('catselected', $catselected); } else { //... } On 13 mrt, 11:13, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > On 3/13/07, gerbenzomp <[EMAIL PROTECTED]> wrote: > > > foreach ($this->model['post']->category->findAll() as $pass) > > Try > > $categories = $this->Post->Category->findAll(); > foreach($categories as $pass) > > HTH > Tarique > > -- > = > PHP for E-Biz:http://sanisoft.com > Cheesecake-Photoblog:http://cheesecake-photoblog.org > = --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Categories dropdown
I'm trying to create a dropdown list to select the category in the add and edit views of the Post controller. I found an example in this thread: http://groups.google.com/group/cake-php/browse_thread/thread/a4af5b2ffeb1231e/0de3fed71d9697c2?lnk=gst&q=category+dropdown&rnum=1#0de3fed71d9697c2 So I did it like this, but I keep getting the error: Fatal error: Call to a member function on a non-object in /var/www/ vhosts/zomp.nl/httpdocs/framework/app/controllers/posts_controller.php on line 91 That's this line: foreach ($this->model['post']->category->findAll() as $pass) And (-might be helpful-) my post model looks like this: class Post extends AppModel { // var $belongsTo = array('Category' => array('className' => 'Category', 'conditions'=> '', 'order' => 'Category.id DESC', 'limit' => '', 'foreignKey'=> 'category_id', 'dependent' => true, 'exclusive' => false, 'finderQuery' => '' ) ); //... } The relation between the two works, because I can easily fetch each post's category through the Post model. Any clues about what I'm doing wrong? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: include another model's view
Strange, I do use the requestHandler in my app_controller. Line 213 is: if ((!$this->auto) || isset ($controller->params['requested']) || $controller->RequestHandler->isAjax() || ($this->Session- >read('Config.components') === '0')) { //... } Gerben. On 12 mrt, 11:40, "AD7six" <[EMAIL PROTECTED]> wrote: > On Mar 12, 10:28 am, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > > > Hi AD! > > > Thanks for your reply! > > > Ok, I'm beginning to see it: > > > I've created a new component: test.php in controllers/components > > > class TestComponent extends TemplateComponent { > > var $name= 'Test'; > > > function _getData() { > > // some data for testing purposes > > $data = 'hello world'; > > return $data; > > } > > > } > > > In my posts_controller I added: > > > var $components = array ('Test'); > > > And in views/posts/index.thtml: > > > > > > But I keep getting the error: > > > Call to a member function on a non-object in /var/www/vhosts/zomp.nl/ > > httpdocs/framework/app/controllers/components/template.php on line 213 > > > Maybe I'm still doing something silly, but I don't see it now. > > HI Gerbenzomp, > > What is line 213 for you. > > I would guess that you are currently not using thre requestHandler > component, the code assumes you have it declared in your app > controller. You can just remove that test, which isn't in that form > any more in my dev env. > > HTH, > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: include another model's view
Hi AD! Thanks for your reply! Ok, I'm beginning to see it: I've created a new component: test.php in controllers/components class TestComponent extends TemplateComponent { var $name= 'Test'; function _getData() { // some data for testing purposes $data = 'hello world'; return $data; } } In my posts_controller I added: var $components = array ('Test'); And in views/posts/index.thtml: But I keep getting the error: Call to a member function on a non-object in /var/www/vhosts/zomp.nl/ httpdocs/framework/app/controllers/components/template.php on line 213 Maybe I'm still doing something silly, but I don't see it now. I've succeeded in creating a widget menu-structure using requestAction and the plugins-system, but since many requestAction calls can easily increase page loading times, I think your solution would be much more elegant. Thanks! Gerben. On 12 mrt, 08:59, "AD7six" <[EMAIL PROTECTED]> wrote: > On Mar 11, 3:59 pm, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > > > Hey AD7six, > > > I've been working hard to try and get your example code to work > > (http://www.noswad.me.uk/MiBlog/MiniControllers), but being fairly new > > to cake, I guess I got stuck because I've jumped from the basics to > > something more advanced. I thought if I would get your archive example > > to work, I would understand the concept, and could go on creating my > > own "widgets" (or "blobs", as you called them). But I gues I need some > > more guidance as to the structure of the plugins your example code > > expects. > > > To my understanding I need to create a plugin called "blogs" (with its > > own blogs_app_controller.php and blogs_app_model.php and its own > > controller, model and views), but I guess I am wrong. I wasn't sure > > either how I should include the widget in another controller's view. > > > Can you explain a bit more about how to implement your solution? > > Hi Gerbenzomp, > > You shouldn't need a plugin to make use ot that code; the only > reference to a plugin is to generate the cache path. > > With the code as presented as of right now, if you: > > put the template and 'your' component in your app/controllers/ > component folder > In your controller you have var $components = array('your'); > define the method _getData in 'your' component to return something > (anything if you are just testing). > > Then in your view/layout/element do pr ($MenuContext); die; > > That should make thing clearer. > > HTH, > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: include another model's view
Hey AD7six, I've been working hard to try and get your example code to work (http://www.noswad.me.uk/MiBlog/MiniControllers), but being fairly new to cake, I guess I got stuck because I've jumped from the basics to something more advanced. I thought if I would get your archive example to work, I would understand the concept, and could go on creating my own "widgets" (or "blobs", as you called them). But I gues I need some more guidance as to the structure of the plugins your example code expects. To my understanding I need to create a plugin called "blogs" (with its own blogs_app_controller.php and blogs_app_model.php and its own controller, model and views), but I guess I am wrong. I wasn't sure either how I should include the widget in another controller's view. Can you explain a bit more about how to implement your solution? Thanks a lot in advance! On 1 mrt, 12:52, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > Hi AD7six! > > Thanks a lot for your comprehensive article! It seems we're both > aiming for the same thing: a while ago I wrote such a system as the > Google personalised homepage, in php and with the help of > scriptaculous, to create an online WYSIWYG website builder and CMS. > Now I'm trying to partly re-create this in Cake. > > Bit of a turndown to read that Cake doesn't have built-in support for > suchmodulardesign, especially since scriptaculous has such flexible > drag-and-drop features. I'll try out your mini-modules solution, and > see if I can get it to work! I'll keep you posted! > > > PS Model's don't have views, but perhpas that was a slip of the keys. > > Yep, I meant another controller's view :) > > On 1 mrt, 08:47, "AD7six" <[EMAIL PROTECTED]> wrote: > > > On Mar 1, 8:45 am, "AD7six" <[EMAIL PROTECTED]> wrote: > > > > On Mar 1, 12:08 am, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > > > I've been programming in php for years, but I'm relatively new to > > > > cake. I must say I am amazed at the ease of use and intuïtivity of the > > > > framework! Mostly things just work the way you expect them to, which > > > > makes it very easy to work with, and a great pleasure too! > > > > > There's also a lot of good documentation, so most questions I had, > > > > were easily answered. Now i want to do something a little more > > > > complex, and ran into a problem: > > > > > I want to use Cake's plugin-structure to allow for an extendible set > > > > of, well let's call them "menu-widgets" for the navigation-bar of my > > > > blog system. > > > > > So each "widget" resides in its own folder within the plugins-folder, > > > > and has its own add/edit/delete methods and views. > > > > > But now I want to include the main view (view.thtml) of each widget in > > > > the sidebar of my blog. Any ideas on how to do that? > > > > The immediate answer would be to use reqesutAction, the (not really > > > slow) answer is to make use of elements. I wrote about a solution to > > > this sort ofmodulardesign problem on my blog about this only > > > yesterday (how ironic).http://www.noswad.me.uk/MiBlog/MiniControllers > > > > HTH, > > > > AD > > > PS Model's don't have views, but perhpas that was a slip of the keys. --~--~-~--~~~---~--~~ 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: include another model's view
Hi AD7six! Thanks a lot for your comprehensive article! It seems we're both aiming for the same thing: a while ago I wrote such a system as the Google personalised homepage, in php and with the help of scriptaculous, to create an online WYSIWYG website builder and CMS. Now I'm trying to partly re-create this in Cake. Bit of a turndown to read that Cake doesn't have built-in support for such modular design, especially since scriptaculous has such flexible drag-and-drop features. I'll try out your mini-modules solution, and see if I can get it to work! I'll keep you posted! > PS Model's don't have views, but perhpas that was a slip of the keys. Yep, I meant another controller's view :) On 1 mrt, 08:47, "AD7six" <[EMAIL PROTECTED]> wrote: > On Mar 1, 8:45 am, "AD7six" <[EMAIL PROTECTED]> wrote: > > > > > On Mar 1, 12:08 am, "gerbenzomp" <[EMAIL PROTECTED]> wrote: > > > > I've been programming in php for years, but I'm relatively new to > > > cake. I must say I am amazed at the ease of use and intuïtivity of the > > > framework! Mostly things just work the way you expect them to, which > > > makes it very easy to work with, and a great pleasure too! > > > > There's also a lot of good documentation, so most questions I had, > > > were easily answered. Now i want to do something a little more > > > complex, and ran into a problem: > > > > I want to use Cake's plugin-structure to allow for an extendible set > > > of, well let's call them "menu-widgets" for the navigation-bar of my > > > blog system. > > > > So each "widget" resides in its own folder within the plugins-folder, > > > and has its own add/edit/delete methods and views. > > > > But now I want to include the main view (view.thtml) of each widget in > > > the sidebar of my blog. Any ideas on how to do that? > > > The immediate answer would be to use reqesutAction, the (not really > > slow) answer is to make use of elements. I wrote about a solution to > > this sort of modular design problem on my blog about this only > > yesterday (how ironic).http://www.noswad.me.uk/MiBlog/MiniControllers > > > HTH, > > > AD > > PS Model's don't have views, but perhpas that was a slip of the keys. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
include another model's view
I've been programming in php for years, but I'm relatively new to cake. I must say I am amazed at the ease of use and intuïtivity of the framework! Mostly things just work the way you expect them to, which makes it very easy to work with, and a great pleasure too! There's also a lot of good documentation, so most questions I had, were easily answered. Now i want to do something a little more complex, and ran into a problem: I want to use Cake's plugin-structure to allow for an extendible set of, well let's call them "menu-widgets" for the navigation-bar of my blog system. So each "widget" resides in its own folder within the plugins-folder, and has its own add/edit/delete methods and views. But now I want to include the main view (view.thtml) of each widget in the sidebar of my blog. Any ideas on how to do that? Thanks, Gerben from The Netherlands --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
ajax imagelink
I would like to attach an ajax-call to an image, instead of a text- link, but I can't get it to work. My code is: link('/icons/edit.png', '/posts/edit/'.$post['Post'] ['id'], array('update' => array('post_'.$post['Post']['id'], 'second'))); ?> --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---