Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Oop & Php

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 03-01-2009
Member
 
Join Date: Oct 2008
Posts: 30
Oop & Php
  

I am a bit novice in PHP. Trying to create a design that is one and the same for all pages. So far I did this:
Code:
 class dynamicPage ( 
	  var $ title; 
	 
	   / / constructor 
	  function dynamicPage ($ tit) ( 
	  $ title = $ tit; 
	
	  ) 
	
	  function beginPage () ( 
		  echo ( '<! DOCTYPE HTML PUBLIC "- / / W3C / / DTD XHTML 1.0 Strict / / EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd ">'); 
		  echo ( '<html xml:lang="de" dir="ltr" xmlns="http://www.w3.org/1999/xhtml" lang="de"> <head>'); 
		  echo ( '<meta http-equiv="content-type" content="text/html; charset=UTF-8">'); 
		  echo ( '<title>'. $ title. '</ title>'); 
		
	  ) 
	
	  function setTitle ($ tit) ( 
	   $ title = $ tit; 
	  ) 
	  function endPage () ( 
	
	  ) 
	  function getTitle () ( 

	  return $ title; 
	  ) 
	

  )
In index.php:
Code:
 <? php 
   
    require_once ('../ libfirm / SQLFactory / dynamicPage.php '); 
    $ page = new dynamicPage ( "blaa"); 
    $ page-> beginPage ();  
 ?>
The problem is that after setting up this subject it ask the name of the page and does not generate its behalf words <title> </title> is empty.

Reply With Quote
  #2  
Old 03-01-2009
Member
 
Join Date: May 2008
Posts: 2,004
Re: Oop & Php

Code:
 class dynamicPage ( 
	  var $ title; 
	 
	   / / constructor 
	  function dynamicPage ($ tit) ( 
	  $ this-> title = $ tit; 
	
	  ) 
	
	  function beginPage () ( 
		  echo ( '<! DOCTYPE HTML PUBLIC "- / / W3C / / DTD XHTML 1.0 Strict / / EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd ">'); 
		  echo ( '<html xml:lang="de" dir="ltr" xmlns="http://www.w3.org/1999/xhtml" lang="de"> <head>'); 
		  echo ( '<meta http-equiv="content-type" content="text/html; charset=UTF-8">'); 
		  echo ( '<title>'. $ this-> title. '</ title>'); 
		
	  ) 
	
	  function setTitle ($ tit) ( 
	   $ this-> title = $ tit; 
	  ) 
	  function endPage () ( 
	
	  ) 
	  function getTitle () ( 

	  return $ title; 
	  ) 
	

  )
Reply With Quote
  #3  
Old 03-01-2009
Member
 
Join Date: Oct 2008
Posts: 30
Re: Oop & Php

Ah, thats good. Thanks a lot.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search



All times are GMT +5.5. The time now is 04:06 AM.