Different pagination condition for different functions

2008-04-14 Thread aj

Hello,

I want to have different pagination conditions for different functions
in my controller.
For example:
function index()
{
$criteria = nodeType LIKE 'Blog';
$data = $this-Blog-paginate($criteria);
$this-set('data',$data);
}

function myBlogs()
{
$criteria = nodeType LIKE 'Forum';
$data = $this-paginate($criteria);
$this-set('data', $data);
}

Can someone show me how to do this?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Business Benifit?

2008-01-24 Thread AJ

In a company like that I would try to convince them of the increased
development speed.
Show them the stuff with the form helpers, and the save() method on
objects and stuff like that.
Try to make them realise that CakePHP will drasticly reduce
development time, but in the mean time to still charge the clients the
same.
That should make a serious entrepeneur realise it's worth the
investment.. ;)

On Jan 24, 10:55 pm, John David Anderson (_psychic_)
[EMAIL PROTECTED] wrote:
 On Jan 24, 2008, at 2:36 PM, Doug @ Straw Dogs wrote:

  snip

  Best Practices - We've not used best practices before and its
  worked.  So why change now?
  OO - As above.  Nothing more than a buzzword.  Whats the point.
  Yada yada yada.

 I'd have to agree with Chris at some level. Any place that thinks OO
 is just a buzzword, and that Best Practices aren't important is going
 to run into some serious trouble in the not too far future.

 Run.

 -- John

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: findAllThreaded Returning Empty

2007-12-13 Thread AJ

 Youd be better off IMO getting familiar with and using the tree
 behavior though

Actually, I am. Rather, that model is set up for it. I use
generateTreeList other places for dropdowns, but didn't think I could
have it generate an unordered list. So far I can't see how to use the
tree behavior to just give me a hierarchal array like that.

If that's possible, I'd certainly prefer it, but might need a couple
pointers.

Thanks much,

AJ
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: findAllThreaded Returning Empty

2007-12-13 Thread AJ

 Something to play with:http://bin.cakephp.org/view/375925194
 $data would be flat findAll sorted by lft.

Thanks a ton, but I'm having some issues.

Here is what's in my controller:
var $helpers = array('Tree' );
$this-set('navContent', $this-Content-
findAll(null,null,'Content.lft ASC'));

...and in my layout:
echo $tree-generate($navContent);

And I'm getting these errors:

Undefined variable: node [CORE/app/views/helpers/tree.php, line 65]
Undefined variable: itemReturn [CORE/app/views/helpers/tree.php, line
65]

AJ
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: findAllThreaded Returning Empty

2007-12-13 Thread AJ


 The code does not know the name of the model (array key) to loop on,
 look at the example usage in the comments (you need to pass something
 in the 2nd parameter)

 PS. there /is/ a typo $itemReturn should just be $return.

Both changed, but still getting the $node error. Where is that
variable coming from? I don't see it actually being set by the helper.

PS: I really appreciate you sticking with me on this :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: findAllThreaded Returning Empty

2007-12-13 Thread AJ

Ah, $node should also be $return. It works now! The ul and li
structure doesn't seem to be building quite right, but that's the
least of my worries now. I'm sure I can figure that out.

Thanks again!

AJ
http://atlantajones.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: findAllThreaded Returning Empty

2007-12-12 Thread AJ

Trying to bump this a bit. Either nobody saw it, or maybe a solution
isn't all that obvious?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: findAllThreaded Returning Empty

2007-12-12 Thread AJ

Chris,

Thanks for the response. Actually that made a lot of sense.
Unfortunately I was already in debug mode 2.

I tried setting it to every other value and even deleted the cache
file. Same result. And again, I checked the SQL output and it runs
fine by itself.

Open to other ideas :)

AJ

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: findAllThreaded Returning Empty

2007-12-12 Thread AJ

 I will say this:  if CakePHP is generating the proper queries then
 perhaps you are looking at the wrong array?  Try pasting the code in
 question over athttp://bin.cakephp.organd posting the link here.  It
 might be something really silly.

I'm totally willing to believe that's the case, but I'm sure I have
the right array. I mean, I'm doing a print_r on it immediately after
the findAllThreaded call.

And the kicker is if I *remove* the conditions, the array is populated
with all results.

So, these conditions will also spit out all results in the proper
array format:
   1 = 1
   Content.section_id IS NOT NULL

But a condition like this returns absolutely nothing:
  Content.section_id = 1

...even though I can take the generated SQL and it returns the
appropriate pages.

AJ

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: New Cake App In The Wild

2007-12-11 Thread AJ

I totally agree with that sentiment. But remember, this was meant to
be as quick and dirty as possible, with the caveat that it's NOT the
place to do anything super sensitive. As I was building this to fill
my own need, I knew I didn't want to go through the hassle of logins
and passwords. Auto-generating is an idea, but then I've got to write
it on a post-it (or my hand) until I pick it up. Again, defeating its
purpose.

AJ

On Dec 3, 9:45 am, Jon Bennett [EMAIL PROTECTED] wrote:
  Just launched an extremely basic web app using the 1.2 alpha. It's
  called ClipRunner and basically served my own need of getting basic
  text data from one computer to another.

 http://www.cliprunner.com

 When I first tried to use it, I entered some text, clicked on 'clip
 it' and was greeted by a 'this code is already in use'

 I wonder if it might be preferable to have this auto generated
 somehow, or perhaps have that as an option.

 also might be nice to allow people to create an account and save
 'clips' within, as I for one wouldn't want to have serial numbers as
 publicly accessible.

 hth

 jon

 --

 jon bennett
 w:http://www.jben.net/
 iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



findAllThreaded Returning Empty

2007-12-11 Thread AJ

I searched through the list and could not find anyone having this
specific issue.

I am using 1.2 (not exactly sure what version, but not pre-beta). I
have a table of content pages, which includes a parent_id field. I am
trying to pull a threaded array like this:

$test = $this-findAllThreaded(array('Content.section_id'='1'));

Basically I want to build some navigation, so I only want pages within
a specific section.

But the array keeps coming back empty. However, if I copy the SQL
query that Cake builds and run it, it returns exactly the records it
should.

Also, if I specify NO conditions (or even 1 = 1), it populates the
array with all pages. And no other conditions work, no matter what
fields I try to match.

I'm really stuck as this makes no sense whatsoever and I *seem* to be
doing it right. could this be a bug that has been resolved in the pre-
beta?

Thanks in advance!

AJ

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



New Cake App In The Wild

2007-12-02 Thread AJ

Just launched an extremely basic web app using the 1.2 alpha. It's
called ClipRunner and basically served my own need of getting basic
text data from one computer to another.

http://www.cliprunner.com

Comments welcome!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bakery Article : How to use ACL in 1.2.x

2007-08-30 Thread AJ

Great article that's really helped me a lot, thank you.

However, I'm still having a block on ACL that I can't find answers
for. So in your basic example, you can easily allow/deny access to
'posts' as a whole. However, if each post is an ACO, how do you query
the database to only show records that user has access to?

So in other words, I have a news article system on my site. Two users
have access to News, but only certain articles. Each article is an ACO
and each user is an ARO. When User A logs into their account, I want
them to only see those records they can edit, and the same with User
B. I've searched the manual, API, this list and everywhere else, and
there seems to be no answers.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bakery Article : How to use ACL in 1.2.x

2007-08-30 Thread AJ

Great article that's really helped me a lot, thank you.

However, I'm still having a block on ACL that I can't find answers
for. So in your basic example, you can easily allow/deny access to
'posts' as a whole. However, if each post is an ACO, how do you query
the database to only show records that user has access to?

So in other words, I have a news article system on my site. Two users
have access to News, but only certain articles. Each article is an ACO
and each user is an ARO. When User A logs into their account, I want
them to only see those records they can edit, and the same with User
B. I've searched the manual, API, this list and everywhere else, and
there seems to be no answers.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: ACL Implementation Discussion

2007-08-30 Thread AJ


 When querying data from the database I limit the data set with a WHERE
 [field.name] IN ([list, of, ACOs]) clause.  This means that each user
 can only retrieve the data that they have permission to see.

This is exactly what I've been trying to do for the last couple days.
Can you be more specific (with actual code) on how to accomplish this?

Many thanks in advance.

AJ


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---