Download the PHP package drmabuse/yii2-sir-trevor-js without Composer

On this page you can find all versions of the php package drmabuse/yii2-sir-trevor-js. 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 yii2-sir-trevor-js

yii2-sir-trevor-js

Latest Stable Version Total Downloads Latest Unstable Version License

Version 0.0.5

a sir-trevor-js module

Sir Trevor in action

Browser support

Sir Trevor is only tested on the following modern browsers:

Dependencies

Sir Trevor requires Underscore (or LoDash), jQuery (or Zepto) and Eventable.

Contributing

See the roadmap and read a little about the philosophy guiding development.

Todo

1. create output from Input

Get Started

Installation using composer:

composer install drmabuse/yii2-sir-trevor-js:"*"

Basic Usage

<?=
$form->field(
    $model,
    'attributeName')->widget(\drmabuse\sirtrevorjs\SirTrevorWidget::className(),
    [
        'imageUploadUrl' => \yii\helpers\Url::to(['file/sir-trevor-upload']),
        'language'      => 'de',//es,fi,pt,fr,de,cn,
        'assetMode'     => 'min'//dev,
        'element'       => '.sir-trevor'// wil add to the textarea,
        'initJs'        => 'SirTrevor....'//PLZ read before Sir Trevor Api
        'options'       => ['class' => 'mysexyTextarea'],
        'blockOptions'  => Json::encode(
             [
                'el'          => new JsExpression("$('.sir-trevor')"),
                'blockTypes'  => [
                     "Heading",
                     "Text",
                     "List",
                     "Quote",
                     "Image",
                     "Video",
                     "Tweet",
                     "Columns",
                     "Code",
                     "Gallery"
                 ],
                'defaultType' => false
            ]
        )
    ]   
)
?>
//Output

<?= $converter->toHtml($json) ?>

Advanced Usage

Image Block - Example File Upload Handler

/**
     * Action for file uploads via sir-trevor image block from SirTrevorWidget (input widget)
     *
     * @param $root relative base folder
     */
    public function actionSirTrevorUpload($root)
    {
        $upload         = UploadedFile::getInstanceByName('attachment[file]');
        $model          = new File();
        $name_id        = Inflector::slug(str_replace($upload->extension, '', $upload->name));
        $model->path    = 'images/' . $root . '/' . $model->name_id . '.' . $upload->extension;
        $savePath       = \Yii::getAlias('@backend/web') . '/' . $model->path;

        $response = new Response();
        $response->format = Response::FORMAT_JSON;
        $response->data['message'] = "File";

        if (!is_file($savePath) && is_dir(dirname($savePath))) {
            if ($upload->saveAs($model->path)) {
                $model->mime_type = FileHelper::getMimeType($model->path);
                $model->file_size = $upload->size;
                if ($model->save()) {
                    $items = $this->getItems($this->rootPath);
                    list($width, $height, $type, $attr) = getimagesize($model->path);
                    $response->setStatusCode(200);
                    $response->content = Json::encode(['file' => ['url' => $model->path]]);
                    \Yii::$app->end(0, $response);
                } else {
                    $response->statusText = "Database record could not be saved.";
                }
            } else {
                $response->statusText = "File could not be saved.";
            }
        }else{
            $response->statusText = "File exists or root folder '{$savePath}' not found.";
        }

        $response->setStatusCode(500);
        \Yii::$app->end(0, $response);

    }

Developer Info

If you want to compile/build from the latest javascript sources, use the following commands to get the JavaScript dependencies.

npm update
bower update

To create the asset files run

grunt default

To create a new version

grunt bumpup
grunt semantic

All versions of yii2-sir-trevor-js with dependencies

PHP Build Version
Package Version
Requires yiisoft/yii2 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 drmabuse/yii2-sir-trevor-js contains the following files

Loading the files please wait ....