Download the PHP package sledgehammer/mvc without Composer

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

Sledgehammer MVC

MVC aka Model View Controller

Model

These are the classes you'll write yourself. If your looking for database persistance for your models check out the Sledgehammer ORM module.

View

The "View" is a composition of components.

Every component has a "render" function which sends the output directly to the browser (echo) and doesn't have a return value.

Component->getHeaders()

A Component has an optional getHeaders() function, which is called before render() and passes info to the components higher in the component hierarchy. This can add "HTTP headers", append stylesheets and other configuration that must be injected into the <head>

'http' This is an array that will be sent with the header() function. 'meta' This is an array that is added as <meta> tag(s) in the <head> 'css' This is an array with urls that are added as <link type="text/css"> in the <head> 'link' This is an array that is added as <link> tag(s) in the <head> 'title' This is the <title> that is placed in the <head>

Controller

Sledgehammer doesn't have a Routing class, all requests are handled by a subclass of Folder classes.

Mapping examples:

The "/about.html" url is mapped to MyWebsite->about(). If no public about method is found the file() method is called. By default the file() returns an component that renders a 404 error.

The "/blog/author.html" is mapped to MyWebsite->blog_folder(). if no public blog method is found the folder() method is called.

The blog_folder() could directly return a compontent, but it could also create a Folder object which would handle all request inside the "blog/" folder. The "author.html" part of url is mapped to MyBlogFolder->author(). If no public author method is found the file() method is called on the MyBlogFolder.

Website scope

Complete handling of requests.

Sending to browser Saving to disk

HtmlDocument scope

Processing the values of getHeaders() in the doctype template.

Installation

Place the mvc folder in the same folder as Sledgehammer's core folder.

To generate a scaffolding for an MVC project, run

Twitter Bootstrap

Contrains all the css & javascript from: http://twitter.github.com/bootstrap/ and adds Sledgehammer\View classes.

Becomes:


All versions of mvc with dependencies

PHP Build Version
Package Version
Requires sledgehammer/core Version dev-master
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 sledgehammer/mvc contains the following files

Loading the files please wait ...