holiday everyone.
Dave
-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of kangur91
Sent: December-25-09 6:39 PM
To: CakePHP
Subject: Re: Array Help
If you want to remove key from array, it's simple unset(example
below):
foreach($array as
If you want to remove key from array, it's simple unset(example
below):
foreach($array as $key => $value) {
if($value == "" || $value == " " || is_null($value)) {
unset($array[$key]);
You can add if($value != null)
use array_reserve function.
I wish, I help you.
Check out the new CakePHP Quest
I have this after submitting a form
[SelectionsSkills] => Array
(
[1] => Array
(
[13] => 4
)
[2] => Array
(
[1] => 4
)
[3] => Array
Got it!
Thanks.
Dave
-Original Message-
From: brian [mailto:bally.z...@gmail.com]
Sent: October-02-09 10:27 PM
To: cake-php@googlegroups.com
Subject: Re: Still sort array help
natcasesort() returns a boolean, not an array.
debug(natcasesort($merged));
On Fri, Oct 2, 2009 at 6:07
natcasesort() returns a boolean, not an array.
debug(natcasesort($merged));
On Fri, Oct 2, 2009 at 6:07 PM, Dave Maharaj :: WidePixels.com
wrote:
>
> No matter what i try I still cant sort an array.
>
> $merged = array_merge ($new_skills, $selected);
> debug($merged);
> Array
> (
> [0] =>
No matter what i try I still cant sort an array.
$merged = array_merge ($new_skills, $selected);
debug($merged);
Array
(
[0] => Tree
[1] => Zoo
[2] => Hello
[3] => Test
[4] => Cool
[5] => 3 Doors Down
[6] => Yellow
)
$sorted = natcasesort($merged);
pixels.com]
> Sent: August-13-09 7:50 PM
> To: cake-php@googlegroups.com
> Subject: Paginate from an array help
>
> I run my find query, get all the data I need but cant figure out how
> to then pass it off to paginate.
>
> $test = $this->Post->__quickQ
I got it...
Sorry.
Dave
_
From: Dave Maharaj :: WidePixels.com [mailto:d...@widepixels.com]
Sent: August-13-09 7:50 PM
To: cake-php@googlegroups.com
Subject: Paginate from an array help
I run my find query, get all the data I need but cant figure out how to then
pass it off to
I run my find query, get all the data I need but cant figure out how to then
pass it off to paginate.
$test = $this->Post->__quickQuery($string,$this->Auth->user(rank'),
$this->Auth->user('id'));
debug($test);
...spits out my array of records found
but how do i then pass $test to paginate
Thanks Joshua,
That works just as needed.
Dave
_
From: joshua [mailto:josh...@gmail.com]
Sent: August-11-09 1:14 AM
To: cake-php@googlegroups.com
Subject: Re: Array help
I think you can define a model level filter, it will help you to solve this
problem thoroughly. Just an idea of
the Posts where $access
> > = 'Post.access' that info is no longer goingto get pulled, thats why it
> > appears blank.
>
> > So I need to completely remove that bookmark from the array.
>
> > Trying something like:
>
> > foreach ($bookmark as $key =&g
ulled, thats why it
> appears blank.
>
> So I need to completely remove that bookmark from the array.
>
> Trying something like:
>
> foreach ($bookmark as $key => $value) {
> if (empty($value)) {
> unset($q[$key]);
>
> but cant get it to work...still mess
1 AM
To: cake-php@googlegroups.com
Subject: Re: Array help
1. Use a callback function afterFind to loop the return array, remove the
empty item.
2. How about give a condition when model->find.
[CODE]
'conditions' => array(("not" => array ( "Post.id" =>
1. Use a callback function afterFind to loop the return array, remove the
empty item.2. How about give a condition when model->find.
[CODE]
'conditions' => array(("*not*" => array ( "Post.id" => *null* )), //array of
conditions
[/CODE]
On Tue, Aug 11, 2009 at 10:25 AM, Dave Maharaj :: WidePixels.co
I have a contain query which produces these results.
Basically the user bookmarked a page when they had access. The Owner of the
post has changed the level of who can view the Post so in this case this
user no longer can view the post hence the missing post data. It was not
grabbed because the co
Figured it out... Stupid mistake on my part.
Thanks guys.
Dave
-Original Message-
From: Jeff Griffiths [mailto:anisotro...@gmail.com]
Sent: July-22-09 2:32 PM
To: cake-php@googlegroups.com
Subject: Re: Array Help
I'm not sure I understand. If you have this data structure in
.@widepixels.com]
Sent: July-22-09 2:20 PM
To: cake-php@googlegroups.com
Subject: RE: Array Help
SELECT * FROM entries WHERE showcase_id = '6bd19a7775f'; Returns nothing
because that Showcase has no Entries
SELECT * FROM entries WHERE showcase_id = '5edd082b249'; Returns the 5 t
essage-
> From: brian [mailto:bally.z...@gmail.com]
> Sent: July-22-09 2:07 PM
> To: cake-php@googlegroups.com
> Subject: Re: Array Help
>
> Run this query on the DB:
>
> SELECT * FROM entries WHERE showcase_id = '6bd19a7775f';
>
> See anything?
>
> On
the ['Entry']['image'] for
each of the ['Showcases'] to the view.
Dave
-Original Message-
From: brian [mailto:bally.z...@gmail.com]
Sent: July-22-09 2:07 PM
To: cake-php@googlegroups.com
Subject: Re: Array Help
Run this query on the DB:
SELECT * FROM entrie
Run this query on the DB:
SELECT * FROM entries WHERE showcase_id = '6bd19a7775f';
See anything?
On Wed, Jul 22, 2009 at 12:22 PM, Dave Maharaj ::
WidePixels.com wrote:
>
> I have this array and trying to do a for each Showcase Entry to show up with
> the Showcase.
>
> I just cant seem to get th
I have this array and trying to do a for each Showcase Entry to show up with
the Showcase.
I just cant seem to get the Entry array for each Showcase to appear.
Each Showcase apers but no Entry associated with it.
[Showcase] => Array
(
[0] => Array
(
How would I then use this array for pagination?
$data = $this->paginate('Job', array('Job.id' => $combined ));
-Original Message-
From: kdubya [mailto:kenwin...@winanstech.com]
Sent: June-22-09 10:45 AM
To: CakePHP
Subject: Re: Array Help
Try something lik
Try something like this (assuming the two arrays you mentioned are
called $id and $percent respectively):
$combined = array();
foreach ($id as $key=>$value) {
$combined[$key] = array('id'=>$value), 'percent'=>$percent[$key]);
}
--~--~-~--~~~---~--~~
You received
(
[id] => 7
[percent] => 23
)
)
Thanks,
Dave
-Original Message-
From: mike karthauser [mailto:mi...@brightstorm.co.uk]
Sent: June-21-0
d up for each as every Post
will have a partner Percentage
From: mike karthauser [mailto:mi...@brightstorm.co.uk]
Sent: June-21-09 10:08 AM
To: cake-php@googlegroups.com
Subject: Re: Array Help
hi dave
On 21 Jun 2009, at 13:35, Dave Maharaj :: WidePixels.c
hi dave
On 21 Jun 2009, at 13:35, Dave Maharaj :: WidePixels.com wrote:
>
> How can I edit this array:
> Array
> (
>[Test] => Array
>(
>[Post] => Array
>(
>[0] => 3
>[1] => 4
>[2] => 5
>
How can I edit this array:
Array
(
[Test] => Array
(
[Post] => Array
(
[0] => 3
[1] => 4
[2] => 5
[3] => 6
[4] => 7
[5] => 8
I am trying to update a Profile by using a slug that was created and
saved in the User table. What I need to do is get the Profile.id using
the $slug that is in User.slug
In the controller:
This is in the profiles_controller
var $uses = array('Profile', 'User');
function update_languages($slug
28 matches
Mail list logo