phundament API Manual

Version 2.1

yii framework API Manual

Version 1.1
Other documents

Installation phundament2 application (recommended)

1. Download & Extract

2. Run installer
$ ./yiic install
This will create config/local.php

3. Create a database, update credentials in config/local.php

4. Run
$ ./yiic install
Follow on-screen instructions ...

5. Open home URL.

Installation piimodule (stand-alone)

Note: You need at least yii rev. 1798!
Download yii (nightly snapshot) or get it from SVN.

Create a yii webapp

$ cd /to/your/localhost
$ /path/to/yii/framework/yiic webapp phundament2
Create a Web application under '/Users/tobias/Webserver/TESTING/phundament2'? [Yes|No] y

For more information on how to create a yii webapplication skeleton, see here.

Check back to your browser and see if you can open the yii app.
http://localhost/phundament2

Download

If everything works, download phundament and put it into the modules folder:
$ cd /path/to/localhost/phundament2/
$ cd protected/
$ mkdir modules
$ svn co https://phundament.svn.sourceforge.net/svnroot/phundament/branches/2.1/modules/pii modules/pii

Configuration

To be able to run the phundament installer within the piimodule, you have to add the pii commands to your config.

$ edit config/console.php

Update your commandMap:

<?php
return array(
  'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
  'name'=>'Pii Console Application',
  'commandMap'=>array(
    'pii' => 'modules/pii/commands/PiiCommand.php',
    'install' => 'modules/pii/commands/InstallCommand.php',
    'backup' => 'modules/pii/commands/BackupCommand.php',
    'api' => 'modules/pii/commands/ApiCommand.php',
  ),
);
?>

Before you start the installation process, update a few lines in config/main.php, first add the DS constant and merge your configuration with pii's defaults.

$ edit config/main.php

defined('DS') or define('DS',DIRECTORY_SEPARATOR);
return CMap::mergeArray(include(dirname(__FILE__)."/../modules/pii/config/pii.php"),array(...));

Fix these paths if not using the complete app:

'params' => array(
  'publicRuntimePath' => '../runtime',
  'publicRuntimeUrl' => '/runtime',
),

Now update your database configuration in config/main.php. Uncomment components > db and update your credentials.

User Identity

This part is a little glitch, we hope we can solve this soon.

$ edit models/LoginForm.php

Simply change UserIdentity to PiiUserIdentity:

$identity=new PiiUserIdentity($this->username,$this->password);

Setup

Run the installer by issuing this command:

$ ./yiic install config/main.php

Note: The installer will create a few directories for runtime data, uploaded and process files, such as images. This depends on your directory layout, but should run fine with a yii default skeleton.

Check

Open your browser and try to login with 'admin' and 'admin' (depending on what you've entered in the installation process)

Open this URL to check if the installation has been completed successfully

http://localhost/phundament2/index.php?r=pii

Adding phundament to existing pages/views

$ edit views/site/index.php

Add a cell manager widget:

<?php $this->widget('pii.components.cellmanager.PiiCellManager',array('id'=>'mainCell')) ?>

For some more tweaks update your CSS and download a jQueryUI Theme:

$ edit css/main.css
body, .widgetContent
#page, .widgetContent

Go to jQuery UI Themeroller and download a theme that fits your needs.
*copy the css file to your theme folder into the css directory
*add jquery-ui-1.7.2.custom.css to layouts/main.php

$ edit views/layouts/main.php
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/themes/classic/jquery-ui-1.7.2.custom.css" />

extensions

Besides yii framework, phundament takes advantage of a number of other open source projects.

Please refer to their pages for additional information.

yii-based

srbac

Srbac is a module that adds a graphic web interface for the administration of yii rbac.

image

Provides methods for the dynamic manipulation of images. Various image formats such as JPEG, PNG, and GIF can be resized, cropped, rotated and sharpened.

flash

A small extension based on a modified version of jquery.flash.js, which in turn is a jQuery plugin for embedding Flash movies.

langhandler

This extension will set up your applications target language according to visitors browser setting, accepted languages list and country code passed in url.

3rd party extensions

ckeditor

WYSIWYG HTML editor

mbmenu

OS-style dropdown menu

tweet

Unobstrusive javascript plugin for jQuery 

iepngfix

Display transparent PNGs in Internet Explorer 5.5 and 6

Docs