ProcessWire - Debugging Snippets: Unterschied zwischen den Versionen
Aus Wikizone
| Zeile 6: | Zeile 6: | ||
$out .= "{$field->name}, "; | $out .= "{$field->name}, "; | ||
} | } | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | == Marker Regions Debuggen == | ||
| + | <syntaxhighlight lang="php"> | ||
| + | <?php namespace ProcessWire; | ||
| + | |||
| + | if(config()->debug && user()->isSuperuser()): // display region debugging info ?> | ||
| + | <section id='debug' class='uk-section uk-section-muted'> | ||
| + | <div class='uk-container'> | ||
| + | <h4>ProcessWire Region Markup Debugging</h4> | ||
| + | <!--PW-REGION-DEBUG--> | ||
| + | </div> | ||
| + | </section> | ||
| + | <?php endif; ?> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Aktuelle Version vom 1. August 2018, 15:30 Uhr
Alle Feldnamen einer Seite ausgeben[Bearbeiten]
//get all the fields:
$all_fields = $page->fields;
foreach($all_fields as $field){
$out .= "{$field->name}, ";
}
Marker Regions Debuggen[Bearbeiten]
<?php namespace ProcessWire;
if(config()->debug && user()->isSuperuser()): // display region debugging info ?>
<section id='debug' class='uk-section uk-section-muted'>
<div class='uk-container'>
<h4>ProcessWire Region Markup Debugging</h4>
<!--PW-REGION-DEBUG-->
</div>
</section>
<?php endif; ?>