Provo a settare un attributo ad un elemento che ottengo con
Codice PHP:
$doc = DOMDocument::load(PHOTO_GALLERY_DIR.$folder.'/gallery.xml');
$doc->validateOnParse = true;
// Take a root element
$root_element = $doc->getElementById('gallery');
// Set attribute
$root_element->setAttribute('title', $name);
Però ottengo questo errore:
Fatal error: Call to a member function setAttribute() on a non-object in /home/gabriele/public_html/mio_sito.it/admin/model/photo-gallery/album.inc on line 93,
dove la linea 93 è
Codice PHP:
// Set attribute
$root_element->setAttribute('title', $name);
Qualche idea o suggerimento?