Jump to content

how to output it?


runeveryday

Recommended Posts

the print_r($a)'s result is

 


views_handle_field_node Object

(

[view]=>view Object

(
[db_table] => views_view
[base_table] => node
[args] => Array
(
[0] => My entry 1
)

[use_ajax] =>
[result] => Array
(
[0] => stdClass Object
(
[nid] => 5
[node_title] => Title of a test entry
[node_revisions_body] =>
[node_revisions_format] => 1
[node_vid] => 5
[term_data_name] => My first test term name
[term_data_vid] => 1
[term_data_tid] => 1
[vocabulary_name] => Vocabulary 1
[node_revisions_vid] => 5
)

[1]=> stdClass Object
(
[nid] => 8
[node_title] => Title of a test entry
[node_revisions_body] =>
[node_revisions_format] => 1
[node_vid] => 5
[term_data_name] => My first test term name
[term_data_vid] => 1
[term_data_tid] => 1
[vocabulary_name] => Vocabulary 1
[node_revisions_vid] => 5
..
[2]..
..



 

now i want to output the [nid]=>5 and[nid]=>8.....and all the nid's value.i use this, but can't work.

 

$views_handle_field_node->$view->$result[]->nid. what's the correct output of it.

Link to comment
Share on other sites

I would assume this code to work:

 

 

foreach($a->result as $node)
{
$node->nid;
}

 

 

Using your expression (and assuming you're doing drupal), I believe the code you're looking for is similar to:

 

$views_handle_field_node->view->result[$i]->nid

 

Hope this helps. :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.