WebForms.PHP - is an unfinished (forever) engine web forms for PHP

Download v3.1

What it is?

This project is an attempt embodiment ASP.NET WebForms in PHP.

Today WebForms.PHP - this template engine, HTML components and the beginnings of Framework for web sites creation in PHP.

Why is not completed?

It was decided to abandon PHP to ASP.NET, and there was no more need for the development of this project.

But this does not mean that PHP is a bad language. PHP has its own characteristics and advantages, but in .NET is better implemented the principles of OOP (Object-oriented programming), which allows to create more complex projects.

This engine can be used?

At your own risk, it can be used in small projects or educational purposes.

The current version has been used only for technical projects: Control and Admin Panels.

Please note that the author will not develop the project and will not provide technical support.


Features


How it works?

Formula

Getting started


1 To start using the engine, download and unpack the source code archive. The engine is in the /Nemiro folder. Place this folder in the root of your site. Change the directory name is not recommended because in the code are hard links to the files in that folder.

2 Place in the site root two files: config.php и global.php. You can take a sample of the config.sample.php and global.sample.php from the /Nemiro folder.

Make the desired configuration options in the config.php.

<?php
# page caching (true|false)
define('PAGE_DEFAULT_CACHE', false);
# HTML compression (true|false)
define('PAGE_COMPRESS_HTML', false);
# enable debug mode (true|false)
define('DEBUG_MODE', true);
# the path to the site root
define('MAIN_PATH', $_SERVER['DOCUMENT_ROOT']);
# the file path of the default template
define('PAGE_DEFAULT_TEMPLATE', '~/Layouts/_Layout.php');
# the title of pages by default
define('PAGE_DEFAULT_TITLE', 'Name your site here');
# the default encoding
define('PAGE_DEFAULT_ENCODE', 'utf-8');
# meta tags
define('META_DESCRIPTION', 'Description of your site here');
define('META_KEYWORDS', 'Keywords of your site here');
define('META_AUTHOR', 'Author name here');
define('META_URL', 'http://example.org');
define('META_ROBOTS', 'ALL');
?>

3 Create a template file that you specified in the parameter PAGE_DEFAULT_TEMPLATE.

Template - the HTML file with the special labels for content. In the following example, in the template defined two blocks of content (two markers): <php:Head/> and <php:MainContent/>. Words Head and MainContent - identifiers of the content blocks. You can use any names, but only english letters and numbers, no special signs. Blocks of content can be any number.

<!DOCTYPE html>
<html>
  <head>
    <title></title>
    <meta name="viewport" content="width=device-width" />
    <link rel="stylesheet" href="/Content/css/bootstrap.min.css" />
    <script src="/Scripts/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script src="/Scripts/bootstrap.min.js" type="text/javascript"></script>
    <php:Head/>
  </head>
  <body>
    <div class="container">
      <php:MainContent/>
    </div>
  </body>
</html>

4 Create a content page. For example: index.php. Specify content for the necessary blocks of content (not necessarily for all). Do not forget to include the global.php: require_once 'global.php'; and start the magic: Nemiro\App::Magic();.

<php:Content ID="Head">
  <script src="/Scripts/jquery-1.11.1.min.js"></script>
</php:Content>

<php:Content ID="MainContent">
  <h2>Hello world!</h2>
</php:Content>

<?php 
require_once 'global.php';
Nemiro\App::Magic();
?>

5 Enjoy! (or debugging :-) ...)