前の記事 «:ファイルの選択後すぐにファイルアップロードをするPHPサンプル
次の記事 »:マルチユーザのカレンダーWEBアプリ

script.aculo.usのPHPラッパークラス

2006年01月19日

スポンサード リンク
Scriptaculous Lists with PHP

The resulting PHP class is a very simple class that makes it easy - with a couple lines of code to get a sortable list (or sortable just about anything) onto a page and to translate the result into a PHP array.

script.aculo.usのsortableの機能をJavascriptのコードを一切書かずに、PHPだけで実装できるPHPラッパークラスの紹介。
script.aculo.usだけでも非常に簡単にかけますが、テコでもJavascriptは書きたくないという方にオススメのライブラリ。

以下、サンプルコード

<?php
require_once('SLLists.class.php');
$sortableLists = new SLLists('scriptaculous');
$sortableLists->addList('categories','categoriesListOrder');
$sortableLists->addList('divContainer','divOrder','div');
$sortableLists->addList('imageContainer','imageOrder','img');
$sortableLists->addList('imageFloatContainer','imageFloatOrder','img',"overlap:'horizontal',constraint:false");
$sortableLists->debug = true;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Scriptaculous Lists with PHP</title>
<link rel="stylesheet" type="text/css" href="css/lists.css"/>
<?
$sortableLists->printTopJS();
?>
</head>

スポンサード リンク
あなたのネットサービスを当ブログで紹介します!

投稿者 KJ : 2006年01月19日 15:07 | ブックマークに追加する Subscribe with livedoor Reader
間違いの指摘をしていただける方はメールでお願いします


本を執筆しました。