Ammar: One problem I faced with smarty was setting page titles. How can I
set page titles from the view (which in this case are tpl files), when you
have a header template? the only way I can think of is to {include
file=header.tpl title=something}, and I dont' think that is a good thing
because that requires me to include the header in every single template I
create. What I have is one general template that contains header, footer and
everything else, plus the middle content area that I manipulate. So, I am
faced with either manually including the header in every single template I
create, or not setting the title in the view. Both of which are not
accepted.
(One could argue that you can register a php function in smarty, and use it
in order to set page titles. That is clean MVC and it works, but I was
hoping to see other alternatives)Soosa: Yes, building it is a necessary step towards understanding it. To skip an entirely long and futile debate, let's assume that my answer is "Because I want to". I base my judgement on this factor: Does the framework aggresively force me to separate into true MVC? If not then it's a crap framework. If I can set internationalization strings in the model, If I can set page titles in the controller, or If I can call model functions from the view, the framework is crap. It should enforce clean MVC by preventing me from falling into pitfalls where possible. On Sat, Jun 28, 2008 at 10:15 PM, soosa <[EMAIL PROTECTED]> wrote: > > > On Sat, Jun 28, 2008 at 9:23 AM, Al-Faisal El-Dajani < > [EMAIL PROTECTED]> wrote: > >> Ammar: Yes smarty solves a great deal of it, but it doesn't help me in >> presenting different output formats. For instance, posts.php can be done >> using smarty, but can I present posts.rss through it as well? What about CLI >> compatible output? >> >> Soosa: Well, the idea is to build one, > > Why you want to build one while you can use a solid and powerful platform > which is already pre-built and tested and you may use it in which ever > format you want, this is a case where re-enventing the wheel is valid! > > >> in order to fully understand MVC. > > And who said that if you used a pre-built framework you won't be able to > understand MVC?!! while i really doubt that understanding the MVC > methodology in solving programming problems would rquire building a > framework from scratch! the general idea is to seperate buissniss logic, > data management, and presentation layers from each other, do you really want > to build your own framework in order to uderstand this while you can figure > it out without building it from scratch and use one from the available > platforms out there?!! > > >> And by the way, most frameworks do not have any idea what MVC is. > > How come this is a valid judgment?!!!! > > >> Heard a lot of good words about Agavi in that regard. > > yet a lot of more, > http://en.wikipedia.org/wiki/List_of_web_application_frameworks > >> >> >> On Sat, Jun 28, 2008 at 4:12 PM, soosa <[EMAIL PROTECTED]> wrote: >> >>> Why not considering using an MVC framework?!!, there are a lot of solid >>> and powerful yet simple to learn and use out there, Zend Framework, >>> Simphony, Solar, CakePHP, and a lot of more! >>> >>> >>> On Sat, Jun 28, 2008 at 3:35 PM, Ammar Ibrahim <[EMAIL PROTECTED]> >>> wrote: >>> >>>> >>>> Smarty? >>>> >>>> On Sat, Jun 28, 2008 at 3:25 PM, Al-Faisal El-Dajani >>>> <[EMAIL PROTECTED]> wrote: >>>> > Hey all, >>>> > >>>> > This is driving me crazy... Has anyone here managed to make a true MVC >>>> > separation without ending up with a fsck'd up mess of PHP and HTML in >>>> the >>>> > view? i18n, templating, and different output formats should be >>>> considered. >>>> > >>>> > I managed to understand what the controller and the model are for, and >>>> how >>>> > to use them. But for the life of me I can't figure out how to do the >>>> view. I >>>> > am more than sure that it is far simpler than what i'm thinking, but >>>> so far >>>> > I can't seem to find a way to go about it. >>>> > >>>> > Also any points that can be given about how to cache aggressively >>>> would be >>>> > appreciated. >>>> > >>>> > -- >>>> > Al-Faisal El-Dajani >>>> > Phone: +962-7-79737050 >>>> > P.O Box: 140056 >>>> > 11814 Amman, Jordan >>>> > > >>>> > >>>> >>>> >>>> >>> >>> >>> >> >> >> -- >> Al-Faisal El-Dajani >> Phone: +962-7-79737050 >> P.O Box: 140056 >> 11814 Amman, Jordan >> >> > > > > -- Al-Faisal El-Dajani Phone: +962-7-79737050 P.O Box: 140056 11814 Amman, Jordan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Jordan PHP Users Group" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/JoPHP http://Jolug.org/ -~----------~----~----~----~------~----~------~--~---
