Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple layouts support #8

Merged
merged 2 commits into from Nov 22, 2015
Merged

Multiple layouts support #8

merged 2 commits into from Nov 22, 2015

Conversation

hidakatsuya
Copy link
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 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.

None yet

1 participant