Integration

Contents

Introduction

Before reading this section, please read the installation and configuration instructions and make sure that the examples located in the "_samples" directory are working correctly.

The "_samples" directory with examples contains two directories: "js" and "php".

  • The "js" folder stores examples of launching CKFinder using the JavaScript code.
  • The "php" folder stores examples of launching CKFinder using the PHP language.

The following files are used when either javascript or PHP method of launching CKFinder is used:

  • ckfinder.js in case of JavaScript integration method,
  • ckfinder_v1.js in case of JavaScript V1 integration method (useful when migrating from CKFinder 1.x),
  • ckfinder.php in case of PHP integration method.

Example

To launch CKFinder, basically we need to do three things:

  • Create an instance of a CKFinder class.
  • Assign CKFinder properties.
  • Call the Create method.

The example of creating CKFinder using a PHP class:

<?php
$finder = new CKFinder() ;
$finder->BasePath = '/ckfinder/' ;
$finder->SelectFunction = 'ShowFileInfo' ;
$finder->Width = 800 ;
$finder->Create() ;
?>

For a full working examples please refer to the "_samples" directory.

Integration methods

  • JavaScript integration - The preferred method of integration, simple, yet powerful.
  • JavaScript integration (V1) - The old "V1" way, useful when migrating from CKFinder 1.x because it is possible to reuse the old code.
  • PHP integration - If you haven't worked with JavaScript before or the JavaScript integration seems to be too complicated then it might be the way to go for you.
This page was last modified on 17 May 2010, at 10:16.