script.aculo.usのPHPラッパークラス
2006年01月19日
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
|
![]()
間違いの指摘をしていただける方はメールでお願いします
最新のブログ記事
- PHPで作る初めての携帯サイト構築
- 便利なPhotoshopプラグインコレクション
- 2009年1月6日 管理人のブックマーク
- 高級感のあるクールな3Dテキストを作成するPhotoshopチュートリアル
- ウェブ上で動作するweb2.0な関数電卓「web2.0calc.com」
- ハイクオリティなVista風アイコンセット92種「iVista Icon Pack 2」
- 2009年1月5日 管理人のブックマーク
- alert等のウィンドウ内ダイアログを実現するjQueryプラグイン「jQuery Alert Dialogs」
- PHPでWordのdocファイルやPDFをテキストとして読み取る方法
- これさえやればCSSをマスターできるかもしれないCSSチュートリアル&サンプル20
- ライブドアのレコメンデーションエンジン「Cicindela」




















