Download the PHP package kim/javascript without Composer

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

Use PHP in JavaScript For Laravel 5

This package allows you to simply convert and transfer your PHP variables to use in JavaScript.

This is a package I made for practice / fun. Please use Jeffrey Way's package instead.

Installation

Installing this package is very easy. Just follow a few quick steps.

Composer

Pull this package through composer by opening your composer.json file and adding this under require:

Afterward, run either composer update or composer install.

Providers and Aliases

Open up your config/app.php and add this to your providers array:

and this to your aliases array:

Config File

Finally, publish the package's config file by running this inside your favorite command-line interface:

This command will publish a javascript.php file inside your config directory.

Usage

Adding a single variable

To add or pass a single variable from PHP to JavaScript, you can use simple use the add method.

Now, you can access the name variable globally using JavaScript.

Notice that first value is the variable name. The second value is the variable's value. It follows a key-value pairing like an associative array.

Adding an array of values

You can also pass an array of values.

All these will then be accessible globally within your JavaScript files.

Multiple Calls

You do not need to call the add or put method in one location. You can call both methods multiple times across multiple files, and it will work just fine.

Duplicates

The package also makes sure that there are no duplicates so if you add an object in one class and then add it again in another class, it will not conflict. However, if the two values are different, the latest call will overwrite the preceding value.

Configuration

If you open up your config/javascript.php file, you will see two settings. By default, the JavaScript variables are added to the end of your HTML head. If you want to add it elsewhere, simply specify the view. It will automatically add the JavaScript variables to the start of that view.

You can also specify the namespace and reduce the number of objects / functions that are added to the global scope. If you do change the namespace, remember to reflect that in your JavaScript code. For example, lets say you set the namespace to 'parent'.

License

This package is free software distributed under the terms of the MIT license.


All versions of javascript with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ~5.0
php Version >=5.4.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 kim/javascript contains the following files

Loading the files please wait ....