PageRenderTime 53ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/bootstrap/class.latte

https://bitbucket.org/gencer/apigen
Unknown | 425 lines | 369 code | 56 blank | 0 comment | 0 complexity | 0b352f53b477d1a16c13ef413cb6ecad MD5 | raw file
Possible License(s): BSD-3-Clause
  1. {*
  2. ApiGen 3.0dev - API documentation generator for PHP 5.3+
  3. Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
  4. Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
  5. Copyright (c) 2011-2012 Ondřej Nešpor (https://github.com/Andrewsville)
  6. Copyright (c) 2012 Olivier Laviale (https://github.com/olvlvl)
  7. For the full copyright and license information, please view
  8. the file LICENSE.md that was distributed with this source code.
  9. *}
  10. {layout '@layout.latte'}
  11. {var $active = 'class'}
  12. {block #title}{if $class->deprecated}Deprecated {/if}{if $class->interface}Interface{elseif $class->trait}Trait{else}Class{/if} {$class->name}{/block}
  13. {block #content}
  14. <div id="content" class="class">
  15. <h1 n:class="$class->deprecated ? deprecated">{if $class->interface}Interface{elseif $class->trait}Trait{else}Class{/if} {$class->shortName}</h1>
  16. {if $class->valid}
  17. <div class="description" n:if="$template->longDescription($class)">
  18. {!$class|longDescription}
  19. </div>
  20. <dl class="tree well" n:if="$class->parentClass || $class->ownInterfaces || $class->ownTraits">
  21. <dd n:foreach="$tree as $item" style="padding-left:{($iterator->counter - 1) * 30}px">
  22. <img src="resources/inherit.png" alt="Extended by" n:if="$iterator->counter > 1">
  23. {if $item->documented}
  24. <a href="{$item|classUrl}" n:tag-if="!$iterator->last">{last}<b>{/last}<span n:class="$item->deprecated ? deprecated, !$item->valid ? invalid">{$item->name}</span>{last}</b>{/last}</a>
  25. {else}{$item->name}{/if}
  26. {var $itemOwnInterfaces = $item->ownInterfaces}
  27. {if $itemOwnInterfaces} implements {foreach $itemOwnInterfaces as $interface}
  28. <a href="{$interface|classUrl}" n:tag-if="$interface->documented"><span n:class="$interface->deprecated ? deprecated, !$interface->valid ? invalid">{$interface->name}</span></a>{sep}, {/sep}
  29. {/foreach}{/if}
  30. {var $itemOwnTraits = $item->ownTraits}
  31. {if $itemOwnTraits} uses {foreach $itemOwnTraits as $trait}
  32. <a href="{$trait|classUrl}" n:tag-if="$trait->documented"><span n:class="$trait->deprecated ? deprecated, !$trait->valid ? invalid">{$trait->name}</span></a>{sep}, {/sep}
  33. {/foreach}{/if}
  34. </dd>
  35. </dl>
  36. {define #children}
  37. <p class="elementList">
  38. {foreach $children as $child}
  39. <code><a href="{$child|classUrl}" n:tag-if="$child->documented"><span n:tag-if="$child->deprecated" class="deprecated">{$child->name}</span></a></code>{sep}, {/sep}
  40. {/foreach}
  41. </p>
  42. {/define}
  43. <div n:if="$directSubClasses">
  44. <h3>Direct known subclasses</h3>
  45. {include #children, children => $directSubClasses}
  46. </div>
  47. <div n:if="$indirectSubClasses">
  48. <h3>Indirect known subclasses</h3>
  49. {include #children, children => $indirectSubClasses}
  50. </div>
  51. <div n:if="$directImplementers">
  52. <h3>Direct known implementers</h3>
  53. {include #children, children => $directImplementers}
  54. </div>
  55. <div n:if="$indirectImplementers">
  56. <h3>Indirect known implementers</h3>
  57. {include #children, children => $indirectImplementers}
  58. </div>
  59. <div n:if="$directUsers">
  60. <h3>Direct Known Users</h3>
  61. {include #children, children => $directUsers}
  62. </div>
  63. <div n:if="$indirectUsers">
  64. <h3>Indirect Known Users</h3>
  65. {include #children, children => $indirectUsers}
  66. </div>
  67. <div class="alert alert-info">
  68. {if !$class->interface && !$class->trait && ($class->abstract || $class->final)}<b>{if $class->abstract}Abstract{else}Final{/if}</b><br>{/if}
  69. {if $class->internal}<b>PHP Extension:</b> <a href="{$class->extension|manualUrl}" title="Go to PHP documentation">{$class->extension->name|firstUpper}</a><br>{/if}
  70. {if $class->inNamespace()}<b>Namespace:</b> {!$class->namespaceName|namespaceLinks}<br>{/if}
  71. {if $class->inPackage()}<b>Package:</b> {!$class->packageName|packageLinks}<br>{/if}
  72. {foreach $template->annotationSort($template->annotationFilter($class->annotations)) as $annotation => $values}
  73. {foreach $values as $value}
  74. <b>{$annotation|annotationBeautify}{if $value}:{/if}</b>
  75. {!$value|annotation:$annotation:$class}<br>
  76. {/foreach}
  77. {/foreach}
  78. {if $class->internal}<b>Documented at</b> <a href="{$class|manualUrl}" title="Go to PHP documentation">php.net</a>{else}<b>Located at</b> <a n:tag-if="$config->sourceCode" href="{$class|sourceUrl}" title="Go to source code">{$class->fileName|relativePath}</a>{/if}<br>
  79. </div>
  80. {var $ownMethods = $class->ownMethods}
  81. {var $inheritedMethods = $class->inheritedMethods}
  82. {var $usedMethods = $class->usedMethods}
  83. {var $ownMagicMethods = $class->ownMagicMethods}
  84. {var $inheritedMagicMethods = $class->inheritedMagicMethods}
  85. {var $usedMagicMethods = $class->usedMagicMethods}
  86. {if $ownMethods || $inheritedMethods || $usedMethods || $ownMagicMethods || $usedMagicMethods}
  87. {define #method}
  88. <tr data-order="{$method->name}" id="{if $method->magic}m{/if}_{$method->name}">
  89. {var $annotations = $method->annotations}
  90. <td class="attributes"><code>
  91. {if !$class->interface && $method->abstract}abstract{elseif $method->final}final{/if} {if $method->protected}protected{elseif $method->private}private{else}public{/if} {if $method->static}static{/if}
  92. {ifset $annotations['return']}{!$annotations['return'][0]|typeLinks:$method}{/ifset}
  93. {if $method->returnsReference()}&amp;{/if}
  94. </code>
  95. </td>
  96. <td class="name"><div>
  97. <a class="anchor" href="#{if $method->magic}m{/if}_{$method->name}">#</a>
  98. <code>{block|strip}
  99. {if $class->internal}
  100. <a href="{$method|manualUrl}" title="Go to PHP documentation">{$method->name}</a>(
  101. {else}
  102. <a n:tag-if="$config->sourceCode" href="{$method|sourceUrl}" title="Go to source code">{$method->name}</a>(
  103. {/if}
  104. {foreach $method->parameters as $parameter}
  105. <span>{!$parameter->typeHint|typeLinks:$method}
  106. <var>{if $parameter->passedByReference}&amp; {/if}${$parameter->name}</var>{if $parameter->defaultValueAvailable} = {!$parameter->defaultValueDefinition|highlightPHP:$class}{elseif $parameter->unlimited},{/if}</span>{sep}, {/sep}
  107. {/foreach}
  108. ){/block}</code>
  109. {if $config->template['options']['elementDetailsCollapsed']}
  110. <div class="description short">
  111. {!$method|shortDescription:true}
  112. </div>
  113. {/if}
  114. <div n:class="description, detailed, $config->template['options']['elementDetailsCollapsed'] ? hidden">
  115. {!$method|longDescription}
  116. {if !$class->deprecated && $method->deprecated}
  117. <h4>Deprecated</h4>
  118. {ifset $annotations['deprecated']}
  119. <div class="list">
  120. {foreach $annotations['deprecated'] as $description}
  121. {if $description}
  122. {!$description|annotation:'deprecated':$method}<br>
  123. {/if}
  124. {/foreach}
  125. </div>
  126. {/ifset}
  127. {/if}
  128. {if $method->parameters && isset($annotations['param'])}
  129. <h4>Parameters</h4>
  130. <div class="list"><dl>
  131. {foreach $method->parameters as $parameter}
  132. <dt><var>${$parameter->name}</var>{if $parameter->unlimited},{/if}</dt>
  133. <dd>{$parameter->description|description:$method}</dd>
  134. {/foreach}
  135. </dl></div>
  136. {/if}
  137. {if isset($annotations['return']) && 'void' !== $annotations['return'][0]}
  138. <h4>Returns</h4>
  139. <div class="list">
  140. {foreach $annotations['return'] as $description}
  141. {!$description|annotation:'return':$method}<br>
  142. {/foreach}
  143. </div>
  144. {/if}
  145. {ifset $annotations['throws']}
  146. <h4>Throws</h4>
  147. <div class="list">
  148. {foreach $annotations['throws'] as $description}
  149. {!$description|annotation:'throws':$method}<br>
  150. {/foreach}
  151. </div>
  152. {/ifset}
  153. {foreach $template->annotationSort($template->annotationFilter($annotations, array('deprecated', 'param', 'return', 'throws'))) as $annotation => $descriptions}
  154. <h4>{$annotation|annotationBeautify}</h4>
  155. <div class="list">
  156. {foreach $descriptions as $description}
  157. {if $description}
  158. {!$description|annotation:$annotation:$method}<br>
  159. {/if}
  160. {/foreach}
  161. </div>
  162. {/foreach}
  163. {var $overriddenMethod = $method->overriddenMethod}
  164. {if $overriddenMethod}
  165. <h4>Overrides</h4>
  166. <div class="list"><code><a n:tag-if="$template->getClass($overriddenMethod->declaringClassName)" href="{$overriddenMethod|methodUrl}">{$overriddenMethod->declaringClassName}::{$overriddenMethod->name}</a></code></div>
  167. {/if}
  168. {var $implementedMethod = $method->implementedMethod}
  169. {if $implementedMethod}
  170. <h4>Implementation of</h4>
  171. <div class="list"><code><a n:tag-if="$template->getClass($implementedMethod->declaringClassName)" href="{$implementedMethod|methodUrl}">{$implementedMethod->prettyName}</a></code></div>
  172. {/if}
  173. </div>
  174. </div></td>
  175. </tr>
  176. {/define}
  177. <h2>Methods summary</h2>
  178. <table class="summary table table-bordered table-striped methods" id="methods" n:if="$ownMethods">
  179. {foreach $ownMethods as $method}
  180. {include #method, method => $method}
  181. {/foreach}
  182. </table>
  183. {foreach $inheritedMethods as $parentName => $methods}
  184. <h3>Methods inherited from <a href="{$parentName|classUrl}#methods" n:tag-if="$template->getClass($parentName)">{$parentName}</a></h3>
  185. <p class="elementList">
  186. {foreach $methods as $method}
  187. <code><a href="{$method|methodUrl}" n:tag-if="$template->getClass($parentName)"><span n:tag-if="$method->deprecated" class="deprecated">{$method->name}()</span></a></code>{sep}, {/sep}
  188. {/foreach}
  189. </p>
  190. {/foreach}
  191. {foreach $usedMethods as $traitName => $methods}
  192. <h3>Methods used from <a href="{$traitName|classUrl}#methods" n:tag-if="$template->getClass($traitName)">{$traitName}</a></h3>
  193. <p class="elementList">
  194. {foreach $methods as $data}
  195. <code><a href="{$data['method']|methodUrl:$data['method']->declaringTrait}" n:tag-if="$template->getClass($traitName)"><span n:tag-if="$data['method']->deprecated" class="deprecated">{$data['method']->name}()</span></a>{if $data['aliases']}(as {foreach $data['aliases'] as $alias}<span n:tag-if="$data['method']->deprecated" class="deprecated">{$alias->name}()</span>{sep}, {/sep}{/foreach}){/if}</code>{sep}, {/sep}
  196. {/foreach}
  197. </p>
  198. {/foreach}
  199. {if $ownMagicMethods}
  200. <h3>Magic methods summary</h3>
  201. <table class="summary table table-bordered table-striped methods" id="magicMethods">
  202. {foreach $ownMagicMethods as $method}
  203. {include #method, method => $method}
  204. {/foreach}
  205. </table>
  206. {/if}
  207. {foreach $inheritedMagicMethods as $parentName => $methods}
  208. <h3>Magic methods inherited from <a href="{$parentName|classUrl}#methods" n:tag-if="$template->getClass($parentName)">{$parentName}</a></h3>
  209. <p class="elementList">
  210. {foreach $methods as $method}
  211. <code><a href="{$method|methodUrl}" n:tag-if="$template->getClass($parentName)"><span n:tag-if="$method->deprecated" class="deprecated">{$method->name}()</span></a></code>{sep}, {/sep}
  212. {/foreach}
  213. </p>
  214. {/foreach}
  215. {foreach $usedMagicMethods as $traitName => $methods}
  216. <h3>Magic methods used from <a href="{$traitName|classUrl}#methods" n:tag-if="$template->getClass($traitName)">{$traitName}</a></h3>
  217. <p class="elementList">
  218. {foreach $methods as $data}
  219. <code><a href="{$data['method']|methodUrl:$data['method']->declaringTrait}" n:tag-if="$template->getClass($traitName)"><span n:tag-if="$data['method']->deprecated" class="deprecated">{$data['method']->name}()</span></a>{if $data['aliases']}(as {foreach $data['aliases'] as $alias}<span n:tag-if="$data['method']->deprecated" class="deprecated">{$alias->name}()</span>{sep}, {/sep}{/foreach}){/if}</code>{sep}, {/sep}
  220. {/foreach}
  221. </p>
  222. {/foreach}
  223. {/if}
  224. {var $ownConstants = $class->ownConstants}
  225. {var $inheritedConstants = $class->inheritedConstants}
  226. {if $ownConstants || $inheritedConstants}
  227. <h2>Constants summary</h2>
  228. <table class="summary table table-bordered table-striped constants" id="constants" n:if="$ownConstants">
  229. <tr n:foreach="$ownConstants as $constant" data-order="{$constant->name}" id="{$constant->name}">
  230. {var $annotations = $constant->annotations}
  231. <td class="attributes"><code>{!$constant->typeHint|typeLinks:$constant}</code></td>
  232. <td class="name">
  233. <code>
  234. {if $class->internal}
  235. <a href="{$constant|manualUrl}" title="Go to PHP documentation"><b>{$constant->name}</b></a>
  236. {else}
  237. <a n:tag-if="$config->sourceCode" href="{$constant|sourceUrl}" title="Go to source code"><b>{$constant->name}</b></a>
  238. {/if}
  239. </code>
  240. <div n:if="$config->template['options']['elementDetailsCollapsed']" class="description short">
  241. {!$constant|shortDescription:true}
  242. </div>
  243. <div n:class="description, detailed, $config->template['options']['elementDetailsCollapsed'] ? hidden">
  244. {!$constant|longDescription}
  245. {foreach $template->annotationSort($template->annotationFilter($annotations, array('var'))) as $annotation => $descriptions}
  246. <h4>{$annotation|annotationBeautify}</h4>
  247. <div class="list">
  248. {foreach $descriptions as $description}
  249. {if $description}
  250. {!$description|annotation:$annotation:$constant}<br>
  251. {/if}
  252. {/foreach}
  253. </div>
  254. {/foreach}
  255. </div>
  256. </td>
  257. <td class="value"><div><a href="#{$constant->name}" class="anchor">#</a><code>{!$constant->valueDefinition|highlightValue:$class}</code></div></td>
  258. </tr>
  259. </table>
  260. {foreach $inheritedConstants as $parentName => $constants}
  261. <h3>Constants inherited from <a href="{$parentName|classUrl}#constants" n:tag-if="$template->getClass($parentName)">{$parentName}</a></h3>
  262. <p class="elementList">
  263. {foreach $constants as $constant}
  264. <code><a href="{$constant|constantUrl}" n:tag-if="$template->getClass($parentName)"><b><span n:tag-if="$constant->deprecated" class"deprecated">{$constant->name}</span></b></a></code>{sep}, {/sep}
  265. {/foreach}
  266. </p>
  267. {/foreach}
  268. {/if}
  269. {var $ownProperties = $class->ownProperties}
  270. {var $inheritedProperties = $class->inheritedProperties}
  271. {var $usedProperties = $class->usedProperties}
  272. {var $ownMagicProperties = $class->ownMagicProperties}
  273. {var $inheritedMagicProperties = $class->inheritedMagicProperties}
  274. {var $usedMagicProperties = $class->usedMagicProperties}
  275. {if $ownProperties || $inheritedProperties || $usedProperties || $ownMagicProperties || $inheritedMagicProperties || $usedMagicProperties}
  276. {define #property}
  277. <tr data-order="{$property->name}" id="{if $property->magic}m{/if}${$property->name}">
  278. <td class="attributes"><code>
  279. {if $property->protected}protected{elseif $property->private}private{else}public{/if} {if $property->static}static{/if} {if $property->readOnly}read-only{elseif $property->writeOnly}write-only{/if}
  280. {!$property->typeHint|typeLinks:$property}
  281. </code></td>
  282. <td class="name">
  283. {if $class->internal}
  284. <a href="{$property|manualUrl}" title="Go to PHP documentation"><var>${$property->name}</var></a>
  285. {else}
  286. <a n:tag-if="$config->sourceCode" href="{$property|sourceUrl}" title="Go to source code"><var>${$property->name}</var></a>
  287. {/if}
  288. <div n:if="$config->template['options']['elementDetailsCollapsed']" class="description short">
  289. {!$property|shortDescription:true}
  290. </div>
  291. <div n:class="description, detailed, $config->template['options']['elementDetailsCollapsed'] ? hidden">
  292. {!$property|longDescription}
  293. {foreach $template->annotationSort($template->annotationFilter($property->annotations, array('var'))) as $annotation => $descriptions}
  294. <h4>{$annotation|annotationBeautify}</h4>
  295. <div class="list">
  296. {foreach $descriptions as $description}
  297. {if $description}
  298. {!$description|annotation:$annotation:$property}<br>
  299. {/if}
  300. {/foreach}
  301. </div>
  302. {/foreach}
  303. </div>
  304. </td>
  305. <td n:if="!$property->magic" class="value"><div><a href="#{if $property->magic}m{/if}${$property->name}" class="anchor">#</a><code>{!$property->defaultValueDefinition|highlightValue:$class}</code></div></td>
  306. </tr>
  307. {/define}
  308. <h2>Properties summary</h2>
  309. <table class="summary table table-bordered table-striped properties" id="properties" n:if="$ownProperties">
  310. {foreach $ownProperties as $property}
  311. {include #property, property => $property}
  312. {/foreach}
  313. </table>
  314. {foreach $inheritedProperties as $parentName => $properties}
  315. <h3>Properties inherited from <a href="{$parentName|classUrl}#properties" n:tag-if="$template->getClass($parentName)">{$parentName}</a></h3>
  316. <p class="elementList">
  317. {foreach $properties as $property}
  318. <code><a href="{$property|propertyUrl}" n:tag-if="$template->getClass($parentName)"><var><span n:tag-if="$property->deprecated" class="deprecated">${$property->name}</span></var></a></code>{sep}, {/sep}
  319. {/foreach}
  320. </p>
  321. {/foreach}
  322. {foreach $usedProperties as $traitName => $properties}
  323. <h3>Properties used from <a href="{$traitName|classUrl}#properties" n:tag-if="$template->getClass($traitName)">{$traitName}</a></h3>
  324. <p class="elementList">
  325. {foreach $properties as $property}
  326. <code><a href="{$property|propertyUrl:$property->declaringTrait}" n:tag-if="$template->getClass($traitName)"><var><span n:tag-if="$property->deprecated" class="deprecated">${$property->name}</span></var></a></code>{sep}, {/sep}
  327. {/foreach}
  328. </p>
  329. {/foreach}
  330. {if $ownMagicProperties}
  331. <h3>Magic properties</h3>
  332. <table class="summary table table-bordered table-striped properties" id="magicProperties">
  333. {foreach $ownMagicProperties as $property}
  334. {include #property, property => $property}
  335. {/foreach}
  336. </table>
  337. {/if}
  338. {foreach $inheritedMagicProperties as $parentName => $properties}
  339. <h3>Magic properties inherited from <a href="{$parentName|classUrl}#properties" n:tag-if="$template->getClass($parentName)">{$parentName}</a></h3>
  340. <p class="elementList">
  341. {foreach $properties as $property}
  342. <code><a href="{$property|propertyUrl}" n:tag-if="$template->getClass($parentName)"><var><span n:tag-if="$property->deprecated" class="deprecated">${$property->name}</span></var></a></code>{sep}, {/sep}
  343. {/foreach}
  344. </p>
  345. {/foreach}
  346. {foreach $usedMagicProperties as $traitName => $properties}
  347. <h3>Magic properties used from <a href="{$traitName|classUrl}#properties" n:tag-if="$template->getClass($traitName)">{$traitName}</a></h3>
  348. <p class="elementList">
  349. {foreach $properties as $property}
  350. <code><a href="{$property|propertyUrl:$property->declaringTrait}" n:tag-if="$template->getClass($traitName)"><var><span n:tag-if="$property->deprecated" class="deprecated">${$property->name}</span></var></a></code>{sep}, {/sep}
  351. {/foreach}
  352. </p>
  353. {/foreach}
  354. {/if}
  355. {else}
  356. <div class="alert alert-error">
  357. <p>
  358. Documentation of this class could not be generated.
  359. </p>
  360. <p>
  361. Class was originally declared in {$class->fileName|relativePath} and is invalid because of:
  362. </p>
  363. <ul>
  364. <li n:foreach="$class->reasons as $reason">Class was redeclared in {$reason->getSender()->getFileName()|relativePath}.</li>
  365. </ul>
  366. </div>
  367. {/if}
  368. </div>
  369. {/block}