Whats nes in Version 2?
Hello everybody... can anybody tell me what's new in version 2? I didn't find a summery anywhere. Thanks! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Strange Session Data Corruption on CakePHP
On Nov 14, 7:06 am, Rayhan Chowdhury rayha...@gmail.com wrote: Yes, I want to back to this url later, but it gets changed, so I am in big trouble... Start from the assumption that code doesn't lie or magically do different things than asked How is it possible for .. /loading2.gif to be stored in the session if you're storing the current url - once that's sunk in the solution should be obvious. AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Whats nes in Version 2?
On Nov 14, 9:43 am, Gerrit lober.ger...@googlemail.com wrote: Hello everybody... can anybody tell me what's new in version 2? I didn't find a summery anywhere. http://lmgtfy.com/?q=cakephp+2.0 Strange that none of those results were relevant. My Personal favorite is the one titled CakePHP 2.0 released | The Bakery, Everything CakePHP AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Whats nes in Version 2?
Okay, thank you. I had expected some big changes. On 14 Nov., 09:51, AD7six andydawso...@gmail.com wrote: On Nov 14, 9:43 am, Gerrit lober.ger...@googlemail.com wrote: Hello everybody... can anybody tell me what's new in version 2? I didn't find a summery anywhere. http://lmgtfy.com/?q=cakephp+2.0 Strange that none of those results were relevant. My Personal favorite is the one titled CakePHP 2.0 released | The Bakery, Everything CakePHP AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Question on the session handler
Hello, I have create two separate web applications but this application have to share the same db, so I thought I would create two separate tables for session management on db, my question would be, can I do this through configuration, or do I create a new session handler? thanks for your attention -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: hi need to maintain to layouts one for admin and one for remaining
In AppController::beforeFilter iif (isset($this-params['admin']) ($this-params['admin'] == 1)) { $this-layout = 'admin'; } This is for Cake 1.3, in Cake 2 I know $this-params has been replaced with other similar propertie. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: hi need to maintain to layouts one for admin and one for remaining
Its working. On Nov 14, 3:05 pm, Xoubaman xouba...@gmail.com wrote: In AppController::beforeFilter iif (isset($this-params['admin']) ($this-params['admin'] == 1)) { $this-layout = 'admin'; } This is for Cake 1.3, in Cake 2 I know $this-params has been replaced with other similar propertie. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: hi need to maintain to layouts one for admin and one for remaining
if (!empty($this-params['admin'])) {} suffices On 14 Nov., 11:20, anjith anjithkumar.garap...@gmail.com wrote: Its working. On Nov 14, 3:05 pm, Xoubaman xouba...@gmail.com wrote: In AppController::beforeFilter iif (isset($this-params['admin']) ($this-params['admin'] == 1)) { $this-layout = 'admin'; } This is for Cake 1.3, in Cake 2 I know $this-params has been replaced with other similar propertie. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Question on the session handler
Hey, You should be able to change your session configuration slightly: /// in: Config/core.php Configure::write('Session.handler', array( 'model' = 'MySession' )); Configure::write('Session', array( 'defaults' = 'database' )); /// Create your session model in: Model/MySession.php ?php class MySession extends AppModel { } From there you can do normal things like, tinkering with the $useTable to change the table name. You can just name that MySession to whatever you want to match your table, as with any CakePHP model. Cheers, Graham Weldon http://grahamweldon.com e. gra...@grahamweldon.com p. (+61) 0407 017 293 Skype: grahamweldon On Monday, 14 November 2011 at 8:38 PM, socrates wrote: Hello, I have create two separate web applications but this application have to share the same db, so I thought I would create two separate tables for session management on db, my question would be, can I do this through configuration, or do I create a new session handler? thanks for your attention -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: TimeHelper problem
Thanks Thiago, that was the problem On Nov 13, 10:32 pm, Thiago Belem cont...@thiagobelem.net wrote: Did you enabled the TimeHelper on the $helpers property on your Controller? http://book.cakephp.org/2.0/en/controllers.html#Controller::$helpers Cya, -- ***Thiago Belem* Desenvolvedor Rio de Janeiro - RJ - Brasil +55 (21) 8865.9250 thiagobelem.net cont...@thiagobelem.net *Skype / gTalk **»* thiago.belem.web *LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt* Assando Sites*, curso de CakePHP *»* assando-sites.com.br 2011/11/14 john lyles confidentia...@gmail.com I am using Cake v2.0.2 Why would the following generate this error??: Fatal error: Call to a member function format() on a non-object in C: \xampp\htdocs\myapp\View\Themed\mytheme\posts\index.ctp on line 6 $this-Time-format('F j, Y', $post['Post']['created']); -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
my own controller instead of user_controller login problem
Hi all! I am new in cakephp and i just downloaded cakephp ver. 1.3.13 and give it a try. I made a simple login/logout application using the auth component. I have a students and profiles tables in my database and i bake it using cake bake all so that it generates CRUD function. And i made an app_controller where i set the var $components = array(Auth) and after that i made a beforeFilter function where i set $this-auth-allow(...), $this-auth-loginError, $this-auth-authError, $this-auth-loginRedirect, $this-auth-logoutRedirect. In student_controller i put the login and logout function. and after that i create the login.ctp. My problem is when i try to access localhost/.../students/login, it will give me an error of Missing Controller Error: UsersController could not be found. Error: Create the class UsersController below in file: app\controllers \users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? Notice: If you want to customize this error message, create app\views \errors\missing_controller.ctp. can somebody help me about this issue? thanks.. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Site not working in shared host showing 500 Internal server error
Hi, I have developed a site using cake bake tool in localhost and uploaded to shared host, i uploaded as it is from local to server and changed the database file accordingly. Problem is i am getting following error, i have re-checked everything again and again. Did I forgot anything. The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, supp...@ipage.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. Regards, Anjith -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: my own controller instead of user_controller login problem
From page: http://book.cakephp.org/view/1250/Authentication Now, there are a few conventions to think about when using AuthComponent. By default, the AuthComponent expects you to have a table called 'users' with fields called 'username' and 'password' to be used. So if you insist on using a model other than users for logins you need to tell the auth component this: http://book.cakephp.org/view/1251/Setting-Auth-Component-Variables http://book.cakephp.org/view/1265/AuthComponent-Variables $this-Auth-userModel = 'Student'; However, I would recommend against this as I am sure if your app has students it will have teachers, or other types of users which would be better managed from a User model with those users having roles. HTH, Paul. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Message: No input file specified.
http://lmgtfy.com/?q=No+input+file+specified+cakephp -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Auth component problem
Hi, I am using auth component for login, it is working fine when database table columns are username and password if i use email as column name even though i specified the fields as below in app_controller.php its not working in beforeFilter() method. $this-Auth-Fields = array('username' = 'email', 'password' = 'password'); if i am renaming the column back and removing this line its working fine.. Regards, Anjith -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Site not working in shared host showing 500 Internal server error
http://lmgtfy.com/?q=cakephp+500+Internal+Server+Error -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: CakePHP and Sqlite
Thanks On Nov 13, 5:10 am, Matteo Landi landima...@gmail.com wrote: On Sun, Nov 13, 2011 at 5:25 AM, zer0_gravity zr...@hotmail.com wrote: Having trouble setting up CakePHP to work with Sqlite? could you explain or point me to where I can get info in rewards to this. thanks FWIW a couple of weeks ago I wrote a mini-tutorial about how to setup a SQLite connection within CakePHP application; if you are interested, check it out:http://matteolandi.blogspot.com/2011/10/about-cakephp-and-sqlite.html Cheers, Matteo --http://www.matteolandi.net/ -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: CakePHP and Sqlite
thanks On Nov 14, 9:58 am, zer0_gravity zr...@hotmail.com wrote: Thanks On Nov 13, 5:10 am, Matteo Landi landima...@gmail.com wrote: On Sun, Nov 13, 2011 at 5:25 AM, zer0_gravity zr...@hotmail.com wrote: Having trouble setting up CakePHP to work with Sqlite? could you explain or point me to where I can get info in rewards to this. thanks FWIW a couple of weeks ago I wrote a mini-tutorial about how to setup a SQLite connection within CakePHP application; if you are interested, check it out:http://matteolandi.blogspot.com/2011/10/about-cakephp-and-sqlite.html Cheers, Matteo --http://www.matteolandi.net/ -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: my own controller instead of user_controller login problem
you should also be aware of uppercase and lowercase naming of your objects On 14 Nov., 15:46, phpMagpie p...@webbedit.co.uk wrote: From page:http://book.cakephp.org/view/1250/Authentication Now, there are a few conventions to think about when using AuthComponent. By default, the AuthComponent expects you to have a table called 'users' with fields called 'username' and 'password' to be used. So if you insist on using a model other than users for logins you need to tell the auth component this:http://book.cakephp.org/view/1251/Setting-Auth-Component-Variableshttp://book.cakephp.org/view/1265/AuthComponent-Variables $this-Auth-userModel = 'Student'; However, I would recommend against this as I am sure if your app has students it will have teachers, or other types of users which would be better managed from a User model with those users having roles. HTH, Paul. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Concurrency control
Hi all i'm looking to implement a Concurrency Control Behavior who looks if data has been modified by someone between the time user loads and tries to save it. Is there any pre-made behavior? i lurked the bakery but found nothing. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Form from another model in a view
So I'm trying to extend the Blog tutorial adding some comments: Post hasMany Comments I want to display the add comment form in the same view as the 'post view'. Thing is I don't know the best way to get this approach. I thought about three ways: Creating a function in Comments Controller to handle the data. Creating a function in Post Controller to handle the data. Deal with the data in the same function that deals with the post views. The main problem with the two first 'solutions' is that the validation errors doesn't show up in the form unless I do some messy hacking of saving the invalidated field in a session variable and then parsing the variable on the beforeFilter callback, like this: function beforeFilter () { if ($this-Session-check('comment_error')) { $this-Post-Comment-validationErrors = $this-Session- read('comment_error'); $this-Session-delete('comment_error'); } } What I basically do is adapt the invalidated fields to the actual view and allow it to show properly. This works really well, but it seems so ugly to me. What would be the best approach? Another related question: should a controller reflect a view? I mean on that example, I thought about only having a Comment Model and dealing with all the data in the controller where's the form to add a comment (even though it's in the Post Controller). -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: my own controller instead of user_controller login problem
thank you for your quick response sir. I will try to read your links that you posted. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: primaryKey in cake 2.0
I looked through my code and found that it is just not throwing a error when linking models, I had Users instead of User as my model in the association. For some reason i thought it should throw a error if the model did not exist? Is this a issue or done intentionally? On Nov 13, 11:14 pm, Graham Weldon predomin...@gmail.com wrote: Can you provide a code sample to reproduce this? Cheers, Graham Weldonhttp://grahamweldon.com e. gra...@grahamweldon.com p. (+61) 0407 017 293 Skype: grahamweldon On Monday, 14 November 2011 at 3:50 PM, sixthpoint wrote: I have been running into a issue once upgrading to cake 2.0. When defining a HABTM association and then setting the primaryKey var in each of my models. It fails to utilize my altered primary key in the association. It resets to the default id field as the primary key in each model. Has there been documentation about this error yet reported? or a workaround? -- Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: my own controller instead of user_controller login problem
thank you for your quick response sir. i will remember your tip and try to understand more cakephp -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Posting form data with JSON
Hello, I'm working on project that is planned to heavily rely on data exchange with JSON. Here is an exemplary ajax call that posts JSON data to Cake's controller (code is in the view): $.ajax({url: /project/Controller/action data: JSON.stringify($(this).serializeArray()), type: POST, processData: false, contentType: application/json, cache: false, dataType: json, accepts: json, }); Data is posted and decoded in beforeFilter callback of controller (RequestHandler makes this atuomatically). Data in controller action looks in this way: Array ( [0] = Array ( [name] = data[Status][id] [value] = 48 ) ) I'm wondering what is the best way to convert this data to Cake' native data array to be compatible for $this-Model-save($data), i.e: Array ( [Status] = Array ( [id] = 48 ) ) Regards, Niki -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Concurrency control
Not sure if there is an existing behaviour, but if you create a created and modified field Cake will automagically update them. Check these to see if they have been updated since form load et voila. HTH, Paul -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Auth component problem
Which version of Cake you using? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Auth component problem
$this-Auth-fields = array('username' = 'email', 'password' = 'password'); // no capital F HTH, Paul -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re-order an Array
Hello everybody, is there a method in CakePHP which allows me to convert the following array to the expected result? I extract my start to a group by creteria. Array ( [0] = Array ( [Route] = Array ( [id] = 3 [start] = Düsseldorf Hbf [via] = Hannover Hbf [end] = Kreiensen ) ) [1] = Array ( [Route] = Array ( [id] = 2 [start] = Kreiensen [via] = Hannover Hbf [end] = Düsseldorf Hbf ) ) [2] = Array ( [Route] = Array ( [id] = 4 [start] = Kreiensen [via] = [end] = Würzburg Hbf ) ) [3] = Array ( [Route] = Array ( [id] = 5 [start] = Würzburg Hbf [via] = [end] = Kreiensen ) ) ) To the following array: ?Array ( [Düsseldorf Hbf] = Array ( [id] = 3 [start] = Düsseldorf Hbf [via] = Hannover Hbf [end] = Kreiensen ) ), [Kreiensen] = Array ( [id] = 2 [start] = Kreiensen [via] = Hannover Hbf [end] = Düsseldorf Hbf ), ( [id] = 4 [start] = Kreiensen [via] = [end] = Würzburg Hbf ) ) [Würzburg Hbf] = Array ( [id] = 5 [start] = Würzburg Hbf [via] = [end] = Kreiensen ) ) ) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Message: No input file specified.
lol i promise i tried that!! It ended up being my .htaccess files. they were wrong for some reason, but good to go now thanks! On Nov 14, 9:54 am, phpMagpie p...@webbedit.co.uk wrote: http://lmgtfy.com/?q=No+input+file+specified+cakephp -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Form from another model in a view
I don't think there is a right and wrong way to be honest, I have done this in the Comment controller and in my BlogPost controller, if comments are used across many models then probably best to centralize logic in comments controller. I don't worry about field by field validation errors for comments because there are only 2-3 fields, instead I use: if ($this-BlogPost-Comment-save($this-data)) { $this-Session-setFlash('pComment added./p', 'default', null, 'comment'); } else { $this-Session-setFlash('pComment not added, correct errors and resubmit./p', 'default', array('class'='error'), 'comment'); } And echo $this-Session-flash('comment'); in the view HTH, Paul. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Message: No input file specified.
When it works on local server and doesn't once uploaded, the only variable is your server's configuration and .htaccess, mod_rewrite, DBO tend to be the main culprits. HTH, Paul. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Re-order an Array
http://book.cakephp.org/view/1492/combine HTH, Paul. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Should configure(Cache.check) set = false in beforeSave and beforeDelete ?
I think configure::write('Cache.check', false) beforeSave and beforeDelete in AppModel.php --- ex: in case, Author hasMany Book and I have a lot cache of action : BooksController-view , 1000 cache file Then i create new a author, if Cache.check == true, it will auto delete 1000 cache file book view. Like ContainableBehavior , Configure::write('Cache.check', false) should be recommended in AppModel.php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: CakepHP 2.0 plugins no longer have a default controller?
Just in case anyone else is looking for the answer to this: I posted a ticket on CakePHP's issue tracker: http://cakephp.lighthouseapp.com/projects/42648/tickets/2237-20-plugins-dont-have-a-default-controller To which Mark responded and updated the migration guide: http://book.cakephp.org/2.0/en/appendices/2-0-migration-guide.html?highlight=migration#router On Oct 26, 7:33 pm, vaughany paulie...@gmail.com wrote: I thought this was just how plugins worked! Glad to hear it's (probably) not. Was linking to /users/users/view/id (as that was what worked) instead of the more preferable /users/view/id. Would dearly love to know how to use the preferable route. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: How to paginate subtable in a view?
On Nov 13, 5:27 pm, phpMagpie p...@webbedit.co.uk wrote: ... In essence you need a separate find for your category: $this-set('category', $this-Category-find('first', array( 'conditions' = array('Category.id' = $id), 'contain' = array( 'Post' = array('User' = array('id', 'username') ) ) ))); I got rid of this as there were too many unnecessary queries going on. And a separate paginate for the post records you want to paginate: $this-paginate = array( 'Post'= array( 'limit'= 2, 'page'= 1, 'order'= array('Post.created'= 'desc'), 'conditions' = array('Post.category_id' = $id) ) ); $this-set('posts', $this-paginate('Post')); That worked nicely. ... HTH, Paul. Well it did help but I have one unnecessary query left, for some reason Cake gets all the comments for all the posts displayed: SELECT `Comment`.`id`, `Comment`.`post_id`, `Comment`.`name`, `Comment`.`content`, `Comment`.`created`, `Comment`.`modified` FROM `comments` AS `Comment` WHERE `Comment`.`post_id` IN (2, 1) I don't need any of these comments on any of the category views. Is there a way of stopping this query? Thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Form from another model in a view
That's exactly my line of thinking. I might use a comments controller if it's being used on more than one model. Other than that, I think it's not worth all the work. Thanks! On Nov 14, 2:32 pm, phpMagpie p...@webbedit.co.uk wrote: I don't think there is a right and wrong way to be honest, I have done this in the Comment controller and in my BlogPost controller, if comments are used across many models then probably best to centralize logic in comments controller. I don't worry about field by field validation errors for comments because there are only 2-3 fields, instead I use: if ($this-BlogPost-Comment-save($this-data)) { $this-Session-setFlash('pComment added./p', 'default', null, 'comment');} else { $this-Session-setFlash('pComment not added, correct errors and resubmit./p', 'default', array('class'='error'), 'comment'); } And echo $this-Session-flash('comment'); in the view HTH, Paul. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Using REST In CakePHP 2.0
Hi all, I am trying to activate the REST functionality in CakePHP 2.0 for one of my models called Employee. In my controller, I have: function index(){ $this-set('employees', $this-paginate('Employee')); } In my view for the XML (/app/View/Employees/xml/index.ctp), I have: employees ?php $xml = Xml::build($employees); echo $xml-saveXML(); ? /employees I keep getting an Invalid input. Error: An Internal Error Has Occurred. message. I looked through the code a bit and found that the Xml class appears to be expected an array with 1 and only one element and an alphanumeric key. This makes me think that the example in the book (http://book.cakephp.org/2.0/en/development/rest.html? highlight=rest), which describes passing the result of $this-Recipe- find('all') to Xml::build(), is wrong because $this-Recipe- find('all') will return an array with numeric indices and multiple elements. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
paginated comments not showing up in view
I am fetching comments related to a post in the view function in the posts_controller : $this-paginate = array( 'Comment' = array( 'limit'= 2, 'page'= 1, 'order'= array('Comment.created' = 'desc'), 'conditions' = array('Comment.post_id' = $id) ) ); $this-set('comments', $this-paginate('Comment')); In the view.ctp file I am referencing the comments variable correctly: foreach ($comments as $comment): ... There is a query for this pagination in the debug info. at the bottom of the screen, but no comments are being shown by the view. If I copy and paste the query into phpmyadmin then there it correctly returns one row. What is happening to the comments in the posts view? Note I am using containable on the post model, I need this to prevent extra queries on another form: var $actsAs = array('Containable'); var $recursive = -1; ... and I get the post record in the posts view with: $this-set( 'post', $this-Post-find( 'first', array( 'conditions' = array('Post.id' = $id), 'contain' = array( 'User' = array( 'id', 'username' ) ) ) ) ); -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: CakePHP 2.0.3 out of the oven
Many thanks for this new release ! But I've still have the with screen with phpunit 3.6 (pear installation). It works fine with the vendor installation : https://gist.github.com/1332693 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: onClick in button
Script is working fine in nonCakePHP page. I'm adding script from js file. 2011/11/13 CrotchFrog crotchf...@gmail.com: Just to eliminate the obvious ... have you included the .js using $this-Html-script() or some other method? Have you checked the script for errors using Firebug or something similar? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Pozdrawiam Dominik Gajewski -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Using REST In CakePHP 2.0
Me too. It doesn't work the way that it does in 1.3. It used to work but does not in Cake 2. Look at my mailing list posts from a few days ago on this topic. Matt Kaufman Http://mkfmn.com Sent from my iPhone On Nov 14, 2011, at 10:58 AM, Will 000w.s.s@gmail.com wrote: Hi all, I am trying to activate the REST functionality in CakePHP 2.0 for one of my models called Employee. In my controller, I have: function index(){ $this-set('employees', $this-paginate('Employee')); } In my view for the XML (/app/View/Employees/xml/index.ctp), I have: employees ?php $xml = Xml::build($employees); echo $xml-saveXML(); ? /employees I keep getting an Invalid input. Error: An Internal Error Has Occurred. message. I looked through the code a bit and found that the Xml class appears to be expected an array with 1 and only one element and an alphanumeric key. This makes me think that the example in the book (http://book.cakephp.org/2.0/en/development/rest.html? highlight=rest), which describes passing the result of $this-Recipe- find('all') to Xml::build(), is wrong because $this-Recipe- find('all') will return an array with numeric indices and multiple elements. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Using REST In CakePHP 2.0
Hi Matt, I saw your post from a few days ago. I copied my code from the tutorial, but it did not work at all. I can only get XML::build() to work with a one element array. Creating an array such as array(Employees=$this-Employee-find('all')) was also giving me an error, so I've devised the following workaround for now. EmployeesController: function index(){ $this-set('employees', $this-paginate('Employee')); $this-set('name', $this-name); } /app/View/Employees/xml/index.ctp: ?php echo $name; foreach($employees as $e){ $xml = Xml::build($e); $children = $xml-children(); $key = key($e); echo $key; foreach($children as $ckey=$cvalue){ echo $ckey$cvalue/$ckey; } echo /$key; } echo /$name; ? If anyone knows of a better workout around or how to get things working with the CakePHP Xml Utility, I would be very interested. On Nov 14, 2:32 pm, Matt Kaufman mkfmn...@gmail.com wrote: Me too. It doesn't work the way that it does in 1.3. It used to work but does not in Cake 2. Look at my mailing list posts from a few days ago on this topic. Matt Kaufman Http://mkfmn.com Sent from my iPhone On Nov 14, 2011, at 10:58 AM, Will 000w.s.s@gmail.com wrote: Hi all, I am trying to activate the REST functionality in CakePHP 2.0 for one of my models called Employee. In my controller, I have: function index(){ $this-set('employees', $this-paginate('Employee')); } In my view for the XML (/app/View/Employees/xml/index.ctp), I have: employees ?php $xml = Xml::build($employees); echo $xml-saveXML(); ? /employees I keep getting an Invalid input. Error: An Internal Error Has Occurred. message. I looked through the code a bit and found that the Xml class appears to be expected an array with 1 and only one element and an alphanumeric key. This makes me think that the example in the book (http://book.cakephp.org/2.0/en/development/rest.html? highlight=rest), which describes passing the result of $this-Recipe- find('all') to Xml::build(), is wrong because $this-Recipe- find('all') will return an array with numeric indices and multiple elements. -- Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Using REST In CakePHP 2.0
Yes Thank you 000w.s.s.000 for your reply; I have the exact same setup as well now for the temporary work-around. It makes me question slightly what CakePHP is Good For again any more; am I wrong in my thinking? Why is this so overly complex to do something that is supposed to be very simple. Does any one have recommendations on good frame works such as http://doophp.com/demos/rest_client_server/index.php/example or http://getfrapi.com but with the features that I have loved in CakePHP since 2005 I wish it or hope it is Cake 2.0 :( Matt Kaufman http://mkfmn.com On Mon, Nov 14, 2011 at 6:05 PM, Will 000w.s.s@gmail.com wrote: Hi Matt, I saw your post from a few days ago. I copied my code from the tutorial, but it did not work at all. I can only get XML::build() to work with a one element array. Creating an array such as array(Employees=$this-Employee-find('all')) was also giving me an error, so I've devised the following workaround for now. EmployeesController: function index(){ $this-set('employees', $this-paginate('Employee')); $this-set('name', $this-name); } /app/View/Employees/xml/index.ctp: ?php echo $name; foreach($employees as $e){ $xml = Xml::build($e); $children = $xml-children(); $key = key($e); echo $key; foreach($children as $ckey=$cvalue){ echo $ckey$cvalue/$ckey; } echo /$key; } echo /$name; ? If anyone knows of a better workout around or how to get things working with the CakePHP Xml Utility, I would be very interested. On Nov 14, 2:32 pm, Matt Kaufman mkfmn...@gmail.com wrote: Me too. It doesn't work the way that it does in 1.3. It used to work but does not in Cake 2. Look at my mailing list posts from a few days ago on this topic. Matt Kaufman Http://mkfmn.com Sent from my iPhone On Nov 14, 2011, at 10:58 AM, Will 000w.s.s@gmail.com wrote: Hi all, I am trying to activate the REST functionality in CakePHP 2.0 for one of my models called Employee. In my controller, I have: function index(){ $this-set('employees', $this-paginate('Employee')); } In my view for the XML (/app/View/Employees/xml/index.ctp), I have: employees ?php $xml = Xml::build($employees); echo $xml-saveXML(); ? /employees I keep getting an Invalid input. Error: An Internal Error Has Occurred. message. I looked through the code a bit and found that the Xml class appears to be expected an array with 1 and only one element and an alphanumeric key. This makes me think that the example in the book (http://book.cakephp.org/2.0/en/development/rest.html? highlight=rest), which describes passing the result of $this-Recipe- find('all') to Xml::build(), is wrong because $this-Recipe- find('all') will return an array with numeric indices and multiple elements. -- Our newest site for the community: CakePHP Video Tutorialshttp:// tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Using REST In CakePHP 2.0
XML has been completely reworked in CakePHP 2.0 Take a look at the API docs here: http://api20.cakephp.org/class/xml Notice that you need one root element when building from an array. The book probably just needs to be updated. Feel free to submit an update if you get some time :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Jenkins + CakePHP
I've seen the new CakePHP tests reports running in Jenkinshttp://ci.cakephp.org/and I want to know if there's any material about this setup and how I can configure to my projects. I found some guides about configuring Jenkins for PHPhttps://wiki.jenkins-ci.org/display/JENKINS/Jenkins+and+PHPbut I just wanted to check if there's something special/different for CakePHP. Thanks, -- ***Thiago Belem* Desenvolvedor Rio de Janeiro - RJ - Brasil +55 (21) 8865.9250 thiagobelem.net cont...@thiagobelem.net *Skype / gTalk **»* thiago.belem.web *LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt* Assando Sites*, curso de CakePHP *»* assando-sites.com.br -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Concurrency control
The only behavior in that direction I can think of is called LockTable Behavior it restricts to either read/write for a complete table but maybe you can modify it to restrict access to rows for certain users for a certain amount of time etc On 14 Nov., 17:14, phpMagpie p...@webbedit.co.uk wrote: Not sure if there is an existing behaviour, but if you create a created and modified field Cake will automagically update them. Check these to see if they have been updated since form load et voila. HTH, Paul -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Jenkins + CakePHP
There is nothing super special about it. We are using github web hooks to fire builds. Pre-build steps setup the environment so we can guarantee unpolluted tests: cat app/Config/database.php 'DATABASE_PHP' ?php class DATABASE_CONFIG { var $test = array( 'datasource' = 'Database/Mysql', 'host' = 'localhost', 'database' = 'test_cakephp', 'login' = 'ci', 'password' = 'password', 'encoding' = 'utf8' ); } DATABASE_PHP mysql -u user -ppassword -e 'DROP DATABASE IF EXISTS test_cakephp; CREATE DATABASE test_cakephp'; rm -f app/tmp/testsc*; rm -rf app/tmp/tests/*; The final build command is the test suite itself: lib/Cake/Console/cake testsuite core AllTests --log-junit junit.xml This you can modify to run any subset of tests, or whatever you like. We're also using email notification and IRC notification to keep us informed as the build status changes. I hope thats helpful. Cheers, Graham Weldon http://grahamweldon.com e. gra...@grahamweldon.com p. (+61) 0407 017 293 Skype: grahamweldon On Tuesday, 15 November 2011 at 10:50 AM, Thiago Belem wrote: I've seen the new CakePHP tests reports running in Jenkins (http://ci.cakephp.org/) and I want to know if there's any material about this setup and how I can configure to my projects. I found some guides about configuring Jenkins for PHP (https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+and+PHP) but I just wanted to check if there's something special/different for CakePHP. Thanks, -- Thiago Belem Desenvolvedor Rio de Janeiro - RJ - Brasil +55 (21) 8865.9250 thiagobelem.net (http://thiagobelem.net/) cont...@thiagobelem.net (mailto:cont...@thiagobelem.net) Skype / gTalk » thiago.belem.web LinkedIn » br.linkedin.com/in/thiagobelem/pt (http://br.linkedin.com/in/thiagobelem/pt) Assando Sites, curso de CakePHP » assando-sites.com.br (http://assando-sites.com.br) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com (mailto:cake-php+unsubscr...@googlegroups.com) For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Using REST In CakePHP 2.0
Yes, you can feel free as well as I would have if I knew how to do it; I did look at the XML class. On Mon, Nov 14, 2011 at 6:47 PM, jeremyharris funeralm...@gmail.com wrote: XML has been completely reworked in CakePHP 2.0 Take a look at the API docs here: http://api20.cakephp.org/class/xml Notice that you need one root element when building from an array. The book probably just needs to be updated. Feel free to submit an update if you get some time :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Using REST In CakePHP 2.0
and it should also be mentioned that now all keys are (forced) lowercase. I dont know WHY but thats how it is now.. really messed up tons of my library classes - which of course were looking for keys like Data instead of now data took me hours to fix all occurrences of this change. especially if you dont have 100% test coverage for your libs (which you usually dont^^). On 15 Nov., 00:47, jeremyharris funeralm...@gmail.com wrote: XML has been completely reworked in CakePHP 2.0 Take a look at the API docs here:http://api20.cakephp.org/class/xml Notice that you need one root element when building from an array. The book probably just needs to be updated. Feel free to submit an update if you get some time :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Using REST In CakePHP 2.0
Thanks for the link, Jeremy! I restructured my array to match the API documentation and it worked. Where does one submit an update from the book? On Nov 14, 4:47 pm, jeremyharris funeralm...@gmail.com wrote: XML has been completely reworked in CakePHP 2.0 Take a look at the API docs here:http://api20.cakephp.org/class/xml Notice that you need one root element when building from an array. The book probably just needs to be updated. Feel free to submit an update if you get some time :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Using REST In CakePHP 2.0
The 2.0 docs are hosted on github here: https://github.com/cakephp/docs Glad that worked out for you! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Using REST In CakePHP 2.0
Yeah seriously; it is better though. LOL On 11/14/11, euromark dereurom...@googlemail.com wrote: and it should also be mentioned that now all keys are (forced) lowercase. I dont know WHY but thats how it is now.. really messed up tons of my library classes - which of course were looking for keys like Data instead of now data took me hours to fix all occurrences of this change. especially if you dont have 100% test coverage for your libs (which you usually dont^^). On 15 Nov., 00:47, jeremyharris funeralm...@gmail.com wrote: XML has been completely reworked in CakePHP 2.0 Take a look at the API docs here:http://api20.cakephp.org/class/xml Notice that you need one root element when building from an array. The book probably just needs to be updated. Feel free to submit an update if you get some time :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Using REST In CakePHP 2.0
Is this GitHub documentation different from what is hosted on the CakePHP Docs Website? (https://github.com/cakephp/docs.git) Then do I need to do the below?: -- == Building the documentation == After installing the require packages you can build the documentation using Make # Create all the HTML docs. Including all the languages. make html # Create just the english HTML docs. make html-en # Create all the EPUB (e-book) docs. make epub # Create just the engish EPUB docs. make epub-en This will generate all the documentation in an html form. Other output such as 'pdf' and 'htmlhelp' are not fully complete at this time. After making changes to the documentation, you can build the html version of the docs by using make html again. This will build only the html files that have had changes made to them. On 11/14/11, jeremyharris funeralm...@gmail.com wrote: The 2.0 docs are hosted on github here: https://github.com/cakephp/docs Glad that worked out for you! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Clean solution to sharing common Views
Hi, I've been trying to find the best way to share a basic JSON View across my application. The view is quite simple and only contains : ?php echo json_encode($response) ; ? The view is used across the application thorough a utility method in the AppController : protected function renderJSONResponse($response) { $this - RequestHandler - setContent('json', 'application/json'); $this - set('response', $response); $this - render('json'); } Only problem now is having to re-create the same view, which doesn't take more than 5 seconds everytime, but is not very DRY, and is messy and redundant. A quick and dirty solution which works is to put the view in a common folder under the View folder and render it using : $this - render('../Common/json'); Just wondering if : a) There is a better way of achieving the same thing. b) There are any objections against doing this or any reasons why its not a good idea ? Cheers, Shuku. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Containable Memory Usage
just stumbled upon Andy Dawson's OneQueryBehavior https://github.com/AD7six/mi/blob/master/models/behaviors/one_query.php seems like the wheel already got invented ;) it looks quite promising and optimized containable not that unrealistic after all. I will have to check that one out some time. On 12 Nov., 18:41, euromark dereurom...@googlemail.com wrote: well, I doubt that, too. Especially with a lot of model relations you are usually better off using recursive=-1 globally and defining contain everywhere. What troubles me more is the fact that containable is not optimized. Or in other words: It creates up to 50x more queries than necessary depending on the amount of joins in find(all) or paginate. So the overhead using containable without custom bindModel is mainly on the DB side, not the PHP side. I tried to establish the grounds for a ticket. But I am not sure where to begin. It looks so easy to fix*, but I am sure it's probably not or creates other problems. Otherwise they'd already covered the (in my opinion) largest bottleneck remaining in 2.0. * checking on hasOne and belongsTo first and assigning custom bindModel relations with foreignkey=false and a conditions query containing the appropriate keys. one left join instead of 100-200 single queries + some additional ones for the hasMany relations etc. On 12 Nov., 14:40, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: It'd be an interesting test, but from the outset I (unscientifically) doubt it. Without the contain behaviour and relying on recursive = whatever you are often pulling back way too much data, so some sort of model binding adjustment has to save horsepower. The containable behaviour simply manages the process of binding and unbinding, so I can't see how or why it'd be more inefficient than doing it yourself. I use it de facto and have not experienced any memory issues. Open to persuasion once I see some evidence though. Jeremy Burns Class Outfit http://www.classoutfit.com On 12 Nov 2011, at 13:30, zuha wrote: I saw this comment on another thread, and instead of taking over that thread with a containable discussion, I'm starting a new one. Can anyone confirm or deny this claim that containable uses a lot of memory? (as say compared to bind/unbind) On Sat, Nov 12, 2011 at 5:47 PM, phpMagpie pa...@webbedit.co.uk wrote: I would advise you to learn how to use containable ... only takes a couple of lines of code makes life a whole lot easier than having to bind and unbind for every paginate. I'd like to avoid it. I think it consumes a lot of memory. CMIIW. Thank you. -- Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Clean solution to sharing common Views
Hey, My recommendation would be to look at the solution that jrbasso has created for CakePHP 2.0: https://github.com/jrbasso/json_plugin It has extensive installation and usage information, making it dead easy to use. This is a custom view class that allows you to eliminate the need for a view (ctp) file for common json output. If your data is in the right format, and you are just doing a json_encode() in the view, then the section in his readme (see link above) entitled Directly from your Controller is what you are after. This has the response generated directly in the controller, and is easy to use. You just need to set a 'json' variable in the controller, and have told your controller to use the 'Json.Json' view class, and you're done! The functionality he has should be able to be back ported to CakePHP 1.3 if you are using that. Cheers, Graham Weldon http://grahamweldon.com e. gra...@grahamweldon.com p. (+61) 0407 017 293 Skype: grahamweldon On Tuesday, 15 November 2011 at 11:19 AM, Shukuboy wrote: Hi, I've been trying to find the best way to share a basic JSON View across my application. The view is quite simple and only contains : ?php echo json_encode($response) ; ? The view is used across the application thorough a utility method in the AppController : protected function renderJSONResponse($response) { $this - RequestHandler - setContent('json', 'application/json'); $this - set('response', $response); $this - render('json'); } Only problem now is having to re-create the same view, which doesn't take more than 5 seconds everytime, but is not very DRY, and is messy and redundant. A quick and dirty solution which works is to put the view in a common folder under the View folder and render it using : $this - render('../Common/json'); Just wondering if : a) There is a better way of achieving the same thing. b) There are any objections against doing this or any reasons why its not a good idea ? Cheers, Shuku. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
PHP 5.4
I put 5.4 on a vmware server to check cakephp against it and everything appears to work, but i'm getting the following notice: Declaration of AppModel::beforeSave() should be compatible with Model::beforeSave($options = Array) [*APP/Model/AppModel.php*, line *34*] -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: PHP 5.4
if you are in E_STRICT mode in PHP (which you seem to be) you will be notified if you don't use the exact param declaration in the inheriting classes. the Model::beforeSave() is: public function beforeSave($options = array()) {} so you need to use the exact same params (with the exact same default values): public function beforeSave($options = array()) { parent::beforeSave($options); ... } you probably forgot about the $options param. On 15 Nov., 02:45, David Sheeks sdshe...@gmail.com wrote: I put 5.4 on a vmware server to check cakephp against it and everything appears to work, but i'm getting the following notice: Declaration of AppModel::beforeSave() should be compatible with Model::beforeSave($options = Array) [*APP/Model/AppModel.php*, line *34*] -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
UnitTests - The Real World
Folks, I've read alot about UnitTests and participated on several coding dojoshttp://codingdojo.org/cgi-bin/wiki.pl?WhatIsCodingDojo but I can't figure out how apply the TDD on a real world CakePHP application. I know HOW to test, assert and etc. I just don't know exacly WHAT to test, since everything on the core is properly tested and i'm not creating new helpers, components and etc. I want to rear from you guys examples (and the code, if possiebel) of real world applications test cases. Thanks, -- ***Thiago Belem* Desenvolvedor Rio de Janeiro - RJ - Brasil +55 (21) 8865.9250 thiagobelem.net cont...@thiagobelem.net *Skype / gTalk **»* thiago.belem.web *LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt* Assando Sites*, curso de CakePHP *»* assando-sites.com.br -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php