FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
-remove-phpquery/phpQuery/phpQuery/plugins/example.php at master · cmprecycle/-remove-phpquery · GitHub
cmprecycle
-remove-phpquery
Repository navigation
Code
Issues
160
(160)
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
-remove-phpquery
/
phpQuery
/
phpQuery
/
plugins
/
example.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
75 lines (72 loc) · 1.82 KB
Breadcrumbs
-remove-phpquery
/
phpQuery
/
phpQuery
/
plugins
/
example.php
Copy path
File metadata and controls
75 lines (72 loc) · 1.82 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/**
* Example of phpQuery plugin.
*
* Load it like this:
* phpQuery::plugin('example')
* phpQuery::plugin('example', 'example.php')
* pq('ul')->plugin('example')
* pq('ul')->plugin('example', 'example.php')
*
* Plugin classes are never intialized, just method calls are forwarded
* in static way from phpQuery.
*
* Have fun writing plugins :)
*/
/**
* phpQuery plugin class extending phpQuery object.
* Methods from this class are callable on every phpQuery object.
*
* Class name prefix 'phpQueryObjectPlugin_' must be preserved.
*/
abstract
class
phpQueryObjectPlugin_example {
/**
* Limit binded methods.
*
* null means all public.
* array means only specified ones.
*
* @var array|null
*/
public
static
$
phpQueryMethods
=
null
;
/**
* Enter description here...
*
* @param phpQueryObject $self
*/
public
static
function
example
(
$
self
,
$
arg1
) {
// this method can be called on any phpQuery object, like this:
// pq('div')->example('$arg1 Value')
// do something
$
self
->
append
(
'
Im just an example !
'
);
// change stack of result object
return
$
self
->
find
(
'
div
'
);
}
protected
static
function
helperFunction
() {
// this method WONT be avaible as phpQuery method,
// because it isn't publicly callable
}
}
/**
* phpQuery plugin class extending phpQuery static namespace.
* Methods from this class are callable as follows:
* phpQuery::$plugins->staticMethod()
*
* Class name prefix 'phpQueryPlugin_' must be preserved.
*/
abstract
class
phpQueryPlugin_example {
/**
* Limit binded methods.
*
* null means all public.
* array means only specified ones.
*
* @var array|null
*/
public
static
$
phpQueryMethods
=
null
;
public
static
function
staticMethod
() {
// this method can be called within phpQuery class namespace, like this:
// phpQuery::$plugins->staticMethod()
}
}
?>
Back
|
FazBrowse Home
|
New Git URL