SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Threaded View

  1. #1
    SitePoint Evangelist
    Join Date
    Aug 2004
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    views looking messy, is there a better way?

    Couple of questions:

    1)
    Which direction do you choose?
    output buffering or concat $page var (all views return a string)?


    I choose the concat method, however, it's hard on the eyes: I didn't notice until i worked with a non programmer. [designer]
    PHP Code:
    $this->html.='<p class="more">'.
    '<a href="/rss" title="Click here to see an XML representation of the content of this weblog."><img src="'.EnumArticleConstants::$path.'themes/'.$this->theme.'/img/xml-summaries.gif" alt="Click here to see an XML representation of the content of this weblog." /></a> '.
    '</p>'
    I took a look at smarty template engine, however i never implemented it as I felt the learning curve for the designer would be as much as picking up basic semantics for php. (also php has incredible documentation and is easy to learn)

    so I tried to recreate the crash course in php.. I'll like to get feedback on this if possible ...its attached. [i'll like to take a look at some advanced smarty template files to c if i can recreate them using what i've created]


    I used a registry to register my transfer object in case the data access and view were not sequential. meaning data access was called a lot earlier than the view. This has a negative effect in that i can't reuse templates since the view asks the registery for a specific transfer object. [example 1]

    are data access and view ever that seperated?

    Example 2 shows a template the doesn't explicitely request the transfer object.. but expects for the object to exist in the same scope. [require instead of require_once]






    2
    How many use the method described on page 282 of harry's volume 2 book? Does anyone know what this method is called? dao? ..as it does create a transfer object.

    Is that what the example attempts? (without the business object)? http://java.sun.com/blueprints/corej...essObject.html







    3
    i plan to refactor a lot of my views this summer as i feel the views have become bloated. Take a look at my biggest view. How can i redesign using view helpers?
    - one of my ideas in refactoring is to implement view helpers as described in core j2ee patterns by alur..
    anyone with any advice?






    4
    lastly does anyone use composite controllers?
    are composite controllers the same as chain of responsiblity
    my thoughts are to have all my applications have a controller.. and in the __constructors add specific controllers for that domain.
    CalendarController, AuthenticationController, ArticleController

    anyone with any advice?
    Attached Files Attached Files


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
  •