Download the PHP package imponeer/smarty-sunrise-http-router without Composer

On this page you can find all versions of the php package imponeer/smarty-sunrise-http-router. 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 smarty-sunrise-http-router

Smarty Sunrise HTTP Router

This library exposes Sunrise HTTP Router named routes to Smarty through a {url} template function, allowing templates to generate links without hardcoding paths. It is designed for applications that keep routing logic in Sunrise HTTP Router and want those routes available directly inside Smarty views.

Installation

To install and use this package, we recommend to use Composer:

Otherwise, you need to include manually files from src/ directory.

Setup

Modern Smarty Extension (Recommended)

Register the extension with your Smarty instance and provide a configured router:

Using with Dependency Injection Containers

Symfony Container

PHP-DI Container

League Container

Usage

The {url} function renders a URL for a named route defined in Sunrise HTTP Router.

Generate a route URL

Passing route attributes

Handling missing attributes

If required route attributes are not provided or the route name does not exist, the router will throw an exception so you can catch and handle the error in your application.

Development

Code Quality Tools

Documentation

Routes are defined and built using Sunrise HTTP Router, and Smarty extension details are available in the Smarty documentation. Review those resources for deeper customization tips.

Contributing

Contributions are welcome! Here's how you can contribute:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin feature-name
  5. Submit a pull request

Please make sure your code follows the PSR-12 coding standard and include tests for any new features or bug fixes.

If you find a bug or have a feature request, please create an issue in the issue tracker.


All versions of smarty-sunrise-http-router with dependencies

PHP Build Version
Package Version
Requires imponeer/smarty-extensions-contracts Version ^3.0
php Version ^8.1
sunrise/http-router Version ^3
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 imponeer/smarty-sunrise-http-router contains the following files

Loading the files please wait ...