what`s the return value of the funaction node_get_types('type', $node)? an object ,array or string?
On Sat, Dec 6, 2008 at 9:27 AM, chen teaman 54teaman@gmail.com wrote:
what`s the return value of the funaction node_get_types('type', $node)? an object ,array or string?
According to the API documentation, it returns either an array or a string, but with the 'type' parameter specified for $op as you have, then it'd be a string. See http://api.drupal.org/api/function/node_get_types for more information. The API site is a great reference for this kind of thing.
Regards, Dan
On Sat, Dec 6, 2008 at 7:57 PM, chen teaman 54teaman@gmail.com wrote:
what`s the return value of the funaction node_get_types('type', $node)? an object ,array or string?
it will return an array of content/node types like blog,page,story
-- [ Drupal support list | http://lists.drupal.org/ ]
Thank Dan and Sivaji
I know of what you said, but i still can`t understand the code below:
function node_example_form http://api.drupal.org/api/function/node_example_form/6(&$node) { $type = node_get_types http://api.drupal.org/api/function/node_get_types/6('type', $node);
if ($type->has_title) { $form['title'] = array( '#type' => 'textfield', '#title' => check_plain http://api.drupal.org/api/function/check_plain/6($type->title_label), '#required' => TRUE, '#default_value' => $node->title, '#weight' => -5 ); }
see http://api.drupal.org/api/file/developer/examples/node_example.module/6/sour...
there $type is a object, how to explain it,how to understand it