Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
Yii Dwoo renderer
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Common
Yii Dwoo renderer
Commits
abff8079
Commit
abff8079
authored
Mar 06, 2010
by
samdark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a lot of changes
git-svn-id:
http://yiiext.googlecode.com/svn/trunk/app/extensions/yiiext/renderers/dwoo@145
175f29da-e50b-11de-93f0-cd01e99e34ab
parent
c2306df8
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
19 deletions
+56
-19
EDwooViewRenderer.php
EDwooViewRenderer.php
+8
-15
changelog.txt
changelog.txt
+8
-0
readme_en.txt
readme_en.txt
+7
-4
readme_ru.txt
readme_ru.txt
+33
-0
No files found.
C
DwooViewRenderer.php
→
E
DwooViewRenderer.php
View file @
abff8079
<?php
<?php
/**
/**
* Dwoo renderer for Yii
* Dwoo view renderer
*
* Copy latest version of Dwoo (dwoo-x.x.x.tar\dwoo\) to vendors/Dwoo/.
*
* Add the following to your config file 'components' section:
*
* 'viewRenderer'=>array(
* 'class'=>'application.extensions.Dwoo.CDwooViewRenderer',
* 'fileExtension' => '.tpl',
* //'pluginsDir' => 'application.dwooPlugins',
* ),
*
*
* @author Alexander Makarov <sam@rmcreative.ru>
* @author Alexander Makarov <sam@rmcreative.ru>
* @link http://
www.yiiframework.com
/
* @link http://
code.google.com/p/yiiext
/
* @link http://dwoo.org/
* @link http://dwoo.org/
*
*
* @version 0.9
* @version 0.9
.1
*/
*/
class
C
DwooViewRenderer
extends
CApplicationComponent
implements
IViewRenderer
{
class
E
DwooViewRenderer
extends
CApplicationComponent
implements
IViewRenderer
{
public
$fileExtension
=
'.tpl'
;
public
$fileExtension
=
'.tpl'
;
public
$filePermission
=
0755
;
public
$filePermission
=
0755
;
public
$pluginsDir
=
null
;
public
$pluginsDir
=
null
;
...
@@ -84,10 +74,13 @@ class CDwooViewRenderer extends CApplicationComponent implements IViewRenderer {
...
@@ -84,10 +74,13 @@ class CDwooViewRenderer extends CApplicationComponent implements IViewRenderer {
public
function
renderFile
(
$context
,
$sourceFile
,
$data
,
$return
)
{
public
function
renderFile
(
$context
,
$sourceFile
,
$data
,
$return
)
{
// current controller properties will be accessible as {this.property}
// current controller properties will be accessible as {this.property}
$data
[
'this'
]
=
$context
;
$data
[
'this'
]
=
$context
;
$data
[
'Yii'
]
=
Yii
::
app
();
$data
[
"TIME"
]
=
sprintf
(
'%0.5f'
,
Yii
::
getLogger
()
->
getExecutionTime
());
$data
[
"MEMORY"
]
=
round
(
Yii
::
getLogger
()
->
getMemoryUsage
()
/
(
1024
*
1024
),
2
)
.
" MB"
;
// check if view file exists
// check if view file exists
if
(
!
is_file
(
$sourceFile
)
||
(
$file
=
realpath
(
$sourceFile
))
===
false
)
if
(
!
is_file
(
$sourceFile
)
||
(
$file
=
realpath
(
$sourceFile
))
===
false
)
throw
new
CException
(
Yii
::
t
(
'yii'
,
'View file "{file}" does not exist.'
,
array
(
'{file}'
=>
$sourceFile
)));
throw
new
CException
(
Yii
::
t
(
'yii
ext
'
,
'View file "{file}" does not exist.'
,
array
(
'{file}'
=>
$sourceFile
)));
//render
//render
return
$this
->
dwoo
->
get
(
$sourceFile
,
$data
);
return
$this
->
dwoo
->
get
(
$sourceFile
,
$data
);
...
...
changelog.txt
View file @
abff8079
0.9.1
[*] Changed translation category to 'yiiext'.
[*] New naming conventions.
[+] readme_ru.
[+] Added Yii varialbe.
[+] Added TIME and MEMORY variables.
0.9
0.9
[+] Initial public release.
[+] Initial public release.
\ No newline at end of file
readme_en.txt
View file @
abff8079
CDwooViewR
enderer
Dwoo view r
enderer
=================
=================
=
This extension allows you to use [Dwoo](http://dwoo.org/) templates in Yii.
This extension allows you to use [Dwoo](http://dwoo.org/) templates in Yii.
###Resources
###Resources
* [SVN](http://code.google.com/p/yiiext/source/browse/
#svn/trunk/app/extensions/CDwooViewRenderer
)
* [SVN](http://code.google.com/p/yiiext/source/browse/
trunk/app/extensions#extensions/yiiext/renderers/dwoo
)
* [Dwoo](http://dwoo.org/)
* [Dwoo](http://dwoo.org/)
* [Discuss](http://www.yiiframework.com/forum/index.php?/topic/4965-dwoo-view-renderer/)
* [Discuss](http://www.yiiframework.com/forum/index.php?/topic/4965-dwoo-view-renderer/)
* [Report a bug](http://code.google.com/p/yiiext/issues/list)
* [Report a bug](http://code.google.com/p/yiiext/issues/list)
...
@@ -19,7 +19,7 @@ This extension allows you to use [Dwoo](http://dwoo.org/) templates in Yii.
...
@@ -19,7 +19,7 @@ This extension allows you to use [Dwoo](http://dwoo.org/) templates in Yii.
~~~
~~~
[php]
[php]
'viewRenderer'=>array(
'viewRenderer'=>array(
'class'=>'
application.extensions.CDwooViewRenderer.C
DwooViewRenderer',
'class'=>'
ext.yiiext.renderers.dwoo.E
DwooViewRenderer',
'fileExtension' => '.tpl',
'fileExtension' => '.tpl',
//'pluginsDir' => 'application.dwooPlugins',
//'pluginsDir' => 'application.dwooPlugins',
),
),
...
@@ -28,3 +28,5 @@ This extension allows you to use [Dwoo](http://dwoo.org/) templates in Yii.
...
@@ -28,3 +28,5 @@ This extension allows you to use [Dwoo](http://dwoo.org/) templates in Yii.
###Usage
###Usage
* [Dwoo syntax](http://wiki.dwoo.org/index.php/Syntax).
* [Dwoo syntax](http://wiki.dwoo.org/index.php/Syntax).
* Current controller properties are accessible via {$this->pageTitle}.
* Current controller properties are accessible via {$this->pageTitle}.
* Yii properties are available as follows: {$Yii->theme->baseUrl}.
* Used memory is stored in {$MEMORY}, used time is in {$TIME}.
\ No newline at end of file
readme_ru.txt
0 → 100644
View file @
abff8079
Шаблонизатор Dwoo для Yii
=========================
Данное расширение позволяет использовать [Dwoo](http://dwoo.org/) в шаблонах Yii.
###Полезные ссылки
* [SVN](http://code.google.com/p/yiiext/source/browse/trunk/app/extensions#extensions/yiiext/renderers/dwoo)
* [Dwoo](http://dwoo.org/)
* [Обсуждение](http://yiiframework.ru/forum/viewtopic.php?f=9&t=245)
* [Соощить об ошибке](http://code.google.com/p/yiiext/issues/list)
###Требования
* Yii 1.0 и выше
###Установка
* Распаковать в `protected/extensions`.
* [Скачать](http://dwoo.org/download) и распаковать `dwoo-x.x.x.tar\dwoo\` в `protected/vendors/Dwoo`.
* Добавить в конфигурацю в секцию 'components':
~~~
[php]
'viewRenderer'=>array(
'class'=>'ext.yiiext.renderers.dwoo.EDwooViewRenderer',
'fileExtension' => '.tpl',
//'pluginsDir' => 'application.dwooPlugins',
),
~~~
###Использование
* [Синтаксис Dwoo](http://wiki.dwoo.org/index.php/Syntax).
* Свойства текущего контроллера доступны как {$this->pageTitle}.
* Свойства Yii доступны как {$Yii->theme->baseUrl}.
* Использованную память можно вывести как {$MEMORY}, затраченное время как {$TIME}.
\ 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