Re: regarding the HTML link helper..

2009-05-23 Thread Andrew McCafferty
If you're not doing any advanced routing then this should work: ?php echo $html-link('Go', '/users/index'); ? On 23 May, 15:21, Abhishek abhishek...@gmail.com wrote: Hi, When i use this to generate the a link $html-link('Go',array('controller'='users','action'='index')); The link

Re: How can related records be removed when master is deleted?

2009-05-20 Thread Andrew McCafferty
In your Post model set the dependent key to true on the hasMany relationship. var $hasMany = array( 'Comment' = array( 'className' = 'Comment', 'foreignKey' = 'post_id', 'dependent' = true, )

Re: Detecting if a link is to an image

2009-05-20 Thread Andrew McCafferty
Hi Kyle, I've hacked together a helper based on the TextHelper methods that should do what you're looking for... http://bin.cakephp.org/view/1261676226 Save it to app/views/helpers/autolink.php and include it in your helpers array: var $helpers = array('Html', 'Form', 'Autolink'); And in

Re: Detecting if a link is to an image

2009-05-20 Thread Andrew McCafferty
20, 11:03 pm, Andrew McCafferty andrew.mccaffe...@gmail.com wrote: Hi Kyle, I've hacked together a helper based on the TextHelper methods that should do what you're looking for... http://bin.cakephp.org/view/1261676226 Save it to app/views/helpers/autolink.php and include it in your

Re: I'm not sure how to write this query...

2008-12-27 Thread Andrew McCafferty
Hi Kyle, Here's a function you could try in your Post model - http://bin.cakephp.org/view/607120740 I've given it a default of 5 tags if called with no params. Obviously you can change this to suit or override it when you call it from your controller. e.g. $this-Post-postCountByTagCount(2)

Re: login script

2008-12-27 Thread Andrew McCafferty
Create login.ctp in /app/views/layouts then tell your action to use it. function login() { $this-layout = 'login'; } I'm guessing this is what you want. If you give us a bit more information you'll probably get a better answer though :-) On 27 Dec, 17:44, mona poojapinj...@gmail.com wrote:

Re: How to use bake.php in cakephp1.2

2008-12-27 Thread Andrew McCafferty
Mona, On Windows... cd to your app directory then run ..\cake\console\cake bake On Linux/OS X...you can set up your bash_profile then just run 'cake bake' What OS are you using? What have you tried? What's the error message? On 27 Dec, 17:45, mona poojapinj...@gmail.com wrote: It is not

Re: How can i change the layout of cakephp pages

2008-12-27 Thread Andrew McCafferty
The SQL log is displayed when debugging is set to 2 or above. Open config/core.php and set Configure::write('debug', 1); To get alternating row colors you can use the modulus operator in PHP. If you use bake, you'll see an example in an index.ctp view. ... ?php $i = 0; foreach ($posts as

Re: does cake have anything to help create a sortable grid?

2007-08-18 Thread Andrew McCafferty
If you want to stick with Prototype, I've used this in the past: http://www.tetlaw.id.au/view/blog/table-sorting-with-prototype/ It's really straightforward to use, just include the JS and add the relevant class to your table headers. Demo here:

Re: Global css navigation menu from DB

2007-04-20 Thread Andrew McCafferty
you suggested, unfortunately I still get the error mentioned above. Cheers. On Apr 18, 10:22 pm, Andrew McCafferty [EMAIL PROTECTED] wrote: Firstly, the $name of AppController isn't Nodes so remove that line... Try replacing it with: var $uses = array('Node'); This should tell

Re: Global css navigation menu from DB

2007-04-20 Thread Andrew McCafferty
...Also Make sure you restore cake/app_controller.php back to its original empty state: ?php class AppController extends Controller { } ? On 20 Apr, 17:15, Andrew McCafferty [EMAIL PROTECTED] wrote: I've just noticed the path to your app_controller.php file - it should be placed in your app

Re: Global css navigation menu from DB

2007-04-18 Thread Andrew McCafferty
Firstly, the $name of AppController isn't Nodes so remove that line... Try replacing it with: var $uses = array('Node'); This should tell AppController to use your Node model, making the findAllThreaded function available. On 18 Apr, 06:17, double07 [EMAIL PROTECTED] wrote: Hi All, I'm

ObserveField - Firefox Issue

2007-02-06 Thread Andrew McCafferty
Hello All, I'm getting some strange behaviour in Firefox only when using $ajax- observeField to watch a SELECT dropdown. If the observed dropdown list is opened and you hover over a selection, the event is fired after the amount of time specified by 'frequency'. In other words, you get an ajax

Re: Finally a good Editor for Windows

2007-01-24 Thread Andrew McCafferty
Thanks Mandy! This could be the one that drags me away from HTMLKit for good. I've only been playing with it for a few minutes but it looks great. Cake support would just be the icing on thewell...cake. Andrew On 24 Jan, 12:18, Mandy [EMAIL PROTECTED] wrote: Well, this post is not

Re: Finally a good Editor for Windows

2007-01-24 Thread Andrew McCafferty
! Andrew McCafferty schrieb: Thanks Mandy! This could be the one that drags me away from HTMLKit for good. I've only been playing with it for a few minutes but it looks great. Cake support would just be the icing on thewell...cake. Andrew On 24 Jan, 12:18, Mandy [EMAIL PROTECTED

Re: Setting a non default.thtml layout for a ''app/view/pages .thtml file

2007-01-20 Thread Andrew McCafferty
Uwie, I'd take a copy of cake/libs/controller/pages_controller.php and paste in into app/controllers/ Add the following into app/controllers/pages_controller.php: var $layout = 'your_custom_layout'; Create 'your_custom_layout.thtml' in app/views/layouts/ and hopefully Bob's your uncle :-)

Re: seen the new api search

2006-12-07 Thread Andrew McCafferty
Thanks Samuel - That looks very useful. Samuel DeVore wrote: http://start.gotapi.com/ note cake has a place here, actually a nice way to search the api. Sam D -- == S. DeVore (the old fart) the advice is free, the lack of crankiness will cost you

Re: custom 404 error page

2006-11-03 Thread Andrew McCafferty
Felix, In my /app/views/errors directory, i've created the following files error404.thtml missing_action.thtml missing_controller.thtml missing_view.thtml These override the default cake error pages (which you can find in /cake/libs/view/templates/errors) Perhaps I misunderstand your question