You are here: Re: Embed lots of html code in php & construc objects in php « PHP Programming Language « IT news, forums, messages
Re: Embed lots of html code in php & construc objects in php

Posted by gosha bine on 05/17/07 14:38

Ming wrote:
> Hi folks,
>
> I have a php file, it contains just a few php codes. The php codes I
> need to use is to construct an object, and use it several times, from
> html head until the last line of html code.

All php block share the same scope, so it would be enough to construct
the object only once:

<?php $myObject = new Foo(); ?>
html here
<?php $myObject->bar(); ?>
more html
<?php $myObject->baz(); ?>


--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация