gnope php gtk gui gnope.org  

gladexml extention

 
Post new topic   Reply to topic    gnope.org Forum Index -> Gtk2 PEAR packages
View previous topic :: View next topic  
Author Message
leon_pegg



Joined: 12 Jun 2006
Posts: 113
Location: hemel / UK

PostPosted: Thu Jun 15, 2006 8:54 pm    Post subject: gladexml extention Reply with quote

here is a very small extention i made for gladexml
it adds load_remote this alows you to load a glade file from the web;

<?php

class gladexml_ext extends gladexml{

public static function load_remote($url){
$file = file_get_contents($url);
return parent::new_from_buffer($file);
}

}

?>


useage:

$glade = gladexml_ext::load_remote('http://btarchives.com/glade/login.glade');

hope this helps some one

regards leon pegg
Back to top
leon_pegg



Joined: 12 Jun 2006
Posts: 113
Location: hemel / UK

PostPosted: Thu Jun 15, 2006 9:01 pm    Post subject: Reply with quote

<?php
class gladexml_ext extends gladexml{

public function __construct($url){
$file = file_get_contents($url);
parent::new_from_buffer($file);
}

}
?>

this is an updated version acts much more like the old but now alows you to load ether a local glade file or remote glade file.

usage

$glade = new gladexml_ext('login.glade');
or
$glade = new gladexml_ext('http://btarchives.com/glade/login.glade');


Last edited by leon_pegg on Fri Jun 16, 2006 5:51 pm; edited 1 time in total
Back to top
Osiris



Joined: 17 Dec 2005
Posts: 65

PostPosted: Fri Jun 16, 2006 11:05 am    Post subject: Reply with quote

btw.:
a) this subforum is for pear compatible Packages, yours isn't it
b) you can't return anything from a constructor, because it returns nothing.
take a look at the php docs

regards
Osiris
Back to top
leon_pegg



Joined: 12 Jun 2006
Posts: 113
Location: hemel / UK

PostPosted: Fri Jun 16, 2006 5:57 pm    Post subject: Reply with quote

sorry about posting here you are right about the return i just forgot to remove it when i change it to a constructor. hva ealtered the code acordingly
Back to top
Display posts from previous:   
Post new topic   Reply to topic    gnope.org Forum Index -> Gtk2 PEAR packages All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Templates enhanced by DigiWiki. Hosting by Tradebit.