ProcessWire - Debugging Snippets: Unterschied zwischen den Versionen

Aus Wikizone
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „<syntaxhighlight lang="php"> //get all the fields: $all_fields = $page->fields; foreach($all_fields as $field){ $out .= "{$field->name}, "; } </syntaxhighlight>“)
 
 
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt)
Zeile 1: Zeile 1:
 +
== Alle Feldnamen einer Seite ausgeben ==
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
 
//get all the fields:
 
//get all the fields:
Zeile 5: 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; ?>