Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [XML][PHP]SimpleXML prawidłowe wyświetlanie zawartości, Problem z wyświetleniem zawartości pliku XML
darksideofTHEmoo...
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 16.11.2015

Ostrzeżenie: (0%)
-----


Witam,

chciałbym dowiedzieć się jak prawidłowo wyświetlić zawartość znacznika <content> w tym pliku XML: PLIK XML .
W chwili obecnej nie jestem w stanie stworzyć odnośników a tak by miały właściwy adres i treść. Oto kod:

Kod
      
$file = 'http://php.net/feed.atom';
$xml = simplexml_load_file($file);
$xmls= $xml->entry;
return $this->render('xml/index.html.twig', array('file' => $xmls ));

To kod z widoku:

Kod
    {%for files in file%}
            <tr> <td> <h3><a href="{{files.id}}">{{files.title}}</a> </h3>{{files.category.attributes.term}} | {{files.category.attributes.label}} <br>
                    {{files.published}} | {{files.updated}}
                 {%for ret in files.link%}
                     <a href="{{ret.attributes.href}}">{{ret.attributes.rel}}  {{ret.attributes.type}} </a>
                
                {%endfor%}
                
                <br><br>
                
                {%for content in files.content.children%}
                    {%for div in content%}
                        {{div}}
                        {%for p in div%}
                            {{p}}
                            {%for ul in p%}
                                {{ul}}
                            {%endfor%}
                        {%endfor%}
                    {%endfor%}
                    {%endfor%}
        
          
            </tr>
{%endfor%}


Czy jest to mozliwe do wykonania za pomoca SimpleXML ?

Dziekuje za pomoc.

Ten post edytował darksideofTHEmoon 4.06.2016, 16:58:59
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 10:10