Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Set:sort "A Set-compatible path"
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
alberto  
View profile  
 More options Oct 8 2009, 6:55 am
From: alberto <alberto.pri...@gmail.com>
Date: Thu, 8 Oct 2009 03:55:35 -0700 (PDT)
Local: Thurs, Oct 8 2009 6:55 am
Subject: Re: Set:sort "A Set-compatible path"
take my example , if I have an array like this

""""""""""
Array
(
    [0] => Array
        (
            [name_item1] => Array
                (
                    [date] => 2009-10-09
                )

            [name_item2] => Array
                (
                    [id] => 49
                    [name_item3] => Array
                        (
                            [0] => Array
                                (
                                    [id] => 15
                                 )

                        )

                )

        )

    [1] => Array
        (
            [name_item4] => Array
                (
                    [date] => 2009-10-08
                )

        )

)

""""""""""

I want to sort by date, the date variable is contained into name_item1
and name_item4 that are two different names
so i tried to use this path {n}.{s}.date but doesn't work probably
becouse there is name_item2 and name_item3 ???

On 7 Ott, 18:38, brian <bally.z...@gmail.com> wrote:

> On Wed, Oct 7, 2009 at 10:17 AM, alberto <alberto.pri...@gmail.com> wrote:

> > Where I can find the syntax of the variable $path that are passed to
> > the Set:sort ?

> For sort() you'll probably be using '{n}.ModelName.field_name'. The
> '{n}' part represents the array index and you provide that exactly as
> shown. You just need to change the 'ModelName' and 'field_name' bits.

> The 2nd link here shows how to use '{s}', which is even more fun.

> http://debuggable.com/posts/cake-12s-set-class-eats-arrays-for-breakf...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.