<commit_before># Open Power Cake #

Open Power Cake is a plugin for [CakePHP] web framework, that allows to use [Open Power Template][OPT] system instead of built-in views.

## Requirements ##

1. CakePHP ([download page][CakePHPdownload])
2. Open Power Template library ([download page][OPTdownload])

Make sure to check Open Power Template requirements listed [here][OPTreqs].

## Installation ##

Change the current working directory to `vendors/` directory above Your `app/` directory, and download the source of a plugin using git:

    git clone git://github.com/dejw/opc.git OpenPowerCake

After this operations You should have directory structure similar to this:

    app/
       ...
    cake/
       ...
    vendors/
       js/
       css/
       shells/
       OpenPowerCake/
          libs/
          src/
          ...

Next copy whole Open Power Template `libs` directory into `vendors/OpenPowerCake/libs/`.

### Configuration ###

To make the new View class visible in Your application paste the line below at the top of Your `app_controller.php`:

    App::import('Vendor', "OpenPowerCake", array('file' => 'Plugin.php'));

Now You can use brand new Open Power Cake view the same as standard views in CakePHP. E.g. write:

    class AppController extends Controller {
        var $view = "Opc_";
        // ... rest of the code
    }

To enable Open Power Template in whole application. `Opc_` class behaves exactly the same as standard view classes so it can be turned on per-controller or per-action by writing:

    class MyController extends AppController {
        /* OPT will render templates for MyController */
        var $view = "Opc_";

        /* OPT will render templates only for someAction in MyController */
        function someAction(){
            $this->view = "Opc_";
        }
    }


Template files used by this plugin should end with `.tpl` extension.

## Basic usage ##

Open Power Cake uses template inheritance to render views. See [this section][OPTinheritance] for details.

### Helpers ###

Thanks OPT's extensibility Open Power Cake introduces some extra instructions, which adds some flavour to Your Cake.

#### opt:link_to ####
<commit_msg>Fixed typo.<commit_after># Open Power Cake #

Open Power Cake is a plugin for [CakePHP] web framework, that allows to use [Open Power Template][OPT] system instead of built-in views.

## Requirements ##

1. CakePHP ([download page][CakePHPdownload])
2. Open Power Template library ([download page][OPTdownload])

Make sure to check Open Power Template requirements listed [here][OPTreqs].

## Installation ##

Change the current working directory to `vendors/` directory above Your `app/` directory, and download the source of a plugin using git:

    git clone git://github.com/dejw/opc.git OpenPowerCake

After this operations You should have directory structure similar to this:

    app/
       ...
    cake/
       ...
    vendors/
       js/
       css/
       shells/
       OpenPowerCake/
          libs/
          src/
          ...

Next copy whole Open Power Template `libs` directory into `vendors/OpenPowerCake/libs/`.

### Configuration ###

To make the new View class visible in Your application paste the line below at the top of Your `app_controller.php`:

    App::import('Vendor', "OpenPowerCake", array('file' => 'Plugin.php'));

Now You can use brand new Open Power Cake view the same as standard views in CakePHP. E.g. write:

    class AppController extends Controller {
        var $view = "Opc_";
        // ... rest of the code
    }

To enable Open Power Template in whole application. `Opc_` class behaves exactly the same as standard view classes so it can be turned on per-controller or per-action by writing:

    class MyController extends AppController {
        /* OPT will render templates for MyController */
        var $view = "Opc_";

        /* OPT will render templates only for someAction in MyController */
        function someAction(){
            $this->view = "Opc_";
        }
    }


Template files used by this plugin should end with `.tpl` extension.

## Basic usage ##

Open Power Cake uses template inheritance to render views. See [this section][OPTinheritance] for details.

### Helpers ###

Thanks to OPT's extensibility Open Power Cake introduces some extra instructions, which adds some flavour to Your Cake.

#### opt:link_to ####

{'fraction_non_alphanumeric': 0.08837634163050925, 'fraction_numerical': 0.0009134505594884677, 'mean_word_length': 2.967391304347826, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2680634', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1145, 'n_words': 522}