Download the PHP package openbuildings/jam-resource without Composer

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

Resource Jam module for Kohana 3.3

Resources act as a bridge between routes, models and requests.

The jam-resource module works with the mighty Jam ORM for Kohana 3.3

Main Features

Defining resources

The simplest way to define a resource:

This would generate seven routes which would serve these purposes:

HTTP Verb path action used for
GET /users index display a list of all users
GET /users/new new return an HTML form for creating a new user
POST /users create create a new user
GET /users/1 show display a specific user
GET /users/1/edit edit return an HTML form for editing a user
PUT /users/1 update update a specific user
DELETE /users/1 destroy delete a specific user

As you can see every action has a very specific purpose. Something you might not be used to in the PHP world. Everything is derived from Ruby on Rails routing.


You can easily limit the creation of these default routes or add more:

Only specific routes

Default routes except some

Adding additional routes

This would make accessible the following URLs (in addition to the default ones):

Of course you can use these options together to define those routes your application would need.

The routes which a resource would generate are separated in member routes and collection routes. The collection routes do not have a specific id while the member routes are about a specific resource.


As said above the resources act as a glue between routes, models and controllers.

The model, the controller and the URI paths are derived from the resource name.

The users resource would guess the controller is Controller_Users and the model is Model_User.

You can easily specify these explicitly:

This would still create routes to access the photos on /photos and /photos/1. But it would use the actions in Controller_Pictures and the image model.

Changing the path string is achieved using the path option:

This would create routes for URIs like: /people, /people/1 etc. while still using the users controller and user model.

Accessing resources in controllers

When you visit /users the generated routes would open Controller_Users::action_index().

From there you would be able to access a Jam_Collections for the user model with:

$this->request->resource()->collection()

You could also access a Jam_Builder with:

$this->request->resource()->builder()


When you visit /users/1 the routes would open Controller_Users::action_show().

From there you could access the specified user model with:

$this->request->resource()->object()

There is no need to check if it is loaded. If there is no user model with the specified id Jam_Exception_Notfound would be thrown.

Generating URLs

You could also generate the resourceful URLs for a specific model or a collection.

Use the

Child resources

TODO: explain child resources - defining, usage and application

Singular resources

TODO: explain what singular resources are and how they should be used

Sluggable

You could use the sluggable (TRUE|FALSE) option and the slug_regex to set up the routes to use slugs instead of primary keys.

TODO: explain sluggable implementation here

Formats

TODO: explain formats here

LICENSE

© Copyright Despark Ltd. 2012

License


All versions of jam-resource with dependencies

PHP Build Version
Package Version
Requires openbuildings/jam Version ~0.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 openbuildings/jam-resource contains the following files

Loading the files please wait ....