Download the PHP package leafs/sitemap without Composer

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



Sitemap Generator

A simple and efficient sitemap generator for Leaf apps

Latest Stable Version Total Downloads License


Sitemap Generator

Sitemap Generator is a simple and efficient tool for generating sitemaps in Leaf PHP. It helps you create XML sitemaps quickly and easily, ensuring your website is properly indexed by search engines. It generates a real sitemap.xml file in the public directory of your Leaf application, which can be accessed by search engines to crawl your website effectively, and has support for custom datasources, allowing you to generate sitemaps from various data sources such as databases, APIs, or static files.

🚀 Installation

Using Leaf CLI (Recommended):

Using Composer:

Quick Start

Once installed, your sitemap will be automatically generated based on the routes defined in your Leaf application. You can customize the sitemap generation by adding a new datasource or by adding sitemap config options directly to your routes.

Regenerating Your Sitemap

Leaf automatically generates your sitemap when it doesn’t exist.

To regenerate your sitemap, you can:

Auto Sitemaps

Since sitemaps automatically use your Leaf routes, you can add some config options directly to your routes to customize how they appear in the sitemap. For example:

If you have a dynamic route like /blog/{slug}, you can also add the sitemap config to the route, you can tell the sitemap generator to replace the {slug} parameter with actual values from your model if you have one defined:

This is typically a faster way to generate sitemaps for dynamic routes, as you don't have to manually add a datasource and fetch the data yourself, the sitemap generator will handle it for you. So you will only need to manually add a datasource if you want to do more complex link generation like adding multiple URLs for the same route, or if you want to add URLs that are not defined as routes in your application.

Datasources

Your application may have dynamic routes, eg: /blog/{slug}. To include these routes in your sitemap, you can create a custom datasource that fetches the necessary data from your database and adds it to the sitemap. Here's an example of how to create a custom datasource for a blog:

You can also add multiple URLs at once:

This will map the /blog/{slug} to the actual URLs of your blog posts, and include additional metadata such as last modification date, change frequency, and priority.

Add URL

The examples above show how to map existing routes to actual URLs, but you can also add new URLs that are not defined as routes in your application:

This will add the specified URLs to the sitemap without replacing any existing routes.

You can also use add without being dynamic:

If you add a URL that already exists in the sitemap, it will be replaced with the new one. For example:


All versions of sitemap with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
leafs/fs Version *
leafs/anchor Version *
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 leafs/sitemap contains the following files

Loading the files please wait ...