Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
0fd30598
Commit
0fd30598
authored
May 26, 2013
by
Alexander Kochetov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jQuery UI sortable widget
parent
90d2a99b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
+63
-0
Sortable.php
framework/yii/jui/Sortable.php
+63
-0
No files found.
framework/yii/jui/Sortable.php
0 → 100644
View file @
0fd30598
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace
yii\jui
;
use
yii\helpers\Html
;
/**
* AutoComplete renders a sortable jQuery UI widget.
*
* For example:
*
* ```php
* Sortable::begin(array(
* 'clientOptions' => array(
* 'cursor' => 'move',
* ),
* 'options' => array(
* 'tag' => 'ul',
* ),
* ));
*
* echo '<li>Item 1</li>';
* echo '<li>Item 2</li>';
* echo '<li>Item 3</li>';
*
* Sortable::end();
* ```
*
* @see http://api.jqueryui.com/sortable/
* @author Alexander Kochetov <creocoder@gmail.com>
* @since 2.0
*/
class
Sortable
extends
Widget
{
/**
* Initializes the widget.
*/
public
function
init
()
{
parent
::
init
();
$options
=
$this
->
options
;
$tag
=
isset
(
$options
[
'tag'
])
?
$options
[
'tag'
]
:
'div'
;
unset
(
$options
[
'tag'
]);
echo
Html
::
beginTag
(
$tag
,
$options
)
.
"
\n
"
;
}
/**
* Renders the widget.
*/
public
function
run
()
{
$options
=
$this
->
options
;
$tag
=
isset
(
$options
[
'tag'
])
?
$options
[
'tag'
]
:
'div'
;
unset
(
$options
[
'tag'
]);
echo
Html
::
endTag
(
$tag
)
.
"
\n
"
;
$this
->
registerWidget
(
'sortable'
,
false
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment