I saw Kornel, mention this email in a post a few days ago.  I remember
writing a response, but I often either email it using the wrong email,
or I forget it and it stays in the Drafts folder never to been seen by
me again.

Base class vs Interface, hmm, I guess it really depends on your mindset
really.  If you are creating something for other people to use and
extend, I believe building the foundation matters a lot more.  And PHP
doesn't support multiple inheritance, so in those cases it is more
important to have interfaces.

Source code vs W3C DOM vs PHPTAL DOM prefilters:

Actually, I have several prefilters in my framework right now, this is
mostly to help me quickly add different skins to a site without me
having the change a lot of the designers code.  Nothing is stopping me
from loading the html code up in w3c dom and manipulating the source
code, but right now I am using a few regular expressions.  So right now
not seeing a real need for it.

Prioritisation, actually don't really see a use for it at the moment,
but I do like being able to change it if I wanted to.

Hmm, I think that is enough.  I have a question I will ask in another email.

Best regards,
Levi Stanley


Kornel Lesinski wrote:
>
> I'm thinking about extending filters in next version of PHPTAL.
>
> What do you need?
>
> Base class vs Interface
> =======================
>
> Is abstract base class ok? (myfilter extends PHPTAL_filter), or do you
> need an interface? (myfilter extends myclass implements PHPTAL_Filter)
> or both?
>
> Base class makes it easier to extend filters in the future (I can add
> methods without having everyone change their filters), but won't let
> you use your own base class (do you ever use one?)
>
>
> Source code vs W3C DOM vs PHPTAL DOM prefilters
> ===============================================
>
> I could expose DOM to filters, which would let you write more accurate
> prefilters, but PHPTAL's DOM doesn't have any nice helper methods like
> getElementBy…(), and may change from version to version.
>
> Would you rather use W3C DOM? (php.net/dom). W3C DOM will convert
> entities to real characters (e.g.   will become invisible) and
> probably will change other minor details too.
>
> What interface would be best to specify which type of filter you want?
> A callback method? Separate interfaces? Multiple methods in the class?
>
>
> Prioritisation
> ==============
>
> Do you need to have filters applied in order different from order they
> were added to PHPTAL? E.g.
>
> $phptal->addFilter($last,…);
> $phptal->addFilter($first,…);
> $phptal->addFilter($middle,…);
>
>
> Do you need to remove filters that were already added?
>
> Do you need special filtering of templates called via macros?
>
>
> Filtering from within templates
> ===============================
>
> It might be useful to configure filtering from within a template, e.g.
> to remove all whitespace from part of the page.
>
>
> Any ideas for interface and syntax? How to define multiple filters?
> How to specify which are prefilters (filter source code once) and
> postfilters (filter output every time)?
>
>
> Cache
> =====
>
> Currently template code is recompiled whenever you change _class_ of
> the filter, but PHPTAL doesn't check what the filter actually does. Do
> you need better control over caching of compiled templates? (e.g.
> recompile when parameters of any filter change)
>


_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to