157 $this->
id = sanitize_title(
$id );
158 $this->
class = WPDKHtmlTag::sanitizeClasses( $class );
160 $this->superview = null;
161 $this->subviews = array();
215 public function display()
221 <div data-type=
"wpdk-view"
222 style=
"<?php echo $style ?>"
223 id=
"<?php echo $this->id ?>"
224 class=
"<?php echo $classes ?>" <?php echo
$data ?> >
226 <?php do_action(
'wpdk_view_' . $this->
id .
'_before_draw', $this ) ?>
228 <?php do_action(
'wpdk_view_will_draw_content', $this ) ?>
229 <?php $this->
draw() ?>
230 <?php do_action(
'wpdk_view_did_draw_content', $this ) ?>
232 <?php do_action(
'wpdk_view_' . $this->
id .
'_after_draw', $this ) ?>
234 <?php
if ( is_array( $this->subviews ) ) : ?>
239 foreach ( $this->subviews as $view ) : ?>
240 <?php $view->display() ?>
244 <?php do_action(
'wpdk_view_' . $this->
id .
'_before_close', $this ) ?>
275 $continue = apply_filters(
'wpdk_view_should_add_subview',
true, $view );
277 $view->superview = $this;
278 $this->subviews[$view->id] = $view;
279 do_action(
'wpdk_view_did_add_subview', $view );
291 if ( !empty( $this->superview ) ) {
292 unset( $this->superview->subviews[$this->id] );