Jump to content

Please dump Smarty, is that blasphemous?


MrBaseball34

Recommended Posts

  • 1 year later...
I'm 100% in agreement with this.

 

Maybe the initial decision had to do with the idea that this might add a layer of security (malformed or malicious theme code perhaps)?  In my experience smarty gives us a sort of half-baked namespace where we can't rely on a single set of debugging tools, every variable must be declared twice, and then passed back and forth, the templates end up looking uglier then they would have if they were just php/html, all of the aptly named php functions and structures have doppelgangers, and the poor developer feels the urge to gouge his eyes out if he wants to or is asked to make a structural change to the design of ps.  I consider smarty to be an anti-pattern, named language within a language.

 

I'm currently debugging php with php-storm and x-debug.  That works great for php.  but if I want to follow a variable through smarty all I have is d() p() fd()... or {debug}  ie expel a thousand variables to output (thank you for fd() btw).  basically all variations of echo.  Is there a way to properly debug in smarty?

 

Smarty touts itself as being a boon to the design process.  I sincerely hope that it wasn't chosen for the idea that it was going to make things easier for designers.  The designers I work with consider html code, they smile at me and say "one day i'm going to learn how to program html" and then I laugh, and then I cry.  My point is that many designers wont touch the code base.  They expect someone like me to implement their gradients.  They draw it, I integrate it.  Someone like me can easily tell the difference between an html tag and a php block.

 

Ditching smarty doesn't mean ditching templating.  It really just means ditching an additional layer.  we can still have templating without smarty.  Just look at Wordpress, the poster-child of a successful theme marketplace.  Wordpress uses vanilla php/hml templates, and it's simple.  Likely the success of Wordpress is the ease with which it can be themed and modified; and has been.  Granted blog software has a smaller set of requirements.

 

I'd ask to take out bootstrap while your at it.  Bootstrap is cool, for today... tomorrow.  Really what would make ps awesome would be a default template that has as little technology dependency as possible.  Really that's what attracted me to ps in the first place.  Was that it was simple enough to start hacking without much effort.  The more that gets added to the default front end the more expensive it becomes to modify and maintain, the less I want to use or recommend it.  Maintenance and dependency are obviously huge concerns.  Prestashop would really benefit from at least two themes.  A boilerplate for developers who are interested in deploying mid scale solutions.  And a show-case theme that can help it sell to the boutiques.

 

However, I understand that a second theme is a lot to ask for at this point in time.

  • Like 1
Link to comment
Share on other sites

We can argue regarding if it is best. There are better and more convenient and faster solutions which are implemented in Symfony framework. However, dropping Smarty is pretty much impossible unless jumping straight to 2.0 version and have two very separate versions. Something similar was done with Drupal.

However, there are bigger architecture problems in PrestaShop especially, how they handle database tables etc.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...