我正在编写脚本以编程方式添加节点,但我不知道添加/附加图像的正确方法。实际上,我对Drupal不太熟悉。
以下是我在使用print_r
现有图像时发现的(样本)图像对象$node
:
field_image:数组([und] =>数组([0] =>数组([fxid] => 3089 [alt] => [title] => [width] => 95 [height] => 126 [uid] = > 249 [文件名] => helloworld.jpg [uri] => public://helloworld.jpg [filemime] =>图片/ jpeg [文件大小] => 3694 [状态] => 1 [时间戳] => 1346748001 [类型] =>图片[media_title] => Array()[media_description] => Array()[field_tags] => Array()[field_license] => Array([und] => Array([0] => Array([值] =>否))))[元数据] =>数组()[rdf_mapping] =>数组())))
我发现的下一个是以下内容。
field_temp_image:数组([und] =>数组([0] =>数组([value] => http://www.example.com/sample-path/helloworld.jpg [format] => [safe_value] => http://www.example.com/sample-path/helloworld.jpg)))`
我应该如何以这种方式将图像添加到该节点?