Download the PHP package thelia/backoffice-default-twig-template without Composer

On this page you can find all versions of the php package thelia/backoffice-default-twig-template. 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 backoffice-default-twig-template

Thelia back-office — Twig template (default-twig)

Modern Bootstrap 5 / Twig / Stimulus port of the legacy Smarty back-office. Lives side by side with templates/backOffice/default/ during the transition.

Activation

URL: https://thelia-3.ddev.site/admin

Architecture

Stack

Working on the back-office

Local dev

Adding a new admin domain

The proven recipe (Folder → Content → CustomerTitle → Country → State → Newsletter → Message):

  1. Formsrc/Form/<Group>/<Name>Type.php: final class extends AbstractType, options include_id / include_description.
  2. Controllersrc/Controller/<Group>/<Name>Controller.php: #[Route('/admin/...', name: 'admin.X.')]. Inject AdminFormAction, AdminAccessChecker, Environment, FormFactoryInterface, UrlGeneratorInterface, TokenProvider, TranslatorInterface.
  3. Methodslist() (GET), create() (POST), updateView({id}) (GET), processUpdate() (POST), delete() (POST/GET), updatePosition() (POST/GET).
  4. Events — use $this->action->submit(form: ..., eventFactory: ..., eventName: TheliaEvents::X_CREATE) for forms; $this->action->tokenAction(event: ..., eventName: ...) for single-shot actions.
  5. Templateslist.html.twig (DataTable + create modal), edit.html.twig (form_start + form_end).

ACL

Resources live in core/lib/Thelia/Core/Security/Resource/AdminResources.php. Check with is_granted('VIEW', 'admin.foo') or $this->access->check(self::RESOURCE, [], AccessManager::VIEW).

Hooks (back-office)

Twig functions exposed by BackOfficeDefaultTwigBundle\Twig\HookExtension:

Most hook names are kept iso with the legacy Smarty template. The few that were renamed are bridged to their legacy name (see Cohabitation & breaking changes), so third-party modules keep working unchanged.

Hook contract for third-party modules

The back-office emits ~200 native hooks. The conventional extension points a module can rely on are emitted systematically:

Convention Emitted from Example
<screen>.top / .bottom every screen attributes.top, product-edit.bottom
<entities>.table-header / .table-row BoDataTable (every list) attributes.table-row
<entity>.create-form BoCreateDialog (derived from testid) brand.create-form
<entity>.delete-form BoConfirmDialog (derived from testid) brand.delete-form
<entity>.update-form edit screens feature.update-form
<entity>.tab / .tab-content tabbed edit screens product.tab

Hooks consumed by bundled modules (CustomerFamily, SEOne, HookAdminHome, VirtualProductControl, TheliaBlocks) are all wired. A hook code that is not emitted is considered deprecated for the Twig back-office — open an issue if your module needs one that is missing. The <screen>.js / <entity>.edit-js script hooks are emitted on a per-screen basis as screens are migrated.

Tests

Cohabitation & breaking changes

This template runs side by side with the legacy Smarty back-office. A few names diverge from the legacy ones; here is how third-party modules are affected.

Hooks — bridged, no change required

Renamed hooks are replayed under their legacy Smarty name by Service\Hook\LegacyHookAliases (wired into HookExtension), so a module listening on the old name keeps contributing. Render arguments follow the new (Twig) convention — adapt listeners that read a renamed argument.

Legacy Smarty hook Twig hook
attribute-edit-form.bottom attribute.update-form
feature-edit-form.bottom feature.update-form
administrator.update-form administrator.edit-form
advanced-configuration advanced-configuration.top

The wysiwyg.js hook on the hook-edit screen keeps its legacy wysiwyg-hook-edit-js location.

ACL — bridged

The advanced-configuration screen accepts both the new admin.configuration.advanced resource and the legacy admin.cache one, so existing profiles keep access without a data migration.

Routes — update your module

Renamed route names are not aliased. A module referencing an old name through path() / url() must update it:

Legacy route name Twig route name
admin.sale.reset admin.sale.reset-status
admin.configuration.order-status.* admin.order-status.*
admin.configuration.mailing-system.* admin.mailingSystem.*

The ACL resource for the mailing system stays admin.configuration.mailing-system.

License

LGPL-3.0+ — same as Thelia core.


All versions of backoffice-default-twig-template with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
symfony/framework-bundle Version ^7.4
symfony/twig-bundle Version ^7.4
symfony/webpack-encore-bundle Version ^2.1
symfony/stimulus-bundle Version ^2.19
symfony/ux-twig-component Version ^2.19
symfony/ux-icons Version ^2.21
thelia/twig-engine-module Version dev-twig
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 thelia/backoffice-default-twig-template contains the following files

Loading the files please wait ...