GitXplorerGitXplorer
l

middleman-php

public
35 stars
9 forks
3 issues

Commits

List of commits on branch master.
Unverified
140718250630adf7785787608b1ad93148d0e275

Set the session_id to a fixed value to emulate a shared session between different PHP calls.

mmcavallo committed 9 years ago
Unverified
c698d90448276fb7b0510539629445e8b2509624

Add parentheses to methods with arguments

mmcavallo committed 9 years ago
Unverified
aed83d8a52a2730b7765006dab820c53e5a78038

Add .editorconfig file.

mmcavallo committed 9 years ago
Unverified
d840785050363741e2a8ece08976a3e9d86d6e82

Merge pull request #15 from mcavallo/options

mmcavallo committed 9 years ago
Unverified
04abffb4a3a48a61101f2fd7ae69b840c950847d

Add license file and edit readme.

mmcavallo committed 9 years ago
Unverified
532ecd36223b4e2de491cff17c4c00b8a5dbf3f0

Define show_debug as an option and update readme with instructions.

mmcavallo committed 9 years ago

README

The README file for this repository.

middleman-php

middleman-php allows Middleman to execute PHP scripts. So your source/kittens.php file will actually render kittens, and not a mess of <?php open tags.

Sometimes I have clients who want little bits of PHP interactivity on their site, but I still want to use Middleman to generate the PHP pages. This makes it so you don't have to middleman build and then upload to your site just to get a preview.

Gem Version

Installation

Add the extension to your Gemfile:

gem 'middleman-php'

And then run:

bundle install

Configuration

You can activate the extension by adding the following to your config.rb file:

configure :development do
  activate :php
end

If you want the PHP to be parsed on builds too (as opposed to raw PHP generated for a server to run), just omit the configure block:

activate :php

Here is the list of settings with the default values:

activate :php do |config|
  config.show_debug = false # Output debug info to console
end

How does it work?

The PHP code will be executed only on pages where the URL ends in .php so if you want to see index.php, you'll have to actually stick index.php in your browser.

It will however, let you do fancy stuff like files ending in .php.erb... so your ERB can generate some PHP output.

Bug Reports

There are probably also bugs I haven't found, so if you find one, feel free to submit an issue!

License

Copyright (c) 2014-2015 Robert Lord. MIT Licensed, see LICENSE for details.