One slug route connected to multiple controllers?

2012-08-30 Thread 42startups
Hi So I have two controllers: Startups and People But I'd like a direct slug to link to either. eg: domain.com/TehEpicStartup - should go to startups-view domain.com/DisPersonIsKewl - should go to people-view Is there an easy option here, or do I need to create a separate controller, or

Re: Tutorial for REST API user create and authenticate?

2012-08-30 Thread 42startups
of time I'm going to look at this: https://github.com/nodesagency/Platform-API-plugin Hope that helps dude. On Mon, Aug 13, 2012 at 4:40 PM, 42startups he...@42startups.comjavascript: wrote: Simon! Yep it's me :) I worked out I didn't include the RequestHandler component

Re: One slug route connected to multiple controllers?

2012-08-30 Thread 42startups
. Att, -- Luiz Antonio S Messias Desenvolvedor Web http://twitter.com/tonyzrp @tonyzrp http://twitter.com/tonyzrp *LinkedIn* http://www.linkedin.com/in/luizantoniosmessias 2012/8/30 42startups he...@42startups.com Hi So I have two controllers: Startups and People But I'd like

Re: Tutorial for REST API user create and authenticate?

2012-08-13 Thread 42startups
Handling a JSON POST request is the same as handling a HTTP POST. On Mon, Aug 13, 2012 at 3:11 PM, 42startups he...@42startups.com wrote: Hi I'm looking for an up-to-date tutorial on creating a REST API using Cake so that I can send a POST request to create a new User and also a GET

Tutorial for REST API user create and authenticate?

2012-08-12 Thread 42startups
Hi I'm looking for an up-to-date tutorial on creating a REST API using Cake so that I can send a POST request to create a new User and also a GET request to fetch and authenticate a User's username and password. I've found a few online, but they seem to be from the 1.3 Cake version. And the

Basic algorithm for Reddit-like feed sorting?

2012-07-05 Thread 42startups
If I have a feed of content each with a vote count. Any ideas on a basic sort mechanism to display this? Like Reddit, I'd like: * the content with the most votes to be toward the top * but I also don't want old content to remain at the top (e.g. if only sorting by votes, the feed won't change

Re: CakePHP 2.2.0 and 2.1.4 released

2012-07-05 Thread 42startups
Seamless pagination for custom find types Does that mean I don't have to make a hasOne custom bind for paginating a HABTM model? -- 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

Re: Basic algorithm for Reddit-like feed sorting?

2012-07-05 Thread 42startups
Cool thanks, I'll give that a go. Should I put that in the beforeRender() function? -- 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

Re: Basic algorithm for Reddit-like feed sorting?

2012-07-05 Thread 42startups
Thanks for the help! Wow, virtual fields are pretty cool. I ended up trying the old basic Hacker News algorithm with some extra boost for new posts. Not perfect, but looks like it will work to begin with. public $virtualFields = array( 'score' = '(Story.votes / (time_to_sec(timediff(NOW(),

Re: One model, multiple pagination in a single view with conditions?

2012-06-29 Thread 42startups
on the parameters from jQuery. Though separate models might be cleaner as you can hard-code the associations. Mark On Monday, June 25, 2012 11:41:16 PM UTC-4, 42startups wrote: As the title suggests, is there a simple way to do this? Or should I create a separate model? Here's the code

Re: Pagination with HABTM?

2012-06-25 Thread 42startups
( 'Post.title' = 'asc' ) ); On Monday, 25 June 2012 04:14:32 UTC+3, 42startups wrote: Ah ok, so how would I paginate and limit results to 10?... $this-loadModel('Tag', $id); $tag = $this-Tag-read(); On Monday, June 25, 2012 6:11:55 AM UTC+10, JonStark wrote: I find it easier

One model, multiple pagination in a single view with conditions?

2012-06-25 Thread 42startups
As the title suggests, is there a simple way to do this? Or should I create a separate model? Here's the code: $this-paginate = array('limit'=30); $this-Hashtag-Pin-bindModel(array('hasOne' = array('HashtagsPin')), false); $this-set('hashtag', $this-paginate('Pin',

Pagination with HABTM?

2012-06-24 Thread 42startups
Wow, CakePHP really hasn't got this problem sorted. After hours of searching I came across the solution below (which may or may not be outdated), but I'm having issues applying paginatior 'limit' = 10 or other ordering. Any ideas what I'm missing? My model: public $hasAndBelongsToMany =

Re: Pagination with HABTM?

2012-06-24 Thread 42startups
, 42startups a écrit : Wow, CakePHP really hasn't got this problem sorted. After hours of searching I came across the solution below (which may or may not be outdated), but I'm having issues applying paginatior 'limit' = 10 or other ordering. Any ideas what I'm missing? My model: public