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
da161734
Commit
da161734
authored
Jan 05, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finished offline template summaries
parent
c66a1fa7
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
375 additions
and
83 deletions
+375
-83
OfflineRenderer.php
extensions/yii/apidoc/components/OfflineRenderer.php
+66
-22
ClassDoc.php
extensions/yii/apidoc/models/ClassDoc.php
+6
-0
Context.php
extensions/yii/apidoc/models/Context.php
+41
-2
TypeDoc.php
extensions/yii/apidoc/models/TypeDoc.php
+53
-0
class.php
extensions/yii/apidoc/views/class.php
+22
-16
classSummary.php
extensions/yii/apidoc/views/classSummary.php
+32
-42
constSummary.php
extensions/yii/apidoc/views/constSummary.php
+35
-0
eventSummary.php
extensions/yii/apidoc/views/eventSummary.php
+35
-0
index.php
extensions/yii/apidoc/views/index.php
+1
-1
methodSummary.php
extensions/yii/apidoc/views/methodSummary.php
+41
-0
propertySummary.php
extensions/yii/apidoc/views/propertySummary.php
+43
-0
No files found.
extensions/yii/apidoc/components/OfflineRenderer.php
View file @
da161734
...
...
@@ -8,6 +8,10 @@
namespace
yii\apidoc\components
;
use
yii\apidoc\models\ConstDoc
;
use
yii\apidoc\models\EventDoc
;
use
yii\apidoc\models\MethodDoc
;
use
yii\apidoc\models\PropertyDoc
;
use
yii\base\ViewContextInterface
;
use
yii\console\Controller
;
use
yii\helpers\Console
;
...
...
@@ -85,17 +89,50 @@ class OfflineRenderer extends BaseRenderer implements ViewContextInterface
}
/**
* creates a link to a
n item
* @param ClassDoc|InterfaceDoc|TraitDoc $
item
* creates a link to a
type (class, interface or trait)
* @param ClassDoc|InterfaceDoc|TraitDoc $
types
* @param string $title
* @return string
*/
public
function
link
(
$item
,
$title
=
null
)
public
function
typeLink
(
$types
,
$title
=
null
)
{
if
(
!
is_array
(
$types
))
{
$types
=
[
$types
];
}
$links
=
[];
foreach
(
$types
as
$type
)
{
if
(
!
is_object
(
$type
)
&&
(
$t
=
$this
->
context
->
getType
(
$type
))
!==
null
)
{
$type
=
$t
;
}
if
(
!
is_object
(
$type
))
{
$links
[]
=
$type
;
}
else
{
$links
[]
=
Html
::
a
(
$title
!==
null
?
$title
:
$type
->
name
,
null
,
[
'href'
=>
$this
->
generateFileName
(
$type
->
name
)]
);
}
}
return
implode
(
'|'
,
$links
);
}
/**
* creates a link to a subject
* @param PropertyDoc|MethodDoc|ConstDoc|EventDoc $subject
* @param string $title
* @return string
*/
public
function
subjectLink
(
$subject
,
$title
=
null
)
{
if
(
$title
===
null
)
{
$title
=
$item
->
name
;
$title
=
$subject
->
name
;
}
if
((
$type
=
$this
->
context
->
getType
(
$subject
->
definedBy
))
===
null
)
{
return
$subject
->
name
;
}
else
{
return
Html
::
a
(
$title
,
null
,
[
'href'
=>
$this
->
generateFileName
(
$type
->
name
)
.
'#'
.
$subject
->
name
.
'-detail'
]);
}
return
Html
::
a
(
$title
,
null
,
[
'href'
=>
$this
->
generateFileName
(
$item
->
name
)]);
}
/**
...
...
@@ -104,11 +141,11 @@ class OfflineRenderer extends BaseRenderer implements ViewContextInterface
*/
public
function
renderInheritance
(
$class
)
{
$parents
[]
=
$this
->
l
ink
(
$class
);
$parents
[]
=
$this
->
typeL
ink
(
$class
);
while
(
$class
->
parentClass
!==
null
)
{
if
(
isset
(
$this
->
context
->
classes
[
$class
->
parentClass
]))
{
$class
=
$this
->
context
->
classes
[
$class
->
parentClass
];
$parents
[]
=
$this
->
l
ink
(
$class
);
$parents
[]
=
$this
->
typeL
ink
(
$class
);
}
else
{
$parents
[]
=
$class
->
parentClass
;
// TODO link to php.net
break
;
...
...
@@ -118,15 +155,16 @@ class OfflineRenderer extends BaseRenderer implements ViewContextInterface
}
/**
* @param
ClassDoc $clas
s
* @param
array $name
s
* @return string
*/
public
function
renderI
mplements
(
$clas
s
)
public
function
renderI
nterfaces
(
$name
s
)
{
$interfaces
=
[];
foreach
(
$class
->
interfaces
as
$interface
)
{
sort
(
$names
,
SORT_STRING
);
foreach
(
$names
as
$interface
)
{
if
(
isset
(
$this
->
context
->
interfaces
[
$interface
]))
{
$interfaces
[]
=
$this
->
l
ink
(
$this
->
context
->
interfaces
[
$interface
]);
$interfaces
[]
=
$this
->
typeL
ink
(
$this
->
context
->
interfaces
[
$interface
]);
}
else
{
$interfaces
[]
=
$interface
;
// TODO link to php.net
}
...
...
@@ -135,15 +173,16 @@ class OfflineRenderer extends BaseRenderer implements ViewContextInterface
}
/**
* @param
ClassDoc|TraitDoc $clas
s
* @param
array $name
s
* @return string
*/
public
function
renderTrait
Uses
(
$clas
s
)
public
function
renderTrait
s
(
$name
s
)
{
$traits
=
[];
foreach
(
$class
->
traits
as
$trait
)
{
sort
(
$names
,
SORT_STRING
);
foreach
(
$names
as
$trait
)
{
if
(
isset
(
$this
->
context
->
traits
[
$trait
]))
{
$traits
[]
=
$this
->
l
ink
(
$this
->
context
->
traits
[
$trait
]);
$traits
[]
=
$this
->
typeL
ink
(
$this
->
context
->
traits
[
$trait
]);
}
else
{
$traits
[]
=
$trait
;
// TODO link to php.net
}
...
...
@@ -151,17 +190,22 @@ class OfflineRenderer extends BaseRenderer implements ViewContextInterface
return
implode
(
', '
,
$traits
);
}
public
function
renderSubclasses
(
$class
)
/**
* @param array $names
* @return string
*/
public
function
renderClasses
(
$names
)
{
$subclasses
=
[];
foreach
(
$class
->
subclasses
as
$subclass
)
{
if
(
isset
(
$this
->
context
->
classes
[
$subclass
]))
{
$subclasses
[]
=
$this
->
link
(
$this
->
context
->
classes
[
$subclass
]);
$classes
=
[];
sort
(
$names
,
SORT_STRING
);
foreach
(
$names
as
$class
)
{
if
(
isset
(
$this
->
context
->
classes
[
$class
]))
{
$classes
[]
=
$this
->
typeLink
(
$this
->
context
->
classes
[
$class
]);
}
else
{
$
subclasses
[]
=
$sub
class
;
// TODO link to php.net
$
classes
[]
=
$
class
;
// TODO link to php.net
}
}
return
implode
(
', '
,
$
sub
classes
);
return
implode
(
', '
,
$classes
);
}
...
...
extensions/yii/apidoc/models/ClassDoc.php
View file @
da161734
...
...
@@ -22,7 +22,13 @@ class ClassDoc extends TypeDoc
// will be set by Context::updateReferences()
public
$subclasses
=
[];
/**
* @var EventDoc[]
*/
public
$events
=
[];
/**
* @var ConstDoc[]
*/
public
$constants
=
[];
...
...
extensions/yii/apidoc/models/Context.php
View file @
da161734
...
...
@@ -32,6 +32,18 @@ class Context extends Component
public
$traits
=
[];
public
function
getType
(
$type
)
{
if
(
isset
(
$this
->
classes
[
$type
]))
{
return
$this
->
classes
[
$type
];
}
elseif
(
isset
(
$this
->
interfaces
[
$type
]))
{
return
$this
->
interfaces
[
$type
];
}
elseif
(
isset
(
$this
->
traits
[
$type
]))
{
return
$this
->
traits
[
$type
];
}
return
null
;
}
public
function
addFile
(
$fileName
)
{
if
(
isset
(
$this
->
files
[
$fileName
]))
{
...
...
@@ -107,7 +119,6 @@ class Context extends Component
}
// update interfaces of subclasses
foreach
(
$this
->
classes
as
$class
)
{
// TODO do the same for events, constants, methods, properties
$this
->
updateSubclassInferfacesTraits
(
$class
);
}
// update implementedBy and usedBy for interfaces and traits
...
...
@@ -119,10 +130,17 @@ class Context extends Component
}
foreach
(
$class
->
traits
as
$trait
)
{
if
(
isset
(
$this
->
traits
[
$trait
]))
{
$this
->
traits
[
$trait
]
->
usedBy
[]
=
$class
->
name
;
$trait
=
$this
->
traits
[
$trait
];
$trait
->
usedBy
[]
=
$class
->
name
;
$class
->
properties
=
array_merge
(
$trait
->
properties
,
$class
->
properties
);
// TODO make unique
$class
->
methods
=
array_merge
(
$trait
->
methods
,
$class
->
methods
);
// TODO make unique
}
}
}
// update properties, methods, contants and events of subclasses
foreach
(
$this
->
classes
as
$class
)
{
$this
->
updateSubclassInheritance
(
$class
);
}
}
/**
...
...
@@ -135,7 +153,27 @@ class Context extends Component
$subclass
=
$this
->
classes
[
$subclass
];
$subclass
->
interfaces
=
array_unique
(
array_merge
(
$subclass
->
interfaces
,
$class
->
interfaces
));
$subclass
->
traits
=
array_unique
(
array_merge
(
$subclass
->
traits
,
$class
->
traits
));
$subclass
->
events
=
array_merge
(
$class
->
events
,
$subclass
->
events
);
// TODO make unique
$subclass
->
constants
=
array_merge
(
$class
->
constants
,
$subclass
->
constants
);
// TODO make unique
$subclass
->
properties
=
array_merge
(
$class
->
properties
,
$subclass
->
properties
);
// TODO make unique
$subclass
->
methods
=
array_merge
(
$class
->
methods
,
$subclass
->
methods
);
// TODO make unique
$this
->
updateSubclassInferfacesTraits
(
$subclass
);
}
}
/**
* Add implemented interfaces and used traits to subclasses
* @param ClassDoc $class
*/
protected
function
updateSubclassInheritance
(
$class
)
{
foreach
(
$class
->
subclasses
as
$subclass
)
{
$subclass
=
$this
->
classes
[
$subclass
];
$subclass
->
events
=
array_merge
(
$class
->
events
,
$subclass
->
events
);
// TODO make unique
$subclass
->
constants
=
array_merge
(
$class
->
constants
,
$subclass
->
constants
);
// TODO make unique
$subclass
->
properties
=
array_merge
(
$class
->
properties
,
$subclass
->
properties
);
// TODO make unique
$subclass
->
methods
=
array_merge
(
$class
->
methods
,
$subclass
->
methods
);
// TODO make unique
$this
->
updateSubclassInheritance
(
$subclass
);
}
}
}
\ No newline at end of file
extensions/yii/apidoc/models/TypeDoc.php
View file @
da161734
...
...
@@ -13,9 +13,61 @@ use yii\base\Exception;
class
TypeDoc
extends
BaseDoc
{
public
$authors
=
[];
/**
* @var MethodDoc[]
*/
public
$methods
=
[];
/**
* @var PropertyDoc[]
*/
public
$properties
=
[];
public
function
getPublicMethods
()
{
return
$this
->
getFilteredMethods
(
'public'
);
}
public
function
getProtectedMethods
()
{
return
$this
->
getFilteredMethods
(
'protected'
);
}
private
function
getFilteredMethods
(
$visibility
)
{
$methods
=
[];
foreach
(
$this
->
methods
as
$method
)
{
if
(
$method
->
visibility
==
$visibility
)
{
$methods
[]
=
$method
;
}
}
return
$methods
;
}
public
function
getPublicProperties
()
{
return
$this
->
getFilteredProperties
(
'public'
);
}
public
function
getProtectedProperties
()
{
return
$this
->
getFilteredProperties
(
'protected'
);
}
private
function
getFilteredProperties
(
$visibility
)
{
if
(
$this
->
properties
===
null
)
{
return
[];
}
$properties
=
[];
foreach
(
$this
->
properties
as
$property
)
{
if
(
$property
->
visibility
==
$visibility
)
{
$properties
[]
=
$property
;
}
}
return
$properties
;
}
/**
* @param \phpDocumentor\Reflection\InterfaceReflector $reflector
* @param array $config
...
...
@@ -48,6 +100,7 @@ class TypeDoc extends BaseDoc
$method
=
new
MethodDoc
(
$methodReflector
);
$method
->
definedBy
=
$this
->
name
;
// TODO only set property when subclass of Object
if
(
!
strncmp
(
$method
->
name
,
'set'
,
3
))
{
$propertyName
=
lcfirst
(
substr
(
$method
->
name
,
3
));
if
(
isset
(
$this
->
properties
[
$propertyName
]))
{
...
...
extensions/yii/apidoc/views/class.php
View file @
da161734
...
...
@@ -26,30 +26,36 @@ use yii\apidoc\models\TraitDoc;
echo
$item
->
name
;
?>
</h1>
<div
id=
"nav"
>
<a
href=
"index.html"
>
All Classes
</a>
<?php
if
(
!
(
$item
instanceof
InterfaceDoc
)
&&
!
empty
(
$item
->
properties
))
:
?>
|
<a
href=
"#properties"
>
Properties
</a>
<?php
endif
;
?>
<?php
if
(
!
empty
(
$item
->
methods
))
:
?>
|
<a
href=
"#methods"
>
Methods
</a>
<?php
endif
;
?>
<?php
if
(
$item
instanceof
ClassDoc
&&
!
empty
(
$item
->
events
))
:
?>
|
<a
href=
"#events"
>
Events
</a>
<?php
endif
;
?>
<a
href=
"index.html"
>
All Classes
</a>
<?php
if
(
!
(
$item
instanceof
InterfaceDoc
)
&&
!
empty
(
$item
->
properties
))
:
?>
|
<a
href=
"#properties"
>
Properties
</a>
<?php
endif
;
?>
<?php
if
(
!
empty
(
$item
->
methods
))
:
?>
|
<a
href=
"#methods"
>
Methods
</a>
<?php
endif
;
?>
<?php
if
(
$item
instanceof
ClassDoc
&&
!
empty
(
$item
->
events
))
:
?>
|
<a
href=
"#events"
>
Events
</a>
<?php
endif
;
?>
<?php
if
(
$item
instanceof
ClassDoc
&&
!
empty
(
$item
->
constants
))
:
?>
|
<a
href=
"#constants"
>
Constants
</a>
<?php
endif
;
?>
</div>
<?=
$this
->
render
(
'classSummary'
,
[
'item'
=>
$item
])
;
?>
<?=
$this
->
render
(
'classSummary'
,
[
'item'
=>
$item
])
?>
<a
name=
"properties"
></a>
<?
php
//$this->renderPartial('propertySummary',array('class'=>$item,'protected'=>false));
?>
<?
php
//$this->renderPartial('propertySummary',array('class'=>$item,'protected'=>true));
?>
<?
=
$this
->
render
(
'propertySummary'
,
[
'item'
=>
$item
,
'protected'
=>
false
])
?>
<?
=
$this
->
render
(
'propertySummary'
,
[
'item'
=>
$item
,
'protected'
=>
true
])
?>
<a
name=
"methods"
></a>
<?
php
//$this->renderPartial('methodSummary',array('class'=>$item,'protected'=>false));
?>
<?
php
//$this->renderPartial('methodSummary',array('class'=>$item,'protected'=>true));
?>
<?
=
$this
->
render
(
'methodSummary'
,
[
'item'
=>
$item
,
'protected'
=>
false
])
?>
<?
=
$this
->
render
(
'methodSummary'
,
[
'item'
=>
$item
,
'protected'
=>
true
])
?>
<a
name=
"events"
></a>
<?
php
//$this->renderPartial('eventSummary',array('class'=>$item)); ?>
<?=
$this
->
render
(
'eventSummary'
,
[
'item'
=>
$item
])
?>
<a
name=
"constants"
></a>
<?=
$this
->
render
(
'constSummary'
,
[
'item'
=>
$item
])
?>
<?php
//$this->renderPartial('propertyDetails',array('class'=>$item)); ?>
<?
php
//$this->renderPartial('methodDetails',array('class'=>$item)); ?>
extensions/yii/apidoc/views/classSummary.php
View file @
da161734
<?php
use
yii\apidoc\components\OfflineRenderer
;
use
yii\apidoc\models\ClassDoc
;
use
yii\apidoc\models\InterfaceDoc
;
use
yii\apidoc\models\TraitDoc
;
/**
* @var ClassDoc|InterfaceDoc|TraitDoc $item
* @var yii\web\View $this
* @var OfflineRenderer $renderer
*/
$renderer
=
$this
->
context
;
?>
<table
class=
"summaryTable docClass"
>
<colgroup>
<colgroup>
<col
class=
"col-name"
/>
<col
class=
"col-value"
/>
</colgroup>
<?php
if
(
$item
instanceof
ClassDoc
)
:
?>
<tr>
<th>
Inheritance
</th>
<td>
<?php
echo
$this
->
context
->
renderInheritance
(
$item
);
?>
</td>
</tr>
<?php
endif
;
?>
<?php
if
(
!
empty
(
$item
->
interfaces
))
:
?>
<tr>
<th>
Implements
</th>
<td>
<?php
echo
$this
->
context
->
renderImplements
(
$item
);
?>
</td>
</tr>
<?php
endif
;
?>
<?php
if
(
!
(
$item
instanceof
InterfaceDoc
)
&&
!
empty
(
$item
->
traits
))
:
?>
<tr>
<th>
Uses Traits
</th>
<td>
<?php
echo
$this
->
context
->
renderTraitUses
(
$item
);
?>
</td>
</tr>
<?php
endif
;
?>
<?php
if
(
$item
instanceof
ClassDoc
&&
!
empty
(
$item
->
subclasses
))
:
?>
<tr>
<th>
Subclasses
</th>
<td>
<?php
echo
$this
->
context
->
renderSubclasses
(
$item
);
?>
</td>
</tr>
<?php
endif
;
?>
<?php
if
(
!
empty
(
$item
->
since
))
:
?>
<tr>
<th>
Since
</th>
<td>
<?php
echo
$item
->
since
;
?>
</td>
</tr>
<?php
endif
;
?>
<?php
if
(
!
empty
(
$item
->
version
))
:
?>
<tr>
<th>
Version
</th>
<td>
<?php
echo
$item
->
version
;
?>
</td>
</tr>
<?php
endif
;
?>
<tr>
</colgroup>
<?php
if
(
$item
instanceof
ClassDoc
)
:
?>
<tr><th>
Inheritance
</th><td>
<?=
$renderer
->
renderInheritance
(
$item
)
?>
</td></tr>
<?php
endif
;
?>
<?php
if
(
$item
instanceof
ClassDoc
&&
!
empty
(
$item
->
interfaces
))
:
?>
<tr><th>
Implements
</th><td>
<?=
$renderer
->
renderInterfaces
(
$item
->
interfaces
)
?>
</td></tr>
<?php
endif
;
?>
<?php
if
(
!
(
$item
instanceof
InterfaceDoc
)
&&
!
empty
(
$item
->
traits
))
:
?>
<tr><th>
Uses Traits
</th><td>
<?=
$renderer
->
renderTraits
(
$item
->
traits
)
?>
</td></tr>
<?php
endif
;
?>
<?php
if
(
$item
instanceof
ClassDoc
&&
!
empty
(
$item
->
subclasses
))
:
?>
<tr><th>
Subclasses
</th><td>
<?=
$renderer
->
renderClasses
(
$item
->
subclasses
)
?>
</td></tr>
<?php
endif
;
?>
<?php
if
(
$item
instanceof
InterfaceDoc
&&
!
empty
(
$item
->
implementedBy
))
:
?>
<tr><th>
Implemented by
</th><td>
<?=
$renderer
->
renderClasses
(
$item
->
implementedBy
)
?>
</td></tr>
<?php
endif
;
?>
<?php
if
(
$item
instanceof
TraitDoc
&&
!
empty
(
$item
->
usedBy
))
:
?>
<tr><th>
Implemented by
</th><td>
<?=
$renderer
->
renderClasses
(
$item
->
usedBy
)
?>
</td></tr>
<?php
endif
;
?>
<?php
if
(
!
empty
(
$item
->
since
))
:
?>
<tr><th>
Available since version
</th><td>
<?=
$item
->
since
?>
</td></tr>
<?php
endif
;
?>
<tr>
<th>
Source Code
</th>
<!-- <td>-->
<?php
//echo $this->renderSourceLink($item->sourcePath); ?><!--</td>--
>
</
tr
>
<td>
<?php
// TODO echo $this->renderSourceLink($item->sourcePath) ?></td
>
</
tr
>
</
table
>
<
div
id
=
"classDescription"
>
<?
php
echo
$item
->
description
;
?>
<
strong
><?=
$item
->
shortDescription
?>
</strong>
<p>
<?=
nl2br
(
$item
->
description
)
?>
</p>
</div>
\ No newline at end of file
extensions/yii/apidoc/views/constSummary.php
0 → 100644
View file @
da161734
<?php
use
yii\apidoc\models\ClassDoc
;
/**
* @var ClassDoc $item
* @var yii\web\View $this
*/
if
(
empty
(
$item
->
constants
))
{
return
;
}
?>
<div
class=
"summary docConst"
>
<h2>
Constants
</h2>
<p><a
href=
"#"
class=
"toggle"
>
Hide inherited constants
</a></p>
<table
class=
"summaryTable"
>
<colgroup>
<col
class=
"col-const"
/>
<col
class=
"col-description"
/>
<col
class=
"col-defined"
/>
</colgroup>
<tr>
<th>
Constant
</th><th>
Description
</th><th>
Defined By
</th>
</tr>
<?php
foreach
(
$item
->
constants
as
$constant
)
:
?>
<tr
<?=
$constant
->
definedBy
!=
$item
->
name
?
' class="inherited"'
:
''
?>
id=
"
<?=
$constant
->
name
?>
"
>
<td>
<?=
$this
->
context
->
subjectLink
(
$constant
)
?>
</td>
<td>
<?=
$constant
->
shortDescription
?>
</td>
<td>
<?=
$this
->
context
->
typeLink
(
$constant
->
definedBy
)
?>
</td>
</tr>
<?php
endforeach
;
?>
</table>
</div>
\ No newline at end of file
extensions/yii/apidoc/views/eventSummary.php
0 → 100644
View file @
da161734
<?php
use
yii\apidoc\models\ClassDoc
;
/**
* @var ClassDoc $item
* @var yii\web\View $this
*/
if
(
empty
(
$item
->
events
))
{
return
;
}
?>
<div
class=
"summary docEvent"
>
<h2>
Events
</h2>
<p><a
href=
"#"
class=
"toggle"
>
Hide inherited events
</a></p>
<table
class=
"summaryTable"
>
<colgroup>
<col
class=
"col-event"
/>
<col
class=
"col-description"
/>
<col
class=
"col-defined"
/>
</colgroup>
<tr>
<th>
Event
</th><th>
Description
</th><th>
Defined By
</th>
</tr>
<?php
foreach
(
$item
->
events
as
$event
)
:
?>
<tr
<?=
$event
->
definedBy
!=
$item
->
name
?
' class="inherited"'
:
''
?>
id=
"
<?=
$event
->
name
?>
"
>
<td>
<?=
$this
->
context
->
subjectLink
(
$event
)
?>
</td>
<td>
<?=
$event
->
shortDescription
?>
</td>
<td>
<?=
$this
->
context
->
typeLink
(
$event
->
definedBy
)
?>
</td>
</tr>
<?php
endforeach
;
?>
</table>
</div>
\ No newline at end of file
extensions/yii/apidoc/views/index.php
View file @
da161734
...
...
@@ -23,7 +23,7 @@ use yii\apidoc\models\TraitDoc;
ksort
(
$items
);
foreach
(
$items
as
$i
=>
$class
)
:
?>
<tr>
<td>
<?php
echo
$this
->
context
->
l
ink
(
$class
,
$class
->
name
);
?>
</td>
<td>
<?php
echo
$this
->
context
->
typeL
ink
(
$class
,
$class
->
name
);
?>
</td>
<td>
<?php
echo
$class
->
shortDescription
;
?>
</td>
</tr>
<?php
endforeach
;
?>
...
...
extensions/yii/apidoc/views/methodSummary.php
0 → 100644
View file @
da161734
<?php
use
yii\apidoc\models\ClassDoc
;
use
yii\apidoc\models\InterfaceDoc
;
use
yii\apidoc\models\TraitDoc
;
/**
* @var ClassDoc|InterfaceDoc|TraitDoc $item
* @var boolean $protected
* @var yii\web\View $this
*/
if
(
$protected
&&
count
(
$item
->
getProtectedMethods
())
==
0
||
!
$protected
&&
count
(
$item
->
getPublicMethods
())
==
0
)
{
return
;
}
?>
<div
class=
"summary docMethod"
>
<h2>
<?=
$protected
?
'Protected Methods'
:
'Public Methods'
?>
</h2>
<p><a
href=
"#"
class=
"toggle"
>
Hide inherited methods
</a></p>
<table
class=
"summaryTable"
>
<colgroup>
<col
class=
"col-method"
/>
<col
class=
"col-description"
/>
<col
class=
"col-defined"
/>
</colgroup>
<tr>
<th>
Method
</th><th>
Description
</th><th>
Defined By
</th>
</tr>
<?php
foreach
(
$item
->
methods
as
$method
)
:
?>
<?php
if
(
$protected
&&
$method
->
visibility
==
'protected'
||
!
$protected
&&
$method
->
visibility
!=
'protected'
)
:
?>
<tr
<?=
$method
->
definedBy
!=
$item
->
name
?
' class="inherited"'
:
''
?>
id=
"
<?=
$method
->
name
?>
"
>
<td>
<?=
$this
->
context
->
subjectLink
(
$method
,
$method
->
name
.
'()'
)
?>
</td>
<td>
<?=
$method
->
shortDescription
?>
</td>
<td>
<?=
$this
->
context
->
typeLink
(
$method
->
definedBy
)
?>
</td>
</tr>
<?php
endif
;
?>
<?php
endforeach
;
?>
</table>
</div>
\ No newline at end of file
extensions/yii/apidoc/views/propertySummary.php
0 → 100644
View file @
da161734
<?php
use
yii\apidoc\models\ClassDoc
;
use
yii\apidoc\models\InterfaceDoc
;
use
yii\apidoc\models\TraitDoc
;
/**
* @var ClassDoc|InterfaceDoc|TraitDoc $item
* @var boolean $protected
* @var yii\web\View $this
*/
if
(
$protected
&&
count
(
$item
->
getProtectedProperties
())
==
0
||
!
$protected
&&
count
(
$item
->
getPublicProperties
())
==
0
)
{
return
;
}
?>
<div
class=
"summary docProperty"
>
<h2>
<?=
$protected
?
'Protected Properties'
:
'Public Properties'
?>
</h2>
<p><a
href=
"#"
class=
"toggle"
>
Hide inherited properties
</a></p>
<table
class=
"summaryTable"
>
<colgroup>
<col
class=
"col-property"
/>
<col
class=
"col-type"
/>
<col
class=
"col-description"
/>
<col
class=
"col-defined"
/>
</colgroup>
<tr>
<th>
Property
</th><th>
Type
</th><th>
Description
</th><th>
Defined By
</th>
</tr>
<?php
foreach
(
$item
->
properties
as
$property
)
:
?>
<?php
if
(
$protected
&&
$property
->
visibility
==
'protected'
||
!
$protected
&&
$property
->
visibility
!=
'protected'
)
:
?>
<tr
<?=
$property
->
definedBy
!=
$item
->
name
?
' class="inherited"'
:
''
?>
id=
"
<?=
$property
->
name
?>
"
>
<td>
<?php
echo
$this
->
context
->
subjectLink
(
$property
);
?>
</td>
<td>
<?php
echo
$this
->
context
->
typeLink
(
$property
->
types
);
?>
</td>
<td>
<?php
echo
$property
->
shortDescription
;
?>
</td>
<td>
<?php
echo
$this
->
context
->
typeLink
(
$property
->
definedBy
);
?>
</td>
</tr>
<?php
endif
;
?>
<?php
endforeach
;
?>
</table>
</div>
\ No newline at end of file
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