Download the PHP package josegonzalez/cakephp-wysiwyg without Composer

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

Build Status Coverage Status Total Downloads Latest Stable Version Documentation Status Gratipay

Wysiwyg Helpers Plugin 2.0

Include Wysiwyg Editors quickly and easily

Background

I've been on a small refactoring spree as part of my work on Marcy Avenue. I realize, after years of working with Joomla and Wordpress, that people prefer different WYSIWYG editors. So to alleviate this, I am attempting to build a set of CakePHP helpers for each of the major WYSIWYG editors on the market, and as many small ones as possible.

The plugin also allows you to automatically change from one WYSIWYG Editor to another when using the WysiwygHelper and configuring it in the controller. You may also change the Editor within the view.

Requirements

Installation

Download the JS distribution of your editor of choice and install it in your js folder.

[Using Composer]

Add the plugin to your project's composer.json - something like this:

{
    "require": {
        "josegonzalez/cakephp-wysiwyg": "dev-master"
    }
}

Because this plugin has the type cakephp-plugin set in it's own composer.json, composer knows to install it inside your /Plugins directory, rather than in the usual vendors file. It is recommended that you add /Plugins/Upload to your .gitignore file. (Why? read this.)

[Manual]

[GIT Submodule]

In your app directory type:

git submodule add git://github.com/josegonzalez/cakephp-wysiwyg-helper.git Plugin/Wysiwyg
git submodule init
git submodule update

[GIT Clone]

In your plugin directory type

git clone git://github.com/josegonzalez/cakephp-wysiwyg-helper.git Wysiwyg

Enable plugin

In 2.0 you need to enable the plugin your app/Config/bootstrap.php file:

CakePlugin::load('Wysiwyg');

If you are already using CakePlugin::loadAll();, then this is not necessary.

Usage

Available Helpers

The default editor is Tinymce

To use any of these helpers, you should create a folder in the web/js folder which is named the lowercase version of your editor of choice. This folder should contain the entire distribution of files necessary for your editor to be in use. For example, the NiceditHelper requires the web/js/nicedit/nicEdit.js and web/js/nicedit/nicEditorIcons.gif files.

To configure where these files exist, please see the helper code.

Using the Generic WyswigHelper

Add the following to the controller where you'd like to use your preferred editor. You can omit the parameters if you like, the default editor is tinymce:

public $helpers = array('Wysiwyg.Wysiwyg' => array('editor' => 'Ck'));

Replace your textarea inputs with either of the following:

echo $this->Wysiwyg->input('ModelName.fieldName', $inputOptions, $helperOptions);
echo $this->Wysiwyg->textarea('ModelName.fieldName', $inputOptions, $helperOptions);

Array Options for the FormHelper are contained in the second parameter, while the third parameter contains and array of options for the editor

You can also change the editor within the view. Changes come into affect for the proceeding editor:

$this->Wysiwyg->changeEditor('Nicedit', $helperOptions);

At this point, everything should theoretically work.

Other Helpers

If hardcoding your editor, you can do the following in your Controller:

<?php
class AppController extends Controller {

  public $helpers = array('Wysiwyg.Nicedit');

}

Then usage in your views is as follows:

echo $this->Nicedit->input("ModelName.fieldName");

echo $this->Nicedit->textarea("ModelName.fieldName");

Settings

Most editors take a javascript object as settings. The WysiwygHelper allows you to specify optional settings in three ways.

Special settings

The following are special settings that are used internally by the Wysiwyg plugin

These will be ignored when passing settings onto the wysiwyg javascript you are configuring.

Via Controller Setup

This mode results in all non-special settings being set as defaults for every instantiation of the Wysiwyg editor areas.

<?php
class AppController extends Controller {
    public $helpers = array(
        'Wysiwyg.Wysiwyg' => array(
            '_editor' => 'Tinymce',
            'theme_advanced_toolbar_align' => 'right',
        )
    );
}

Via ->changeEditor()

The second argument on Wysiwyg->changeEditor() can also be used to completely override any already set defaults:

echo $this->Wysiwyg->changeEditor('Tinymce', $helperOptions);

Via ->updateSettings()

A call ->updateSettings() can be used to completely override any already set defaults:

echo $this->Wysiwyg->updateSettings($helperOptions);

echo $this->Tinymce->updateSettings($helperOptions);

You can also retrieve currently set editor settings by calling ->getSettings():

$settings = $this->Wysiwyg->getSettings();

Via Helper Call

Both ->input() and ->textarea() calls accept a third argument array, $helperOptions, which may be used to configure the helper. These are merged onto any defaults that have been specified:

echo $this->Wysiwyg->input('Post.body', $inputOptions, $helperOptions);

echo $this->Wysiwyg->textarea('Post.body', $inputOptions, $helperOptions);

TODO:

License

The MIT License (MIT)

Copyright (c) 2009 Jose Diaz-Gonzalez

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


All versions of cakephp-wysiwyg with dependencies

PHP Build Version
Package Version
Requires composer/installers Version *
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 josegonzalez/cakephp-wysiwyg contains the following files

Loading the files please wait ....