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
93e21e92
Commit
93e21e92
authored
Mar 23, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for true tempting.
Signed-off-by:
Taylor Otwell
<
taylorotwell@gmail.com
>
parent
8e8b0b8c
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
211 deletions
+111
-211
blade.php
laravel/blade.php
+81
-200
section.php
laravel/section.php
+28
-9
view.php
laravel/view.php
+2
-2
No files found.
laravel/blade.php
View file @
93e21e92
This diff is collapsed.
Click to expand it.
laravel/section.php
View file @
93e21e92
...
...
@@ -14,7 +14,7 @@ class Section {
*
* @var array
*/
p
rotected
static
$last
=
array
();
p
ublic
static
$last
=
array
();
/**
* Start injecting content into a section.
...
...
@@ -33,10 +33,15 @@ class Section {
*/
public
static
function
start
(
$section
,
$content
=
''
)
{
if
(
$content
===
''
)
ob_start
()
and
static
::
$last
[]
=
$section
;
if
(
$content
===
''
)
{
ob_start
()
and
static
::
$last
[]
=
$section
;
}
else
{
static
::
append
(
$section
,
$content
);
}
}
/**
* Inject inline content into a section.
...
...
@@ -57,14 +62,26 @@ class Section {
static
::
start
(
$section
,
$content
);
}
/**
* Stop injecting content into a section and return its contents.
*
* @return string
*/
public
static
function
yield_section
()
{
return
static
::
yield
(
static
::
stop
());
}
/**
* Stop injecting content into a section.
*
* @return
void
* @return
string
*/
public
static
function
stop
()
{
static
::
append
(
array_pop
(
static
::
$last
),
ob_get_clean
());
static
::
append
(
$last
=
array_pop
(
static
::
$last
),
ob_get_clean
());
return
$last
;
}
/**
...
...
@@ -78,11 +95,13 @@ class Section {
{
if
(
isset
(
static
::
$sections
[
$section
]))
{
$content
=
static
::
$sections
[
$section
]
.
PHP_EOL
.
$content
;
static
::
$sections
[
$section
]
=
str_replace
(
'@parent'
,
$content
,
static
::
$sections
[
$section
])
;
}
else
{
static
::
$sections
[
$section
]
=
$content
;
}
}
/**
* Get the string contents of a section.
...
...
laravel/view.php
View file @
93e21e92
...
...
@@ -349,11 +349,11 @@ class View implements ArrayAccess {
// All nested views and responses are evaluated before the main view.
// This allows the assets used by nested views to be added to the
// asset container before the main view is evaluated.
foreach
(
$data
as
&
$value
)
foreach
(
$data
as
$key
=>
$value
)
{
if
(
$value
instanceof
View
or
$value
instanceof
Response
)
{
$
value
=
$value
->
render
();
$
data
[
$key
]
=
$value
->
render
();
}
}
...
...
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