Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can Smarty 3 be Used with Zend Framework 2?

I used PHP5 a long time ago and am presently trying to refresh my knowledge and augment it with knowledge of Zend Framework 2 and Smarty 3 for a possible project.

I'm currently trying to figure out how to use Smarty 3 as a replacement/supplement to Zend Framework 2.

Everything I can find through Google on this topic either:

  1. Is outdated (e.g. Zend Framework 1)
  2. Assumes I have a more intimate working knowledge about both Zend and Smarty than I actually do.

Can someone please explain to me as though I were 9, using the Zend Skeleton Application as my starting point:

  1. In what directory/folder (using a fully qualified path), I should unzip the Smarty-3.1.12 package?

  2. What class(es) I need to create, what exactly do they need to contain, and where should they be stored?

  3. What files need to be modified, and how, to make Smarty available for viewing within my module(s)?

  4. With reference to the above created classes, how can/should these be used from A-Z (e.g. including within appropriate classes, assigning values, creating outputs)?

like image 891
Brian Kessler Avatar asked Nov 12 '12 13:11

Brian Kessler


People also ask

Which command is used to install Zend Framework 2?

The command: composer create-project -n -sdev zendframework/skeleton-application path/to/install always create a ZendFramework 3 app is their is a command to create a project of zendfrmaework 2.

What happened Zend Framework?

Zend Framework is now called Laminas. Apigility is now called Laminas API Tools. Expressive is now called Mezzio, which is a variation of the Italian word for middle.

How do I run Zend Framework on localhost?

Make sure that you update your /etc/hosts or c:\windows\system32\drivers\etc\hosts file so that zf2-tutorial. localhost is mapped to 127.0. 0.1. The website can then be accessed using http://zf2-tutorial.localhost.

What is bootstrap in Zend?

In Zend Framework, bootstrapping is the process that loads your application. This includes, but is not limited to the Session. You can create many private methods inside the Bootstrap Class. All all method names starting with _init prefix will be executed once before the application starts.


1 Answers

There is quite good module SmartyModule

Definitely use composer to install it, it makes your life much easier :-)

And sample application

like image 146
Zdenek Machek Avatar answered Sep 30 '22 01:09

Zdenek Machek