-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswitcher.php
37 lines (33 loc) · 953 Bytes
/
switcher.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Switcher Plugin
*
* usage {{ switcher:class_row class="left|center|right" }}
* Note:
* Each class is separated by the pipe key and no spaces.
* No limit to the number of alternate classes.
*
* @package PyroCMS
* @author Kevin Phillips
* @copyright Copyright (c) Kevin Phillips
* @link http://www.kevinphillips.co.nz
* @param string
* @return string
* @version 1.1
*
*/
class Plugin_Switcher extends Plugin {
function class_row()
{
$classes = $this->attribute('class');
$values = explode('|', $classes);
// Uses Codeigniter String Helper function alternator();
if( ! function_exists('alternator'))
{
$CI =& get_instance();
$CI->load->helper('string');
}
return call_user_func_array('alternator', $values);
}
}
/* End of file switcher.php */