Re: How can controller action function distinguish whether URL ends with .xml or not?

2012-09-14 Thread johnny
From what i remember this should do the trick, in your controller action if ( $this-RequestHandler-isXML()) { // do some xml specific code } Check out the documentation on Request Handling for more details. http://book.cakephp.org/2.0/en/core-libraries/components/request-handling.html On

Re: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-08-24 Thread Johnny Perk
Hi I joined and I am posting right now because of the lack of succes I have seen all over the web about this issue and while looking for the solution I found MANY production sites with this warning messages all overas this is the first post that comes up on google when you search for this

Re: browser compatibility: the weirdest thing ever with IE. throws flash message all the time!!!

2012-06-01 Thread johnny
If it only occurs on IE it might be a prolem with the user session. Try setting Session.checkAgent to false in core.php and see if that helps. I had problems with sessions getting dropped in IE, with this setting on. On May 31, 9:33 pm, luftlinie thomasfuch...@googlemail.com wrote: hi everyone,

Re: Class 'AppHelper' not found

2012-04-11 Thread Johnny Fuery
If you're encountering this error in Cake 2.1.x, you probably need to copy the AppHelper.php skeleton from: lib/Cake/Console/Templates/skel/View/Helper/AppHelper.php into: app/View/Helper/AppHelper.php I ran into this while upgrading from 1.3.x to 2.1.x. -- Our newest site for the

loadModel() changes FormHelper output in Cake 2.0.4

2011-12-30 Thread Johnny Cupcake
I suspect this might be a bug--looking for confirmation, and/or advice on the best place to report it. I have a controller with no associated model. In other words, public $uses = null; I use FormHelper to build a form for a controller action. Because there is no model, the form's ID and input

Using EmailComponent inside a component or abstract controller

2011-02-06 Thread Johnny Cupcake
To the best of my knowledge, both of these are impossible in CakePHP 1.3.6: - Use EmailComponent inside another component to send a message - Create a controller class BETWEEN AppController and the child controllers in the inheritance hierarchy, that uses EmailComponent to send a message I would

Re: Want generatetreelist() results in alphabetical order

2010-11-26 Thread Johnny Cupcake
On Nov 22, 1:09 am, AD7six andydawso...@gmail.com wrote: I'd recommend looking at the reorder method, which'll do what you want to the data itself, unless you're wanting to sort by a different field. http://api.cakephp.org/view_source/tree-behavior/#l-628 Thanks, reorder() was in fact the

Want generatetreelist() results in alphabetical order

2010-11-21 Thread Johnny Cupcake
http://book.cakephp.org/view/1348/generatetreelist generatetreelist() returns a pseudo-tree in a relative order, with children under parents. I would like results wherein the peers are also ordered, alphabetically by label. Here is a quick example if this isn't clear: array( [1] = My

Re: Want generatetreelist() results in alphabetical order

2010-11-21 Thread Johnny Cupcake
; if ( isset($item['children']) ) $this-_threadedFindToTreeListR($item['children'], $table, $key, $value, $spacer, $recursion_lvl+1, $our_results); } } } On Nov 21, 6:12 pm, Johnny Cupcake sparklew...@hotmail.com

Adding multiple form fields with autocomplete

2010-04-16 Thread Johnny Ferguson
Hi, I've noticed that CakePHP has an autoComplete helper, but I'm having trouble figuring out how to make it work for my application: http://book.cakephp.org/view/632/autoComplete I have 3 controllers: PracticeItems PracticeInstances PracticeSessions A PracticeSession will have 1 or more

Re: Adding multiple form fields with autocomplete

2010-04-16 Thread Johnny Ferguson
, and it acts as though the only bit that qualifies as [PracticeItem][name] is the last entry in the form. On 16 Apr, 15:20, Johnny Ferguson hyperfle...@gmail.com wrote: Hi, I've noticed that CakePHP has an autoComplete helper, but I'm having trouble figuring out how to make it work for my

Re: Adding multiple form fields with autocomplete

2010-04-16 Thread Johnny Ferguson
, and it acts as though the only bit that qualifies as [PracticeItem][name] is the last entry in the form. On 16 Apr, 15:20, Johnny Ferguson hyperfle...@gmail.com wrote: Hi, I've noticed that CakePHP has an autoComplete helper, but I'm having trouble figuring out how to make it work for my

Re: Adding multiple form fields with autocomplete

2010-04-16 Thread Johnny Ferguson
, and it acts as though the only bit that qualifies as [PracticeItem][name] is the last entry in the form. On 16 Apr, 15:20, Johnny Ferguson hyperfle...@gmail.com wrote: Hi, I've noticed that CakePHP has an autoComplete helper, but I'm having trouble figuring out how to make it work for my

Re: Adding multiple form fields with autocomplete

2010-04-16 Thread Johnny Ferguson
practice_sessions_controller.php: http://pastebin.com/XHw37WS0 practice_sessions/add.ctp: http://pastebin.com/Z5fGgfxV practice_items_controller.php: (autoCompleteName) http://pastebin.com/SLN72D4T On 16 Apr, 19:38, Johnny Ferguson hyperfle...@gmail.com wrote: So I've looked further

Re: Adding multiple form fields with autocomplete

2010-04-16 Thread Johnny Ferguson
of this helper div when invoking the $ajax-autoComplete method? On 16 Apr, 19:41, Johnny Ferguson hyperfle...@gmail.com wrote: practice_sessions_controller.php:http://pastebin.com/XHw37WS0 practice_sessions/add.ctp:http://pastebin.com/Z5fGgfxV practice_items_controller.php: (autoCompleteName

Re: Adding multiple form fields with autocomplete

2010-04-16 Thread Johnny Ferguson
I can edit the name of the helper div with the 'div_id' option, but it doesn't seem to let both fields use the autocomplete function. At this point, I'm not sure how to diagnose the issue any further. On 16 Apr, 19:48, Johnny Ferguson hyperfle...@gmail.com wrote: digging through the DOM further

Re: Cake won't save data in $this-data (data relationship weirdness)

2010-04-15 Thread Johnny Ferguson
)); endif; And see what pops up. Jeremy Burns jeremybu...@me.com On 15 Apr 2010, at 05:56, Johnny Ferguson wrote: Hi, I'm developing an app that has database relationships. The table in question is like so: tbl practice_instances id - int (primary) created - timestamp (default

Re: Cake won't save data in $this-data (data relationship weirdness)

2010-04-15 Thread Johnny Ferguson
values, even though they're showing up in my controller dump odd. On Apr 15, 2:22 am, Johnny Ferguson hyperfle...@gmail.com wrote: If I put the data in manually it sticks. I don't have any validation rules. I'll try the code you recommended. I suppose at least if what I'm doing SHOULD work

Re: Cake won't save data in $this-data (data relationship weirdness)

2010-04-15 Thread Johnny Ferguson
: function beforeSave() {         die(debug($this-data)); } Might be interesting to see what is being passed out. Can you show and tell more of the code that is calling the save? Jeremy Burns jeremybu...@me.com On 15 Apr 2010, at 07:24, Johnny Ferguson wrote: Now this is interesting

Re: Cake won't save data in $this-data (data relationship weirdness)

2010-04-15 Thread Johnny Ferguson
. Everything works now. Sorry to kill time with a slight oversight. On Apr 15, 3:30 pm, Johnny Ferguson hyperfle...@gmail.com wrote: a beforeSave() in the model yields: app/models/practice_instance.php (line 6) Array (     [PracticeInstance] = Array         (             [modified] = 2010-04-15 15

Cake won't save my data

2010-04-14 Thread Johnny Ferguson
I'm using InnoDB to allow data associations. Do I have to note this fact in my database.php? Other than that, I'm at a loss as to why this problem is occurring. My practice_items table: int - id varchar(255) - name text - description /app/controllers/practice_items_controller.php:

Re: Cake won't save my data

2010-04-14 Thread Johnny Ferguson
I've checked with the folks in the IRC, and it looks like Cake shouldn't care if I'm using InnoDB, but my data still won't show up in the tables regardless of Cake giving me every indication that the save was successful. On 14 Apr, 16:43, Johnny Ferguson hyperfle...@gmail.com wrote: I'm using

Re: Cake won't save my data

2010-04-14 Thread Johnny Ferguson
This is part of the whole convention over configuration. Alan -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of Johnny Ferguson Sent: Wednesday, April 14, 2010 2:10 PM To: CakePHP Subject: Re: Cake won't save my data I've checked

Cake won't save data in $this-data (data relationship weirdness)

2010-04-14 Thread Johnny Ferguson
Hi, I'm developing an app that has database relationships. The table in question is like so: tbl practice_instances id - int (primary) created - timestamp (default: null) modified - timestamp (default: null) timeminutes - int practice_session_id - int practice_item_id - int tempostart - int

having trouble understanding associations

2010-03-26 Thread Johnny Ferguson
Looking here: http://book.cakephp.org/view/78/Associations-Linking-Models-Together I'm certain my issue is due to a personal lack of understanding. I'm trying to homebrew a simple app to keep track of my guitar practice. I have the following models: PracticeItem: a specific exercise to be

Re: having trouble understanding associations

2010-03-26 Thread Johnny Ferguson
. The PracticeSession has a PracticeItem. I'll work through developing this app, and see if my understanding doesn't grow a little. Thanks, Gian. On Mar 26, 3:17 pm, Gianluca gc1...@googlemail.com wrote: Hello Johnny, class PracticeItem extends AppModel { } class PracticeInstance extends AppModel

Re: Bake Screencast not Working?

2010-03-20 Thread Johnny Ferguson
I got this same problem, and after viewing the file directly, I am extremely disappointed that I had to go through the hassle of filling my comp with garbage like QuickTime just to have some guy show me how to update my PATH variable. *facepalm* Why this isn't on a youtube video is beyond me. On

redirect to anchor link for form validation

2010-03-19 Thread Johnny Ferguson
Hi, I've successfully set up a contact form in cakePHP, and when validation rules in my model don't pass, the form is reloaded with all my validation errors displayed properly. That battle was won :) Now for the tricky part. Can anyone think of a way to not only have the form page reload with

Validation issues for Contact form (doesn't use database)

2010-03-16 Thread Johnny Ferguson
Hi, I've poured over all the documentation I possibly can, and searched the newsgroups, and haven't yet found a solution to my problem. I'm creating a contact form which doesn't use any databases. As the controller action never calls save(), I don't get any of the nice automatic validation.

Re: New to CakePHP

2010-03-16 Thread Johnny Ferguson
I accidentally hit reply to author, but for anyone else that visits this thread: Be sure to check out the Auth component: http://book.cakephp.org/view/172/Authentication It's dead simple using this to set up authentication. Coupled with the ACL component, you have an unstoppable force on your

Re: Validation issues for Contact form (doesn't use database)

2010-03-16 Thread Johnny Ferguson
of an element to hold the contact form. Then have the contact form presented in both views! Seehttp://book.cakephp.org/view/97/Elementsfor the story on elements :) Later you may consider using an AJAX solution. Enjoy,    John On Mar 16, 9:48 pm, Johnny Ferguson hyperfle...@gmail.com wrote

Re: Validation issues for Contact form (doesn't use database)

2010-03-16 Thread Johnny Ferguson
- in the contact add form case, it would be named doAddContact. The name of the submit button can be found as a key in the $this- params array. Just an idea, enjoy,    John On Mar 16, 10:27 pm, Johnny Ferguson hyperfle...@gmail.com wrote: Ajax is definitely a working solution, but I'm somewhat

Re: Validation issues for Contact form (doesn't use database)

2010-03-16 Thread Johnny Ferguson
. + 1,000,000 bonus points to anyone who can figure this out On Mar 16, 5:07 pm, Johnny Ferguson hyperfle...@gmail.com wrote: Having the form submit to the index() function worked brilliantly. To my surprise, this enabled the automagic validation messages! All I have to do now is style the messages

Re: After the Cake is baked...

2010-02-25 Thread Johnny Cupcake
Brilliant, this is almost exactly what I was looking for. On Feb 24, 8:28 am, Christian Leskowsky christian.leskow...@gmail.com wrote: Here's something I haven't read yet but was written by a guy who knows his stuff... http://boagworld.com/websiteownersmanual/

Re: After the Cake is baked...

2010-02-25 Thread Johnny Cupcake
Do go on...is there a Cake-friendly method for automated daily DB backups? How do you accomplish it? On Feb 24, 8:26 am, Christian Leskowsky christian.leskow...@gmail.com wrote: For backups you should be taking full mysql backups of your database nightly - at least while that's feasible - and

Re: After the Cake is baked...

2010-02-25 Thread Johnny Cupcake
I am most concerned about legal issues because I am least equipped to handle those myself. While I do not necessarily expect to be sued, frankly I do expect to be threatened with lawsuits in short order, and I want to know exactly where I stand before that happens. (I intend to create a

Re: After the Cake is baked...

2010-02-22 Thread Johnny Cupcake
...@gmail.com wrote: Avoid getting sued? Stop being an american work like a charm. ;) (sorry, I could not resist) On Feb 22, 8:39 am, Johnny Cupcake sparklew...@hotmail.com wrote: OK, so after we have successfully built our modern, interactive CakePHP website...where can we learn how

After the Cake is baked...

2010-02-21 Thread Johnny Cupcake
OK, so after we have successfully built our modern, interactive CakePHP website...where can we learn how to actually /run/ the website? Can you recommend any books or forums that provide a good introduction to all the legal, administrative and technical issues? For instance, best practices for

Identifying the moment of successful login using AuthComponent

2010-02-02 Thread Johnny Cupcake
How can I run code on AuthComponent's successful login _event_? For example, to record the login date/time in the database? I've tried writing my own login() action in the controller--but by the time that function executes, login has already been performed by the component--so I don't know

Re: Identifying the moment of successful login using AuthComponent

2010-02-02 Thread Johnny Cupcake
. On Feb 2, 1:30 pm, Miles J mileswjohn...@gmail.com wrote: I added the this functionality to one of my plugins: http://github.com/milesj/forum/blob/master/controllers/users_controll... On Feb 2, 1:22 pm, Johnny Cupcake sparklew...@hotmail.com wrote: How can I run code on AuthComponent's

Re: Identifying the moment of successful login using AuthComponent

2010-02-02 Thread Johnny Cupcake
(FORM_NOT_EMPTY CREDENTIALS_NOT_ALREADY_REJECTED). I swear, I did read the docs before I asked in the first place ;) On Feb 2, 1:22 pm, Johnny Cupcake sparklew...@hotmail.com wrote: How can I run code on AuthComponent's successful login _event_?  For example, to record the login date/time

Re: HtmlHelper does not like multiple URL parameters?

2010-01-28 Thread Johnny Cupcake
Ack, my post was auto-mangled. There is a difference there: vs. amp;. Try the Show original link on the post. On Jan 28, 12:08 am, Jeremy Burns jeremybu...@me.com wrote: Aren't those two outputs the same? Jeremy Burns On 28 Jan 2010, at 07:59, Johnny Cupcake wrote: My code (Cake 1.2.5

Re: HtmlHelper does not like multiple URL parameters?

2010-01-28 Thread Johnny Cupcake
., 10:00, Johnny Cupcake sparklew...@hotmail.com wrote: Ack, my post was auto-mangled.  There is a difference there: vs. amp;.  Try the Show original link on the post. On Jan 28, 12:08 am, Jeremy Burns jeremybu...@me.com wrote: Aren't those two outputs the same? Jeremy Burns On 28

Re: Pretty URLs don't work without .htaccess ?

2010-01-28 Thread Johnny Cupcake
, Miles J mileswjohn...@gmail.com wrote: Yes .htaccess is required because its uses mod_rewrite. If you didn't your URLs would be like so: index.php?url=/items/view/ On Jan 27, 1:18 pm, Johnny Cupcake sparklew...@hotmail.com wrote: This issue was last discussed here in 2006, as far as I can tell

Re: Pretty URLs don't work without .htaccess ?

2010-01-28 Thread Johnny Cupcake
...@gmail.com wrote: On 28 ene, 23:49, Johnny Cupcake sparklew...@hotmail.com wrote: Right, I was referring to mod_rewrite and not .htaccess in particular. I see the links generated by HtmlHelper are wrong too.  They point to /app/webroot/filename when Apache's root is already set to /app

Pretty URLs don't work without .htaccess ?

2010-01-27 Thread Johnny Cupcake
This issue was last discussed here in 2006, as far as I can tell. I'd like to know if anything has changed since then. Are pretty URLs available without using .htaccess? For example, with my Apache document root set to my app's webroot dir, a controller items and an action view, and scaffolding

HtmlHelper does not like multiple URL parameters?

2010-01-27 Thread Johnny Cupcake
My code (Cake 1.2.5): echo $html-url( array( 'controller' = 'users', 'action' = 'activate', '?' = array('e' = 'EMAIL', 'c' = 'CODE')), TRUE ); The output: http://localhost/index.php/users/activate?e=EMAILc=CODE This output is wrong, right? Should be:

Moving the SQL debug information from its default location

2009-10-23 Thread Johnny Ferguson
Wondering if there is some method of moving the SQL debug information from the bottom of the page with some kind of variable. This may be nitpicking, but I'm sort of irritated with how cake is placing it outside my /html tag. something like: ... default.ctp layout file ... ?php echo

Re: 1.3 problem with baking from custom view template

2009-09-30 Thread Johnny
://code.cakephp.org/wiki/1.3/migration-guide/bake-updatesnotes about bake as bake had a fairly significant set of changes done to it for 1.3 and the location of the templates has changed a bit. -Mark On Sep 29, 11:48 am, Johnny joh...@codynamic.com wrote: I recently started playin around with the 1.3 dev

1.3 problem with baking from custom view template

2009-09-29 Thread Johnny
I recently started playin around with the 1.3 dev version of cake and i'm having problems with using custom view templates for bake. I place them in the app/vendors/shells/templates/views folder but bake ignores them and still uses the default templates that come with cake. In cake 1.2.5

Re: Prefix routing behavior is not OK

2009-04-14 Thread Johnny
I found this article to be usefull regarding prefix routing: http://www.pagebakers.nl/2008/12/04/cakephp-router-and-prefixes/ It shows how you can get the right urls for paginator, links and forms using cake's prefix functionality. On Apr 12, 11:05 pm, Hazem Mohamed hazeim...@gmail.com wrote:

custom routes issue

2009-04-08 Thread Johnny
I have the following routes set up for the front end of my app: Router::connect('/become-our-client', array('controller' = 'users', 'action' = 'register')); Router::connect('/contact-us', array('controller' = 'contact', 'action' = 'contact_us')); Router::connect('/latest-projects',

Re: scaffold

2009-03-21 Thread Johnny
Scaffold is not supposed to be used in production environments. Use bake instead to physically create the model,view and controller files and edit those according to your needs. On Mar 20, 5:54 pm, Alejandro Weintz Aguilar alejan...@pixelestudios.com wrote: Hello, I am build a large proyect

Re: Change view by userstate

2009-02-19 Thread Johnny
if you are using the Auth component for user authentification, you can check if a user is logged in or not simply by using: $session-check('Auth.User.id') as a condition in your if clause On Feb 19, 5:19 pm, amarradi radis...@googlemail.com wrote: I found the solution I set an username on an