Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
Dwoo
Project
Overview
Details
Activity
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Common
Dwoo
Commits
40315415
Commit
40315415
authored
Sep 16, 2008
by
Seldaek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Some improvements to the agavi url gen plugin
git-svn-id:
svn://dwoo.org/dwoo/trunk@181
0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent
f49e8f36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
url.php
lib/Dwoo/Adapters/Agavi/dwoo_plugins/url.php
+24
-2
No files found.
lib/Dwoo/Adapters/Agavi/dwoo_plugins/url.php
View file @
40315415
...
@@ -8,6 +8,9 @@
...
@@ -8,6 +8,9 @@
* <pre>
* <pre>
* * route : the route name, optional (by default the current url is returned)
* * route : the route name, optional (by default the current url is returned)
* * params : an array with variables to build the route, optional
* * params : an array with variables to build the route, optional
* * options : an array of options to pass to the routing object, optional
* * rest : for convenience, you can just pass named parameters that will be used as
* the params array, but you must not provide the params array in this case
* </pre>
* </pre>
*
*
* Examples:
* Examples:
...
@@ -32,7 +35,25 @@
...
@@ -32,7 +35,25 @@
* @date 2008-09-08
* @date 2008-09-08
* @package Dwoo
* @package Dwoo
*/
*/
function
Dwoo_Plugin_url_compile
(
Dwoo_Compiler
$compiler
,
$route
=
null
,
$params
=
array
())
function
Dwoo_Plugin_url_compile
(
Dwoo_Compiler
$compiler
,
$route
=
null
,
$params
=
null
,
$options
=
null
,
array
$rest
=
array
())
{
{
return
'$this->data[\'ro\']->gen('
.
$route
.
', '
.
$params
.
')'
;
if
(
$params
==
'null'
)
{
if
(
count
(
$rest
))
{
$params
=
array
();
foreach
(
$rest
as
$k
=>
$v
)
{
if
(
is_numeric
(
$k
))
{
$out
[]
=
$k
.
'=>'
.
$v
;
}
else
{
$out
[]
=
'"'
.
$k
.
'"=>'
.
$v
;
}
}
$params
=
'array('
.
implode
(
', '
,
$params
)
.
')'
;
}
else
{
$params
=
'array()'
;
}
}
if
(
$options
==
'null'
)
{
$options
=
'array()'
;
}
return
'$this->data[\'ro\']->gen('
.
$route
.
', '
.
$params
.
', '
.
$options
.
')'
;
}
}
\ No newline at end of file
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