getThemeElement method

The getThemeElement method will echo the buffered view components that from another view component.

Basic Usage

The basic usage for getThemeElement method.

getThemeElement(string $view_location [,array $__forward=array() [, int $cacheable=0]]): $this

Parameters

There is 2 required parameters and 1 optional parameter.

$view_location

Location relatives to a theme and file name of view without .php suffix.

$__forward

Data that will be passed to buffered view component.

$cacheable

This parameter value allowed the buffered view cached with expected time value in second(s).

Example Usage

Usually this method called inside a layout file. Here is the basic example for getThemeElement method. Here is the content of col-1.php layout file.

<!DOCTYPE html>
<html>
<?php $this->getThemeElement("page/html/head",$__forward); ?>
<body>
  ...
</body>
</html>

Here is the full file and directory structures for page/html/head.

seme-framework/
├── app/                    # Application directory
│   └── view/             # View files
│       └── front/          # Front-end views, based on loaded theme
│           └── page/       # Page-specific views
│               ├── col-1.php
│               └── html/
│                   └── head.php

And then here is the example content of page/html/head.

<head>
  <!-- Basic page needs -->
  <meta charset="utf-8">
  <!-- Mobile specific metas  -->
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <!--[if IE]>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <![endif]-->
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <title><?php echo $this->getTitle(); ?></title>
  <meta name="language" content="id" />
  <meta name="description" content="<?php echo $this->getDescription(); ?>"/>
  <meta name="keyword" content="<?php echo $this->getKeyword(); ?>"/>
  <meta name="author" content="<?php echo $this->getAuthor(); ?>">
  <link rel="icon" href="<?php echo $this->getIcon(); ?>" type="image/x-icon" />
  <link rel="shortcut icon" href="<?php echo $this->getShortcutIcon(); ?>" type="image/x-icon" />
  <meta name="robots" content="<?php echo $this->getRobots(); ?>" />

  <?php $this->getAdditionalBefore(); ?>
  <?php $this->getAdditional(); ?>
  <?php $this->getAdditionalAfter(); ?>
</head>