Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
f0f9d7b2
Commit
f0f9d7b2
authored
Apr 06, 2012
by
Colin Viebrock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make Section::append public, and do a true append. Other methods are renamed but unchanged.
parent
825e8b2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
section.php
laravel/section.php
+25
-4
No files found.
laravel/section.php
View file @
f0f9d7b2
...
@@ -39,7 +39,7 @@ class Section {
...
@@ -39,7 +39,7 @@ class Section {
}
}
else
else
{
{
static
::
app
end
(
$section
,
$content
);
static
::
ext
end
(
$section
,
$content
);
}
}
}
}
...
@@ -79,19 +79,20 @@ class Section {
...
@@ -79,19 +79,20 @@ class Section {
*/
*/
public
static
function
stop
()
public
static
function
stop
()
{
{
static
::
app
end
(
$last
=
array_pop
(
static
::
$last
),
ob_get_clean
());
static
::
ext
end
(
$last
=
array_pop
(
static
::
$last
),
ob_get_clean
());
return
$last
;
return
$last
;
}
}
/**
/**
* Append content to a given section.
* Extend the content in a given section.
* The old content can be injected into the new using "@parent".
*
*
* @param string $section
* @param string $section
* @param string $content
* @param string $content
* @return void
* @return void
*/
*/
protected
static
function
app
end
(
$section
,
$content
)
protected
static
function
ext
end
(
$section
,
$content
)
{
{
if
(
isset
(
static
::
$sections
[
$section
]))
if
(
isset
(
static
::
$sections
[
$section
]))
{
{
...
@@ -103,6 +104,26 @@ class Section {
...
@@ -103,6 +104,26 @@ class Section {
}
}
}
}
/**
* Append content to a given section.
* This concatenates the old content and the new.
*
* @param string $section
* @param string $content
* @return void
*/
public
static
function
append
(
$section
,
$content
)
{
if
(
isset
(
static
::
$sections
[
$section
]))
{
static
::
$sections
[
$section
]
.=
$content
;
}
else
{
static
::
$sections
[
$section
]
=
$content
;
}
}
/**
/**
* Get the string contents of a section.
* Get the string contents of a section.
*
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment