You are here: Problem with overriding Functions (oop) « PHP Programming Language « IT news, forums, messages
Problem with overriding Functions (oop)

Posted by Johannes Permoser on 01/19/08 23:32

Hi,

i'va got a class 'Page'. One of it members is an instance of a template engine.
The Page-class has a method render() which calls the functions read(),
transform(), transport() and starts the template engine.

Now I want to reuse the Page class for a more specialized page 'ImagePage'. So:
ImagePage extends Page. This Page contains an extra picture and therefore needs
to call image() before starting the template engine. How do i smartly integrate
that call into the Page::render() function.

I could override the whole funtion, but then i'd have to copy and paste the
whole code for the calls of read(), transform(), transport()?
What's the professional way here?

Johannes

 

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

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