0

我正在寻找一种方法来分解 $content 变量,并利用它的内容。下面是我在使用print_r($node)命令查看 Drupal 如何创建$content变量时获得的代码示例。我应该如何安排描述,以便我可以将其作为变量输出,而不使用图像?衷心感谢大家的帮助!

 [content] => Array
        (
            [#content_extra_fields] => Array
                (
                    [subscriptions_ui] => Array
                        (
                            [label] => Subscribe
                            [description] => Subscriptions UI module form.
                            [weight] => 100
                        )

                    [title] => Array
                        (
                            [label] => Title
                            [description] => Node module form.
                            [weight] => -5
                        )

                    [body_field] => Array
                        (
                            [label] => Body
                            [description] => Node module form.
                            [weight] => 0
                            [view] => body
                        )

                    [revision_information] => Array
                        (
                            [label] => Revision information
                            [description] => Node module form.
                            [weight] => 20
                        )

                    [author] => Array
                        (
                            [label] => Authoring information
                            [description] => Node module form.
                            [weight] => 20
                        )

                    [options] => Array
                        (
                            [label] => Publishing options
                            [description] => Node module form.
                            [weight] => 25
                        )

                    [comment_settings] => Array
                        (
                            [label] => Comment settings
                            [description] => Comment module form.
                            [weight] => 30
                        )

                    [menu] => Array
                        (
                            [label] => Menu settings
                            [description] => Menu module form.
                            [weight] => -2
                        )

                    [path] => Array
                        (
                            [label] => Path settings
                            [description] => Path module form.
                            [weight] => 30
                        )

                    [attachments] => Array
                        (
                            [label] => File attachments
                            [description] => Upload module form.
                            [weight] => 30
                            [view] => files
                        )

                    [path_redirect] => Array
                        (
                            [label] => URL redirects
                            [description] => Path redirect module listing
                            [weight] => 30
                        )

                )

            [#pre_render] => Array
                (
                    [0] => content_alter_extra_weights
                )

            [body] => Array
                (
                    [#weight] => 0
                    [#value] => 
4

0 回答 0