Download the PHP package ryanknu/zendsmarty without Composer

On this page you can find all versions of the php package ryanknu/zendsmarty. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zendsmarty

Zend Smarty

A Smarty Module for Zend Framework 2. As of 0.3, it is now compatible with Zend Expressive as well, but your package must will require zendframework/zend-expressive-zendviewrenderer, or that you select Zend View Manager as your renderer during the Zend Expressive quick set up..

This package is designed to properly implement Smarty into the Zend Framework, unlike other approaches this one mimics the way ZF 2 works. It creates View Model, Strategy, and Renderers and provides factories to them.

Limitation

You need to change all of your template names in your module.config.php to point at .tpl files. The .tpl extension will trigger the Smarty view rendering strategy and everything will work as you want. Access to $this inside the smarty file is doable via {$renderer}. For example, <a href="{$renderer->url('object/edit', ['id' => 1234])}">.

Regular Smarty limitations apply, which makes it not always easy to change a phtml file to a tpl file. You can pass functions in and call them via {call_user_func...}, and you can pass in arrays but they must use square bracket syntax {if in_array(4, [1,2,3,4])}.

Instructions

  1. Get this package. You can get this package through composer now. Running composer require ryanknu/zendsmarty will download this package.
  2. Get Smarty. I do not bundle it as a dependency because I want to be compatible with any Smarty you want. Typing composer require smarty/smarty will get you the latest version.
  3. Set your strategies in your project configuration to point to ZSmarty. This will vary a little from project to project, but this is the best gist I can give oyu. This is as easy as setting the following line in a Zend Expressive configuration. (ZF 2.0 and older follow instructions below):

Instructions (OLD STYLE)

  1. Download the source of this, copy ZSmarty to Project/vendor/ZSmarty
  2. Add 'ZSmarty' to the module list in config/application.config.php
  3. Add "'Smarty' => 'ZSmarty\StrategyFactory'," to your module.config.php file's 'factories' section (make it so it can find the factory)
  4. Add "'strategies' => array('Smarty')" to your module.config.php file's 'view_manager' section
  5. Add 'use ZSmarty\SmartyModel;' to your controller's source file's use statements
  6. Use the SmartyModel the same way you would use a ViewModel object

All versions of zendsmarty with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ryanknu/zendsmarty contains the following files

Loading the files please wait ...