SitePoint Sponsor

User Tag List

Page 4 of 4 FirstFirst 1234
Results 76 to 99 of 99
  1. #76
    SitePoint Guru
    Join Date
    Dec 1999
    Location
    Southampton, Hants, UK
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This template class thingy sounds interesting, could someone point me in teh direction about creating one of these - I've just started a project and am trying to create classes like this that I can reuse if I need, the template one sounds like a wicked idea. :-)

  2. #77
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by daniel_eastley
    This template class thingy sounds interesting, could someone point me in teh direction about creating one of these - I've just started a project and am trying to create classes like this that I can reuse if I need, the template one sounds like a wicked idea. :-)
    I thought you might have been kidding with this post. It seems like writing a template engine is some sort of a "right of passage" in PHP. Anyway, if you look at this thread you will find this area is a target rich environment.
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  3. #78
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems like writing a template engine is some sort of a "right of passage" in PHP.
    Pretty funny but true. The problem is that no one (that I know of) has taken all the variations listed here and build a single API that includes every type. Given all the libraries you could do some sort of API averaging to come up with the interface. A PDO for templates (PTO?).
    Christopher

  4. #79
    SitePoint Zealot
    Join Date
    Jul 2003
    Location
    UK
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I usually stick with my regular classes....

    - mysql
    - file operations (fopen e.t.c)
    - Request vars (Simply to get the http vars and remove mysql injections and a couple other things)
    - url verifying (I do a lot of slurps, so i have a script to go through the page and grab the urls and convert them to a standardised form)
    .... many many more

  5. #80
    SitePoint Member Don Wilson's Avatar
    Join Date
    Sep 2004
    Location
    Dallas
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've been using really simple templates for the past year or so (only preg_replace("#{var}#is", $value, $text) from an array of tags) and am finally venturing out in expanding it. I've already made a {template="file.tpl"} to parse templates into the current one and {include="file.php"} to parse the specified file then return it's value back into the template, as well as {$var} or {$array['test'][1]} replaced with it's requested variable.

    If any of you could help me with making if/elseif/else, for and while processes in the template engine that would be fantastic. I've seen it used in programs like IPB but they're too integrated into the kernel, so to say, that I can't grab anything useful.

    Other than that, I use:

    Clean (clean variables with different levels (lite = htmlentities, heavy = bbcode, etc)
    Template (simple but expanding soon)
    Zip (easily create zip files with multiple folders, sub-folders and files)
    Form (again, expanding soon)
    MySQL database class (advanced setup for query() to parse query arrays)
    Ad (quickly make dynamic ads (sizes, randomize between campaigns, etc) for the site)
    I used to use a functions class but it started to get more complicated than what it was supposed to do (clean up things). I know keep them in one php included file.

  6. #81
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Cool

    Quote Originally Posted by lazy_yogi
    I guess it's almost brand new considering its PHP5.
    Ah well, FYI, this thing won the Zend PHP5 contest.


    Quote Originally Posted by lazy_yogi
    Just wondering if this is becomming popular and used? Any idea?
    NO, I don't have any idea, infact I haven't even downloaded & used it yet. From the look & description of it, it looks like they are trying to implement ASP.NET coding style in PHP with controls etc. As far as I know, this will slow down the speed of execution of your applications as first a PHP script will parse the tags & then PHP will execute them. Its a 2 step execution process instead of the usual 1 step execution. So the same restrictions apply to it as to any other templating engine, it slows down your application.

    It'll possibly affect more because of its size, the sheer amount of code in it, just like smarty!!! I wouldn't use smarty if my life depended on it, its just too bulky!!!
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  7. #82
    SitePoint Enthusiast
    Join Date
    Jun 2003
    Location
    Ljubljana, Slovenia
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    - Core : handles the program
    - Params : handles all the params .. and sessions
    - language: the name speaks for it self
    - Locale : handles other languageges
    - User: handles user data if needed
    - navigator: handles human readable urls
    - site: handling the sites (If more then 1 in the same framework)
    - data factory: handles data handlers (file, db, xml)
    - Collection factory : handles collections for entities
    - privileges classes : handles the privileges for the site
    - wireframe factory: handles the wireframes of the site
    - module : abstract class for site modules
    - plugin : abstract class for site plugins
    - log factory: for log handlers

    I wrote me a little framework for making sites .. since I've successfully used it a couple of times on many different projects .. its becoming my favorite ...

    bye

    Armando

  8. #83
    SitePoint Addict
    Join Date
    Apr 2002
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mx2k
    right, but phpclasses.org is for those wanting to grab for use, and some are ill written or have bad documentation
    What you find in the PHP Classes site is a reflex of the level of the hundreds of developers that submit their classes to the site. Some classes are better than others, some have better documentation and examples than others, etc.. It is not even.

    To make it easier to find classes that satisfy better different types of quality criteria, the site has a ratings system that lets users that have downloaded the classes to rate the classes in the aspects of: utility, consistency, documentation, examples and test suite scripts. The all time top rated classes are listed in the top charts page that is updated on a daily basis.

    This feature exists because several users that care about PHP and reckon the value of the site, have submitted a suggestion to implement this feature. So it is a reflex of a need of the PHP community: to find good classes making them stand out.

    Quote Originally Posted by mx2k
    i'm thinking more on the lines where all the examples are well written with in depth documentation, that are meant more for learning than live production use. and i know of plenty of places like phpclasses

    zend, phpfreaks, devshed, phpbuilders etc. and then you have to shift through tons of classes and if someone is new, its hard for them to know what is considered to well written verses what is a bad example. and as others have told me times before, we should really try to help in keeping good standards not only for ourselves but for others as well.
    When you want to gather contributions from a community that is sharing their work for free, you can't be too selective. Otherwise you end up excluding many of the best potential contributors that could contribute but they won't because they do not agree with selection criteria or because in practice only an elite gets to decide what is accepted.

    The way the PHP Classes site work is more democratic. That is why it is the largest repository of PHP classes. All kinds of classes are accepted. Then it lets the users decide which are better using the rating system.

    If you, as an user, want to know which are the most appreciated classes for instance to access databases, you just go in the page for database classes and use the top rated classes link. Then you can narrow the search among only the most appreciated classes for the purposes you need.

    Certainly you may find more than one class for what you need, but that is a consequence of the fact that the site is democratic.

    Still, to encourage developers to contribute with more innovating classes, instead of more of the same classes that are already available, it was created the PHP Programming Innovation Award initiative. This initiative consists on picking the classes submitted each month that provide innovating features or implement innovating approaches for solving problems of interest.

    Every month, all the innovating classes are nominated, and in the following month the most voted classes are announce. The winners may choose prizes provided by sponsor companies that are very well known among the PHP community. In practice, practically all winners receive prizes of interest for PHP developers.

    As you may see in the winners page, this has resulted in an interesting raise of the average quality of the classes that are submitted to the PHP Classes site. Every body wins. The authors of innovative classes win prizes, the users have access to more innovating classes, and the sponsors get free advertising.

    So, unlike you say, the PHP Classes is not like other sites as you do not have to shift through tons of classes to find good quality contributions, and at the same time nobody is excluded from submitting their work to a community of more than 235,000 subscribers, with great chances of getting plenty of feedback, recognition and prizes.
    Manuel Lemos

    Metastorage - Data object relational mapping layer generator
    PHP Classes - Free ready to use OOP components in PHP

  9. #84
    SitePoint Member
    Join Date
    Dec 2004
    Location
    Netherlands
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does no one here use Vincent's Eclipse library anymore? It was very populare a couple of years ago on this forums... I still use it in my projects, but since I'm going to PHP5 I need to adjust it or start working with something else.
    If you are not using it anymore, wat was the reason for this? Lack of support / further development?

  10. #85
    SitePoint Guru Galo's Avatar
    Join Date
    May 2005
    Location
    Holland!
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dispatcher
    Observer
    Model
    Render
    Driver
    Request
    Constraint
    Exception
    Collection
    Iterator
    Datatype
    Resource
    etc...

    and btw : templates suck! just generate the code from XML or DB resources according to the Render mode to render the model icw the driver ie : xml, html, xhtml, js, etc etc
    Business as usual is off the menu folks, ...

  11. #86
    SitePoint Guru worchyld's Avatar
    Join Date
    Jul 2003
    Location
    Newcastle upon Tyne
    Posts
    909
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    templates suck! just generate the code from XML or DB resources according to the Render mode to render the model icw the driver ie : xml, html, xhtml, js, etc etc
    Yeah, but nobody teaches how to do it, nor are the tutorials on it any good -although I am looking forward to sitepoint's new xml/OO-php +xsl book which is meant to explain how to do it from scratch.

  12. #87
    SitePoint Member skipcandy's Avatar
    Join Date
    Dec 2004
    Location
    Bancroft
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Interesting stuff... lots of task-specific classes being used, and also a lot of design patterns.

    Is anyone using PEAR stuff on a regular basis?

  13. #88
    SitePoint Member
    Join Date
    Jul 2004
    Location
    Lviv
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I like:
    - Smarty
    - PEAR_DB
    - Cache_Lite
    - Benchmark
    - XML_sql2xml
    - XML_Serializer
    - Snoopy
    - JpGraph

  14. #89
    does not play well with others frezno's Avatar
    Join Date
    Jan 2003
    Location
    Munich, Germany
    Posts
    1,391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tim_Rogovets
    I'm thinking: there's a number of database abstraction classes out there. And if I needed to choose one - I'd be more than glad to try out a class written by someone I've talked to on the forums, someone who has good reputation in my eyes.
    Worth a closer look:

    database: http://www.sitepoint.com/forums/showthread.php?t=95763

    form validation: http://www.sitepoint.com/forums/show...hreadid=121129
    We are the Borg. Resistance is futile. Prepare to be assimilated.
    I'm Pentium of Borg.Division is futile.Prepare to be approximated.

  15. #90
    does not play well with others frezno's Avatar
    Join Date
    Jan 2003
    Location
    Munich, Germany
    Posts
    1,391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by @rt
    I like:
    - Smarty
    - PEAR_DB
    i hate them
    We are the Borg. Resistance is futile. Prepare to be assimilated.
    I'm Pentium of Borg.Division is futile.Prepare to be approximated.

  16. #91
    SitePoint Guru Galo's Avatar
    Join Date
    May 2005
    Location
    Holland!
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by worchyld
    Yeah, but nobody teaches how to do it, nor are the tutorials on it any good -although I am looking forward to sitepoint's new xml/OO-php +xsl book which is meant to explain how to do it from scratch.
    The point is u need to know your design patterns, not only their names but when you know how to implement them and you understand them together with UML you can build enterprise application if you want....

    I just bough PHP5 Objects , Patterns abd Practice from Matt Zandstra, this is a verry good book that shows you exacly how to use Patterns and OOP principles with PHP, most design patterns are based on Client side like java c and c++ etc, PHP is ServerSide and has a slighly different approach to Patterns within an OOP environment.
    Business as usual is off the menu folks, ...

  17. #92
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    Jasons book will cover this area as well I believe, taking into account Unit Testing which are all PHP specific. Can't wait.

  18. #93
    does not play well with others frezno's Avatar
    Join Date
    Jan 2003
    Location
    Munich, Germany
    Posts
    1,391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by daniel_eastley
    This template class thingy sounds interesting, could someone point me in teh direction about creating one of these
    just about template engines in common, i love this thread:
    http://www.sitepoint.com/forums/showthread.php?t=67849
    We are the Borg. Resistance is futile. Prepare to be assimilated.
    I'm Pentium of Borg.Division is futile.Prepare to be approximated.

  19. #94
    does not play well with others frezno's Avatar
    Join Date
    Jan 2003
    Location
    Munich, Germany
    Posts
    1,391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mlemos
    If you, as an user, want to know which are the most appreciated classes for instance to access databases, you just go in the page for database classes and use the top rated classes link. Then you can narrow the search among only the most appreciated classes for the purposes you need.
    That mustn't bring you much further.
    The rating system doesn't include new classes since there can't be any/much ratings on them.
    There are good classes not or hardly rated because user didn't rate because of lazyness.
    There might be high rated classes but those don't fit your needs.
    In the end it results in download most of the classes (which sound interesting by description) and take a look
    We are the Borg. Resistance is futile. Prepare to be assimilated.
    I'm Pentium of Borg.Division is futile.Prepare to be approximated.

  20. #95
    SitePoint Addict
    Join Date
    Apr 2002
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by frezno
    That mustn't bring you much further.
    The rating system doesn't include new classes since there can't be any/much ratings on them.
    Often that is not the case. Some users are very quick to try and rate new classes, providing, enough ratings to make them show right away, especially when they are happy and grateful about the classes they try.

    What happens is that the site has a teaser to encourage users to rate as many classes as they have tried. That teaser is the top reviewers chart. It takes in account not only the quantity of classes that each user rates but also the accuracy of the ratings.

    This way this chart provides some recognition to those that help other users by sharing their ratings of each class. Maybe now you may understand why at least some new classes that are more appreciated get rated very quickly after they are released.

    Quote Originally Posted by frezno
    There are good classes not or hardly rated because user didn't rate because of lazyness.
    Yes, most users do not bother to rate any classes that they try. Anyway, users tend to bother to rate classes especially when they like it, and also when the classes are updated because the new classes alert messages encourage the users that have downloaded and tried the classes to rate them.

    So, I could say that chances are that when a class does not get any ratings is because nobody found interesting. This is almost the same as saying, that only interesting classes get well rated.

    Quote Originally Posted by frezno
    There might be high rated classes but those don't fit your needs.
    Ok, but I don't know what could be done in the site to make it guess your needs. Chances are that your needs are not very different from the others, and that you appreciate classes that are useful, consistent, well documented, have good examples and are well tested. Those are the parameters about the classes that the site asks the users to rate.

    Quote Originally Posted by frezno
    In the end it results in download most of the classes (which sound interesting by description) and take a look
    Yes, but narrowing the search within 10 classes is much less work than doing it over 100. If you have a better idea, please share it with us.

    You see, the ratings system was created upon suggestion of several users to help sorting which are the most appreciated classes among the crowd. If you really care for the improvement of the quality of the service that this site provides to the PHP developers, besides pointing its weaknesses, you may as well suggest improvements that could realistically be implemented.
    Manuel Lemos

    Metastorage - Data object relational mapping layer generator
    PHP Classes - Free ready to use OOP components in PHP

  21. #96
    does not play well with others frezno's Avatar
    Join Date
    Jan 2003
    Location
    Munich, Germany
    Posts
    1,391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mlemos
    Yes, but narrowing the search within 10 classes is much less work than doing it over 100. If you have a better idea, please share it with us.
    That's right and actually i don't have a 'better' idea.

    For a quick initial check i do it that way:
    Reading the description of the class of interest.
    Sounds interesting -> download
    Check the demo file (if available) online. Interesting -> download

    Then checking the file(s).
    Poor programming -> delete
    No comments (documentation) -> usually delete
    Demo doesn't work as expected -> delete
    We are the Borg. Resistance is futile. Prepare to be assimilated.
    I'm Pentium of Borg.Division is futile.Prepare to be approximated.

  22. #97
    SitePoint Addict
    Join Date
    Apr 2002
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by frezno
    That's right and actually i don't have a 'better' idea.

    For a quick initial check i do it that way:
    Reading the description of the class of interest.
    Sounds interesting -> download
    Check the demo file (if available) online. Interesting -> download

    Then checking the file(s).
    Poor programming -> delete
    No comments (documentation) -> usually delete
    Demo doesn't work as expected -> delete
    One thing that many users appreciate is that they do not have to download and install to inspect the code and documentation of the classes, as they can see it online.

    Anyway, once I have more time to add more sub-groups to the class groups, the search will be narrower and more specific.
    Manuel Lemos

    Metastorage - Data object relational mapping layer generator
    PHP Classes - Free ready to use OOP components in PHP

  23. #98
    does not play well with others frezno's Avatar
    Join Date
    Jan 2003
    Location
    Munich, Germany
    Posts
    1,391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mlemos
    One thing that many users appreciate is that they do not have to download and install to inspect the code and documentation of the classes, as they can see it online.
    right, that's much appreciated and this is what i'm doing with the first two positions mentioned.
    We are the Borg. Resistance is futile. Prepare to be assimilated.
    I'm Pentium of Borg.Division is futile.Prepare to be approximated.

  24. #99
    gimme the uuuuuuuuuuu duuudie's Avatar
    Join Date
    Feb 2004
    Location
    Switzerland
    Posts
    2,253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mmj
    class utf8_string (filtering, generating UTF8 strings)
    class specialurl (for friendly URLs)
    sorta late on that thread but... god I wish I could take a look at these classes


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •