Download the PHP package vierwd/typo3-smarty without Composer

On this page you can find all versions of the php package vierwd/typo3-smarty. 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 typo3-smarty

TYPO3 Smarty Extension Build Status

Use Smarty in your templates and extbase extensions.

Installation

Install using composer:

Usage in controllers

To use smarty templates for your extension's actions, just extend the Vierwd\VierwdSmarty\Controller\ActionController. Your templates need to be at the same location as your Fluid templates used to be, but with the file extension .tpl.

Example

Pre-defined variables

There are some variables, that are always available to your templates:

Variable Name Contents
cObj The current ContentObject (instance of TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer)
extensionPath The path to your extension (typo3conf/ext/example_blog/)
extensionName ExampleBlog
pluginName Pi1 (or whatever you defined in ext_tables.php)
controllerName Blog
actionName list
context The controllerContext (instance of TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext)
request The current request (instance of TYPO3\CMS\Extbase\MvcRequest)
formPrefix Prefix form fields need as name to automatically map form fields to arguments
settings Flexform settings for the plugin
frameworkSettings TypoScript settings for plugin.tx_exampleblog
typolinkService An instance of TYPO3\CMS\Frontend\Service\TypoLinkCodecService
TSFE $TSFE (instance of TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController)

Pre-defined smarty functions, blocks and modifiers

Power-Blocks: typoscript and fluid

What's realy good about this extension is, that you can still use typoscript and fluid within your Smarty templates. That way you can ensure, that an element gets exactly the same HTML output as a normal content element like Text-with-images. If you write a form, it's also good to fallback to Fluid for some ViewHelpers.

Typoscript

Output (Line-breaks added)

The changes to the typoscript will not persist. That way you can remove lib.parseFunc_RTE in one TypoScript Block and still use it in another. It is also possible to use an array data for all arguments:

Notice, that parameters in the block-tag override array keys (in this example header_layout):

Output (Line-breaks added)

Using Smarty for the base template

It is also possible to use Smarty for the base template of your website in your main TypoScript setup

All entries in settings.typoscript will be parsed and will be available as variables in your template.

Note the nofilter argument for Smarty. By default all variables will be escaped to prevent some XSS attacks.

Using Smarty for Menus

This code block will load the templates at typo3conf/ext/vierwd_example/Resources/Private/Templates/Navigation/ to render the navigation. Within the template you can iterate over your menu items and output the menu:


All versions of typo3-smarty with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
smarty/smarty Version ^3.1, !=3.1.30
typo3/cms-core Version ^10.4.0
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 vierwd/typo3-smarty contains the following files

Loading the files please wait ....