Re: How to set class on form template node with {{attrs}} defined?
I had another look at the code and found that this seems to be a tough nut to crack. Since some templates are called directly from the form helper methods and some attributes get set inside the widgets it is a bit of a problem setting a default class via a single method or in a single place. The reason I needed to set a class was for jquery to execute operations on the input elements. I have decided to create a custom html attribute instead called "render" and invoke it like so: $('[render="wysiwyg"]').; Now I can just extend the form helper's input function and add the required render method to the options from my field configuration registry. Would be great if we were able to set default or primary attribute values via the theme but I fear the template method might make this near impossible right now. My problem is resolved but if there is a better way of doing this, please let me know. Thanks. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
How to set class on form template node with {{attrs}} defined?
I have a question regarding this type of scenario regarding form templates. Lets say I am trying to change the default class of label in the following example: 'nestingLabel' => '{{input}}{{text}}', Doing this wont work since the attrs might also have a class attribute that could cause a double class declaration: {{text}} Where would be the correct place to define this default class? Should I extend the widget and add it to the default options there or is there a better way to accomplish this? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: 3.0 change order by a weight column
Thanks, I will create a behavior to handle this. Didn't want to create it if it already existed. Will share it on github when I am done. On Thursday, February 5, 2015 at 3:08:53 PM UTC+2, José Lorenzo wrote: > > That sounds like the ListBehavior. This is a version of it for cake 2 > https://github.com/CakeDC/utils/blob/master/Model/Behavior/ListBehavior.php > > It will need to be updated for the new ORM > > On Thursday, February 5, 2015 at 4:55:20 AM UTC-4:30, Dieter Gribnitz > wrote: >> >> Are there any built in behaviors to deal with reordering entries by a >> weight column? >> >> Lets say I want to move an entry from 5 to 3. >> 3 should update to a weight key of 4 and 4 should update to a weight key >> of 5 >> >> In addition, how do you set the default field to witch results should be >> sorted by. >> >> Scanned through the docs and could not find anything relating to this. >> Any links to relevant documentation on this matter would be greatly >> helpful. >> >> >> Thanks. >> > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
3.0 change order by a weight column
Are there any built in behaviors to deal with reordering entries by a weight column? Lets say I want to move an entry from 5 to 3. 3 should update to a weight key of 4 and 4 should update to a weight key of 5 In addition, how do you set the default field to witch results should be sorted by. Scanned through the docs and could not find anything relating to this. Any links to relevant documentation on this matter would be greatly helpful. Thanks. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Calling Cells or Helpers from a Widget
Hi, Just wanted to find out if there is any good way to call a Cell, Helper or View object from a Widget. I have a workaround for my current needs but would just like to know if there is a proper way to accomplish this for future reference. Thanks. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: 3.0 plugin installer path
Never mind. I fixed the issues I had regarding the paths. I forgot that I already converted my bash scripts to cake shell scripts. It was trivially easy to update the paths since I have access to functions like Plugin::path() from within the shell. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
3.0 plugin installer path
Hi, I have been using the composer plugin installer for some of the plugins I am working on. I see that the plugins now install to the vendor/namespace/PluginName dir instead of src/Plugins/PluginName. Is there any way for me to configure the installer to install to the Plugins dir instead of vendor? I have some cli scripts that rely on these plugins being in the Plugins dir. If I have to I can update the cli scripts but I would like to avoid doing this if possible. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Browser caching routes (3.0)
I have a small request. I struggled getting my routes to work properly because firefox was caching routes. Could you please put a note near the beginning of the cache documentation to warn people to turn browser cache off. Here is how you do it in firefox: 1. Enter about:config in url. 2. Search for "cache". 3. Disable "network.http.use-cache" I had a really tough time figuring out why things were not working as expected and it turned out to be a browser issue. A small note on this could help a lot of other people avoid the same pitfall. Thanks. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: 3.0 Is it possible to execute console commands from shell tasks?
Thanks, exec did not do exactly what I needed since I need live feedback with the ability to respond to prompts. I did manage to solve it with popen. If anyone else needs this, here is how I resolved it. $cwd = ROOT; $cmds = [ "cd $cwd", "grunt update" ]; //Array of commands to execute $cmd = implode(' && ', $cmds); while (@ ob_end_flush()); $proc = popen($cmd, 'r'); while (!feof($proc)){ echo fread($proc, 4096); @ flush(); } On Wednesday, September 10, 2014 3:33:23 PM UTC+2, José Lorenzo wrote: > > you can use the php exec() function. > > On Wednesday, September 10, 2014 10:59:44 AM UTC+2, Dieter Gribnitz wrote: >> >> Here is a simple scenario. >> I have a shell script in the App\Shell namespace. >> When I run the task I would like to have some console commands such as >> `grunt update` triggered. >> Is it possible to run these types of commands from the ConsoleShell? >> Some of these tasks may require user input thus it cannot be run without >> feedback from the user. >> > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
3.0 Is it possible to execute console commands from shell tasks?
Here is a simple scenario. I have a shell script in the App\Shell namespace. When I run the task I would like to have some console commands such as `grunt update` triggered. Is it possible to run these types of commands from the ConsoleShell? Some of these tasks may require user input thus it cannot be run without feedback from the user. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: 3.0 Possible to remove column?
Nevermind, I got it working. Pretty obvious. Just tried removeColumn(...) and it works. You might consider mentioning it in the documentation after the addColumn section. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
3.0 Possible to remove column?
I can't seem to find any method to remove columns via Database/Schema/Table. Is there a way to do this? I am creating an uninstaller for a plugin and this would come in handy. If not I will just use a normal sql query instead. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: 3.0 Plugin Installation DB schema setup
Thanks, That is exactly what I was looking for. On Sunday, August 31, 2014 11:43:57 AM UTC+2, José Lorenzo wrote: > > For "packaging" and versioning the database I would suggest using the > migrations plugin: > > http://github.com/cakephp/migrations > > Composer has post install scripts you can setup. But it would be better to > let the user run the migrations on their own. > > > On Sunday, August 31, 2014 10:46:49 AM UTC+2, Dieter Gribnitz wrote: >> >> Hi, >> I had a look around on the web and could not find any documentation >> surrounding the setup of plugins. >> If there are any documentation surrounding plugin packaging I would >> greatly appreciate someone pointing me in the right direction. >> I have managed to set up a simple installer that loads the plugin via a >> git repo similar to debug-kit. >> >> Here are the basic questions I have regarding this: >> Is there currently any way to export a part of your DB schema in 3.0 and >> package it in the config of the plugin on the git repo? >> Is there any way to alter tables with version changes? >> Are there any scripts that get triggered to run post plugin install or >> update? >> >> Thanks. >> > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
3.0 Plugin Installation DB schema setup
Hi, I had a look around on the web and could not find any documentation surrounding the setup of plugins. If there are any documentation surrounding plugin packaging I would greatly appreciate someone pointing me in the right direction. I have managed to set up a simple installer that loads the plugin via a git repo similar to debug-kit. Here are the basic questions I have regarding this: Is there currently any way to export a part of your DB schema in 3.0 and package it in the config of the plugin on the git repo? Is there any way to alter tables with version changes? Are there any scripts that get triggered to run post plugin install or update? Thanks. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: 3.0 Best practice for checkboxes instead of multiselect list
For some reason I always find the answer the second after I post a question. Just found the MultiCheckbox widget. This solves my issu -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
3.0 Best practice for checkboxes instead of multiselect list
I am trying to implement jstree for a multi select list. I would like to use checkboxes in order to reference the id's of the options via javascript. Is there and easy way to print a multi select list as checkboxes. I see it says something about this ability in the documentation but I can't seem to find the correct syntax to get this to work. Thanks. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: 3.0 Can you save and create entities simultainiously for belongsToMany relationsips
Thanks, This approach will be a bit difficult to implement since I am working on an abstract class that deals with deeply nested data. Will see if I can make something work along these lines. Think I might have found a small bug relating to the normal non _ids save method. Have posted that question on github. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
3.0 Can you save and create entities simultainiously for belongsToMany relationsips
When saving data that have new relations and a selection of relations only the selection gets updated and new relations get discarded. example post: [id] => 1 [title] => entry 1 [relations] => Array ( [_ids] => Array ( [0] => 1 [1] => 3 ), [0] => Array ( [status] => 1 [title] => test ) ) Is there a way to pass the data that will allow a user to select relations + create new ones if they do not exist or do I need to create some kind of data preprocessor to create the new entities and add their ids to the _ids key before sending the data to the marshaller? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: Extending Core classes?
Thanks, That works prefectly On Wednesday, July 23, 2014 12:44:15 PM UTC+2, José Lorenzo wrote: > > The easiest way is to extend the core class and make your controller use > it. In you case it is as easy as declaring $viewClass in your AppController: > > > https://github.com/cakephp/cakephp/blob/3.0/src/Controller/Controller.php#L172 > > just re-declare that string so it says App\View\View > > > > On Wednesday, July 23, 2014 11:06:33 AM UTC+2, Dieter Gribnitz wrote: >> >> Is it currently possible to extend core classes in 3.0? >> The namespace convention works with most files but how would I go about >> doing something like this. >> >> I would like to modify a method in Cake\View\View >> Here is what I have tried. >> >> I have copied the cakephp/src/View/View.php file to my src/View/View.php >> file. >> Changed the namespace to: >> namespace App\View; >> Changed the class to: >> class View extends \Cake\View >> >> This file does not seem to get called like the other Controllers, >> Helpers, Components etc... >> Is it possible to override Files like these while leaving the core alone? >> In 2.x you could do this with the Lib dir. >> >> >> -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Extending Core classes?
Is it currently possible to extend core classes in 3.0? The namespace convention works with most files but how would I go about doing something like this. I would like to modify a method in Cake\View\View Here is what I have tried. I have copied the cakephp/src/View/View.php file to my src/View/View.php file. Changed the namespace to: namespace App\View; Changed the class to: class View extends \Cake\View This file does not seem to get called like the other Controllers, Helpers, Components etc... Is it possible to override Files like these while leaving the core alone? In 2.x you could do this with the Lib dir. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.