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
fa3ec4d7
Commit
fa3ec4d7
authored
Aug 08, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring the view class.
parent
d8d0ddfa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
22 deletions
+6
-22
view.php
system/view.php
+6
-22
No files found.
system/view.php
View file @
fa3ec4d7
...
...
@@ -115,10 +115,7 @@ class View {
$path
=
(
$module
==
'application'
)
?
VIEW_PATH
:
MODULE_PATH
.
$module
.
'/views/'
;
if
(
$module
!=
'application'
)
{
$view
=
substr
(
$view
,
strpos
(
$view
,
':'
)
+
2
);
}
if
(
$module
!=
'application'
)
$view
=
substr
(
$view
,
strpos
(
$view
,
':'
)
+
2
);
return
array
(
$module
,
$path
,
$view
);
}
...
...
@@ -162,7 +159,7 @@ class View {
{
if
(
is_callable
(
$value
))
return
$value
;
}
}
}
/**
* Load the view composers for a given module.
...
...
@@ -193,7 +190,10 @@ class View {
throw
new
\Exception
(
"View [
$view
] does not exist."
);
}
$this
->
get_sub_views
();
foreach
(
$this
->
data
as
&
$data
)
{
if
(
$data
instanceof
View
or
$data
instanceof
Response
)
$data
=
(
string
)
$data
;
}
extract
(
$this
->
data
,
EXTR_SKIP
);
...
...
@@ -204,22 +204,6 @@ class View {
return
ob_get_clean
();
}
/**
* Evaluate all of the view and response instances that are bound to the view.
*
* @return void
*/
private
function
get_sub_views
()
{
foreach
(
$this
->
data
as
&
$data
)
{
if
(
$data
instanceof
View
or
$data
instanceof
Response
)
{
$data
=
(
string
)
$data
;
}
}
}
/**
* Add a view instance to the 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