Download the PHP package crobays/asset without Composer

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

Crobays / Asset

Simple asset helper to get asset (image, picture, stylesheet, script) elements or urls. Images and pictures have an option to resized and/or cropped dynamically.

Require

"crobays/asset": "dev-master"

Usage

php artisan config:publish crobays/asset creates a config file in your Lavavel project: app/packages/crobays/asset/config.php

Images

Asset::img('my-image.png', ['w' => 400])

grabs images/my-image.png to fit width 400px, saves it to img/my-image___w400.png (also create a @2x version for hi-dpi displays, you need to include retina.js to use this functionality) and returns

<img width="400" src="//assets.example.com/img/my-image___w400.png" 
    data-src2x="//assets.example.com/img/[email protected]">

Resize and crop the image by providing both width and height

Asset::img('my-image.png', ['w' => 250, 'h' => 250])

grabs images/my-image.png to fit width 250px and height 250px, saves it to img/my-image___w250-h250.png and returns

<img width="250" height="250" src="//assets.example.com/img/my-image___w250-h250.png" 
    data-src2x="//assets.example.com/img/[email protected]">

Provide a size (sizes defined in app/packages/crobays/asset/config.php)

Asset::img('my-image.png', ['s' => 'xlarge'])

makes image and returns

<img width="960" src="//assets.example.com/img/my-image___w960.png" 
    data-src2x="//assets.example.com/img/[email protected]">

Provide a special 100% size (defined in the app/packages/crobays/asset/config.php)

Asset::img('my-image.png', ['s' => '100%'])

makes image and returns

<img width="100%" src="//assets.example.com/img/my-image___w800.png" 
    data-src2x="//assets.example.com/img/[email protected]">

It allows you to add custom HTML attributes

Asset::img('my-image.png', ['w' => 300, 'class' => 'image'])

makes image and returns

<img width="250" class="image" src="//assets.example.com/img/my-image___w300.png" 
    data-src2x="//assets.example.com/img/[email protected]">

Pictures

Asset::pic('picture.jpg', ['w' => 1440])

grabs pictures/picture.jpg to fit width 1440px, saves it to pictures/picture___w1440.jpg (also create a @2x version for hi-dpi displays, you need to include retina.js to use this functionality) and returns

<img width="1440" src="//assets.example.com/pic/picture___w1440.jpg" 
    data-src2x="//assets.example.com/pic/[email protected]">

(Inherits also all image functionalty found above)


CSS

(default stylesheet defined in the app/packages/crobays/asset/config.php)

Asset::css()
Asset::css('another-style.css')

returns

<link type="text/css" href="//assets.example.com/style.css" rel="stylesheet">
<link type="text/css" href="//assets.example.com/another-style.css" rel="stylesheet">

Javascript

(default script defined in the app/packages/crobays/asset/config.php)

Asset::js()
Asset::js('another-script.js')

returns

<script type="text/javascript" src="//assets.example.com/script.js"></script>
<script type="text/javascript" src="//assets.example.com/another-script.js"></script>

Todo


All versions of asset with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version 4.2.*
illuminate/config Version 4.2.*
intervention/image Version ~2.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 crobays/asset contains the following files

Loading the files please wait ....