Download the PHP package goldnead/statamic-component without Composer

On this page you can find all versions of the php package goldnead/statamic-component. 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 statamic-component

Statamic Component

Statamic-Component is an addon to simplify the creation of separated components in Statamic that combines a bunch of logic like fieldsets & views.

This is for developers who love things DRY. The folder structure in Statamic is usually pretty simple to understand, but as soon a project grows, it can become a bit of a mess. With this addon you are able to group your component files into a single folder.

Features

The aim of this addon was to make statamic projects clearer and more organized. It does this by grouping all the files for a component into a single folder. This makes it easier to find and edit files for a component.

A Component-Folder can include:

Note: Stylesheets and Javascript files are not included by this addon as they are likely part of your own build process.

How to Install

You can search for this addon in the Tools > Addons section of the Statamic control panel and click install, or run the following command from your project root:

How to Use

Creating a Component

To create a component, simply create a folder in your resources/components folder. The name of the folder will be the name of the component.

Inside the folder, you can add any of the following files/folders:

Using a Component

To use a component, you can use the {{ component }} tag the same way as you would use the {{ partial }} tag. In fact, the {{ component }} tag is just an extension of the {{ partial }} tag:

Alternatively, you can use the {{ component }} tag with the src parameter:

Honeslty, that's all there is to it. You can use the {{ component }} tag just like you would use the {{ partial }} tag.

Configuration

Config File

You can publish the config file by running the following command from your project root:

This will create a statamic-component.php file in your config/Statamic folder. The config file contains the following options:

Fieldset Namespacing and Fieldset-Types

Namespacing

By default, fieldsets are namespaced to the component name. This means that if you have a component called audio-player and a fieldset called settings, the fieldset will be namespaced to audio-player.settings.

Fieldset-Types

Fieldset types are a way to use fieldsets danymically like you would inside of a Replicator or Bard set:

For example, if you have a component called Audio which has a fieldsets called track and playlist which are both tied to different views, you can use this approach to avoid polluting your templates with the logic of which views to connect to your views. You can configure this inside of your <Component-Name>.php file:

This way, you can define your article Fieldset/Blueprint like this:

Frontend Build

As stated before, this addon does not include any stylesheets or javascript build processes. This is because you are likely using your own build process.

However, here's a quick example of how you can use this addon to create a component with a stylesheet and javascript file with vite:

License

MIT License

Copyright (c) 2023 Goldnead

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


All versions of statamic-component 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 goldnead/statamic-component contains the following files

Loading the files please wait ....