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
0e4a6360
Commit
0e4a6360
authored
Mar 22, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added render_each helper.
parent
e04b7a3a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
blade.php
laravel/blade.php
+0
-14
helpers.php
laravel/helpers.php
+14
-0
view.php
laravel/view.php
+2
-2
No files found.
laravel/blade.php
View file @
0e4a6360
...
...
@@ -18,7 +18,6 @@ class Blade {
'yields'
,
'section_start'
,
'section_end'
,
'render_each'
,
);
/**
...
...
@@ -239,19 +238,6 @@ class Blade {
return
preg_replace
(
'/@endsection/'
,
'<?php \\Laravel\\Section::stop(); ?>'
,
$value
);
}
/**
* Rewrites Blade @render_each statements into View statements.
*
* @param string $value
* @return string
*/
protected
static
function
compile_render_each
(
$value
)
{
$pattern
=
static
::
matcher
(
'render_each'
);
return
preg_replace
(
$pattern
,
'$1<?php \\Laravel\\View::render_each$2; ?>'
,
$value
);
}
/**
* Get the regular expression for a generic Blade function.
*
...
...
laravel/helpers.php
View file @
0e4a6360
...
...
@@ -437,3 +437,17 @@ function render($view, $data = array())
{
return
Laravel\View
::
make
(
$view
,
$data
)
->
render
();
}
/**
* Get the rendered contents of a partial from a loop.
*
* @param string $view
* @param array $data
* @param string $iterator
* @param string $empty
* @return string
*/
function
render_each
(
$partial
,
array
$data
,
$iterator
,
$empty
=
'raw|'
)
{
return
Laravel\View
::
render_each
(
$partial
,
$data
,
$iterator
,
$empty
);
}
\ No newline at end of file
laravel/view.php
View file @
0e4a6360
...
...
@@ -232,7 +232,7 @@ class View implements ArrayAccess {
* @param string $empty
* @return string
*/
public
static
function
render_each
(
$view
,
array
$data
,
$iterator
,
$empty
=
null
)
public
static
function
render_each
(
$view
,
array
$data
,
$iterator
,
$empty
=
'raw|'
)
{
$result
=
''
;
...
...
@@ -260,7 +260,7 @@ class View implements ArrayAccess {
}
else
{
$result
=
render
(
$empty
?:
$view
.
'_empty'
);
$result
=
render
(
$empty
);
}
}
...
...
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