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
090bf9b3
Commit
090bf9b3
authored
Mar 22, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added "shares" method to view instance.
parent
e96f75e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
routes.php
application/routes.php
+3
-0
index.php
application/views/home/index.php
+4
-0
view.php
laravel/view.php
+15
-0
No files found.
application/routes.php
View file @
090bf9b3
...
...
@@ -35,6 +35,9 @@
Route
::
get
(
'/'
,
function
()
{
$content
=
file_get_contents
(
path
(
'app'
)
.
'views/home/index.php'
);
$matches
=
preg_match
(
'/(\s*)@forelse(\s*\(.*\))(.+)@endforelse/m'
,
$content
);
die
(
var_dump
(
$matches
));
return
View
::
make
(
'home.index'
);
});
...
...
application/views/home/index.php
View file @
090bf9b3
...
...
@@ -101,6 +101,10 @@
<h3>
Learn the terrain.
</h3>
@forelse ($something as $something)
Do Stuff.
@endforelse
<p>
You've landed yourself on our default home page. The route that
is generating this page lives at:
...
...
laravel/view.php
View file @
090bf9b3
...
...
@@ -380,6 +380,21 @@ class View implements ArrayAccess {
return
$this
;
}
/**
* Add a key / value pair to the shared view data.
*
* Shared view data is accessible to every view created by the application.
*
* @param string $key
* @param mixed $value
* @return View
*/
public
function
shares
(
$key
,
$value
)
{
static
::
share
(
$key
,
$value
);
return
$this
;
}
/**
* Add a key / value pair to the shared view data.
*
...
...
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