Skip to content

Multiple layouts support - #8

Merged
hidakatsuya merged 2 commits into
masterfrom
multiple-layout-support
Nov 22, 2015
Merged

Multiple layouts support#8
hidakatsuya merged 2 commits into
masterfrom
multiple-layout-support

Conversation

@hidakatsuya

Copy link
Copy Markdown
Contributor

Basic concept

$report = new Thinreports\Report('/path/to/layout_default.tlf');

// 1st page: layout_default.tlf
$page = $report->addPage();

// 2nd page: layout_other1.tlf
$page = $report->addPage('/path/to/layout_other1.tlf');

// 3rd page: layout_other2.tlf
$page = $report->addPage('/path/to/layout_other2.tlf');

Schema for Report#addPage

/**
 * @param string $layout_file (default = null)
 * @param boolean $countable (default = true)
 * @return Report\Page
 */
Report#addPage($layout_file = null, $countable = true);

Example

Without default layout

$report = new Thinreports\Report();

$report->addPage('/path/to/layout1.tlf');
$report->addPage(); // Error!

With $countable option

$report = new Thinreports\Report('/path/to/default_layout.tlf');

/**
 * $layout_file = /path/to/default_layout.tlf
 * $countable = false
 */
$report->addPage(null, false);

/**
 * $layout_file = /path/to/other_layout.tlf
 * $countable = false
 */
$report->addPage('/path/to/other_layout.tlf', false);

@hidakatsuya hidakatsuya self-assigned this Sep 7, 2015
@hidakatsuya hidakatsuya added this to the 0.8.0 milestone Sep 7, 2015
@hidakatsuya
hidakatsuya force-pushed the multiple-layout-support branch from 2ba06fd to 5cd92b6 Compare November 22, 2015 06:03
@hidakatsuya
hidakatsuya force-pushed the multiple-layout-support branch from 5cd92b6 to a05eb85 Compare November 22, 2015 06:12
hidakatsuya added a commit that referenced this pull request Nov 22, 2015
@hidakatsuya
hidakatsuya merged commit e371300 into master Nov 22, 2015
@hidakatsuya
hidakatsuya deleted the multiple-layout-support branch November 22, 2015 06:16
@hidakatsuya hidakatsuya removed the WIP label Nov 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant