示例#1
0
 public function __construct($content = [], $template_file = null, $options = [])
 {
     // Load the specified template, or the default navbar template
     if ($template_file) {
         parent::__construct($content, $template_file, $options);
     } else {
         parent::__construct($content, null, $options);
     }
     // Set the alignment of this component, if specified.
     if (isset($content['@align'])) {
         $this->align($content['@align']);
     }
     if (isset($content['@data'])) {
         $this->dataAttributes($content['@data']);
     }
     if (isset($content['@css_classes'])) {
         $this->cssClasses($content['@css_classes']);
     }
 }
示例#2
0
 public function __construct($content = [], $template_file = null, $options = [])
 {
     // Load the specified template, or the default cell template
     if ($template_file) {
         parent::__construct($content, $template_file, $options);
     } else {
         parent::__construct($content, null, $options);
         $this->setTemplate("<th class='{{_sorter}}'>{{_label}} <i class='fa fa-sort'></i></th>");
         // Default is hardcoded for now
     }
     // Set the cell template
     if (isset($content['@cell_template'])) {
         $this->_cell_template = $content['@cell_template'];
     } else {
         throw new \Exception("Each column in a TableBuilder must specify a '@cell_template' field.");
     }
     // Set the column sorter
     if (isset($content['@sorter'])) {
         $this->_sorter = $content['@sorter'];
     } else {
         $this->_sorter = null;
     }
     // Set the column sort field
     if (isset($content['@sort_field'])) {
         $this->_sort_field = $content['@sort_field'];
     } else {
         $this->_sort_field = null;
     }
     // Set the initial sort direction
     if (isset($content['@initial_sort_direction'])) {
         $this->_initial_sort_direction = $content['@initial_sort_direction'];
     } else {
         $this->_initial_sort_direction = null;
     }
     // Set the display mode
     if (isset($content['@display'])) {
         $this->_display = $content['@display'];
     } else {
         $this->_display = null;
     }
     if (isset($content['@label'])) {
         $this->label($content['@label']);
     }
     // Set the empty template
     if (isset($content['@empty_template'])) {
         $this->_empty_template = $content['@empty_template'];
     } else {
         $this->_empty_template = null;
     }
     // Set the empty field
     if (isset($content['@empty_field'])) {
         $this->_empty_field = $content['@empty_field'];
     } else {
         $this->_empty_field = null;
     }
     // Set the empty value
     if (isset($content['@empty_value'])) {
         $this->_empty_value = $content['@empty_value'];
     } else {
         $this->_empty_value = null;
     }
 }
示例#3
0
 public function __construct($content = [], $template_file = null, $options = [])
 {
     // Load the specified template, or the default navbar template
     if ($template_file) {
         parent::__construct($content, $template_file, $options);
     } else {
         parent::__construct($content, null, $options);
         $this->setTemplate("<option class='{{_css_classes}}' value='{{_item_value}}' {{_data}} {{_selected}}>{{_label}}</option>");
     }
     if (isset($content['@item_value'])) {
         $this->itemValue($content['@item_value']);
     }
     if (isset($content['@label'])) {
         $this->label($content['@label']);
     }
     if (isset($content['@title'])) {
         $this->title($content['@title']);
     }
     if (isset($content['@selected'])) {
         $this->selected($content['@selected']);
     }
     if (isset($content['@data'])) {
         $this->dataAttributes($content['@data']);
     }
     if (isset($content['@css_classes'])) {
         $this->cssClasses($content['@css_classes']);
     }
 }
 public function __construct($content = [], $template_file = null, $options = [])
 {
     // Load the specified template, or the default navbar template
     if ($template_file) {
         parent::__construct($content, $template_file, $options);
     } else {
         parent::__construct($content, null, $options);
         parent::setTemplate("<li class='{{_active}} {{_display}}'><a role='menuitem' class='{{_css_classes}}' {{_data}} href='{{_url}}'>{{_label}}</a></li>");
     }
     if (isset($content['@label'])) {
         $this->label($content['@label']);
     }
     if (isset($content['@url'])) {
         $this->url($content['@url']);
     }
     // Initialize @display if passed in
     if (isset($content['@display'])) {
         $this->display($content['@display']);
     }
     // Initialize @active if passed in
     if (isset($content['@active'])) {
         $this->active($content['@active']);
     }
     if (isset($content['@data'])) {
         $this->dataAttributes($content['@data']);
     }
     if (isset($content['@css_classes'])) {
         $this->cssClasses($content['@css_classes']);
     }
 }
示例#5
0
 public function __construct($content = [], $template_file = null, $options = [])
 {
     // Load the specified template, or the default footer template
     if ($template_file) {
         parent::__construct($content, $template_file, $options);
     } else {
         parent::__construct($content, "pages/footers/footer-default.html", $options);
     }
     // If '@js_includes' is specified, set it.
     if (isset($content['@js_includes'])) {
         $this->_js_includes = $content['@js_includes'];
     }
 }