Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Smarty 3 Beta 8 Released
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
httpete
Smarty Rookie


Joined: 05 Dec 2009
Posts: 27

PostPosted: Wed Mar 17, 2010 3:46 pm    Post subject: cooking in production Reply with quote

Beta 8 is working on our production app, with thousands of lines of old smarty 2 syntax, just fine. Thanks guys, I think this is close. People notice it is faster.
Back to top
View user's profile Send private message
legende
Smarty n00b


Joined: 17 Jan 2010
Posts: 3

PostPosted: Sat Mar 20, 2010 5:22 pm    Post subject: Reply with quote

Please add functionality to assign separate cache_id for include files

{include file=... cache_lifetime=300 cache_id=$mycacheid}
Back to top
View user's profile Send private message
rustybucket
Smarty Regular


Joined: 28 Jan 2009
Posts: 60

PostPosted: Wed Mar 24, 2010 3:37 pm    Post subject: 3 Documentation Reply with quote

I may have missed it, but is there a documentation section for the Beta?

I did find the README file and it helped but was just wondering if there was a section on documentation I was missing?

Thanks!
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7255
Location: Lincoln Nebraska, USA

PostPosted: Wed Mar 24, 2010 4:06 pm    Post subject: Reply with quote

no documentation yet.
Back to top
View user's profile Send private message Visit poster's website
vorapoap
Smarty Rookie


Joined: 22 Dec 2009
Posts: 32

PostPosted: Thu Mar 25, 2010 6:09 pm    Post subject: smarty variable in argument is supposed to be reference? Reply with quote

See 2 post below... I got this all wrong.
(In case, someone misunderstand the same thing)


$smarty->register->templateFunction("func1");

function func1($args, &$smarty) {

}

This cause
"Warning: Parameter 2 to func1 expected to be a reference, value given in xxxxxxxxxxxxxxxx.php on line yy"

smarty variable in argument is supposed to be reference, isn't it?

I fixed this error by...

Mass replace

,\$_smarty_tpl->smarty

with

,&\$_smarty_tpl->smarty

Replace Result

smarty3\sysplugins\smarty_internal_compile_insert.php, 2
smarty3\sysplugins\smarty_internal_compile_private_function_plugin.php, 2
smarty3\sysplugins\smarty_internal_compile_private_object_function.php, 1
smarty3\sysplugins\smarty_internal_compile_private_registered_function.php, 3
8 items replaced in 4 files.


Last edited by vorapoap on Fri Mar 26, 2010 1:57 pm; edited 1 time in total
Back to top
View user's profile Send private message
vorapoap
Smarty Rookie


Joined: 22 Dec 2009
Posts: 32

PostPosted: Fri Mar 26, 2010 1:51 pm    Post subject: From README... Reply with quote

Quote:

PLUGINS
=======

Smarty3 are following the same coding rules as in Smarty2.
The only difference is that the template object is passed as additional third parameter.

smarty_plugintype_name (array $params, object $smarty, object $template)

The Smarty 2 plugins are still compatible as long as they do not make use of specific Smarty2 internals.


Do I understand something wrong?
$smarty object doesn't need to be a reference anymore?
Back to top
View user's profile Send private message
vorapoap
Smarty Rookie


Joined: 22 Dec 2009
Posts: 32

PostPosted: Fri Mar 26, 2010 1:56 pm    Post subject: Reply with quote

OK.. I know now..
Object in PHP5 is always passed by reference


Sorry for this confusion.
Back to top
View user's profile Send private message
cferry
Smarty Rookie


Joined: 17 Jun 2009
Posts: 9

PostPosted: Mon Mar 29, 2010 7:47 am    Post subject: Reply with quote

Ok, for Objet but what about Array ? is it passed by reference too ?
in $smarty->assign() for exemple. (assign_by_ref was replaced by assignByRef in smarty 3.0b8)
Back to top
View user's profile Send private message
cferry
Smarty Rookie


Joined: 17 Jun 2009
Posts: 9

PostPosted: Thu Apr 01, 2010 9:56 am    Post subject: Reply with quote

Hello,
Before include, test file_exists($this->getCompiledFilepath ());
to prevent PHP Warning.


File : libs/sysplugins/smarty_internal_template.php
407 : } else {
408 : include($this->getCompiledFilepath ());
409 : // check file dependencies at compiled code
410 : if ($this->smarty->compile_check) {

CÚdric
Back to top
View user's profile Send private message
ridersonthestorm
Smarty n00b


Joined: 03 Apr 2010
Posts: 1

PostPosted: Sat Apr 03, 2010 7:08 pm    Post subject: Reply with quote

I get the message that Smarty can't write to "templates_c". But templates_c has the rights: 777. What's wrong?

It works fine with Smarty stable version.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4587
Location: Hamburg / Germany

PostPosted: Sun Apr 04, 2010 2:51 pm    Post subject: Reply with quote

cferry wrote:
Hello,
Before include, test file_exists($this->getCompiledFilepath ());
to prevent PHP Warning.


File : libs/sysplugins/smarty_internal_template.php
407 : } else {
408 : include($this->getCompiledFilepath ());
409 : // check file dependencies at compiled code
410 : if ($this->smarty->compile_check) {

CÚdric


Cedric have you seen this warning? Normally the code can't get there if the file does not exists.
Back to top
View user's profile Send private message
yannickl88
Smarty n00b


Joined: 19 Apr 2010
Posts: 2

PostPosted: Mon Apr 19, 2010 8:26 pm    Post subject: Reply with quote

I still get a notice from within the smarty components.

Code:
function call 'register_resource' is unknown or deprecated. '\libs\smarty\sysplugins\smarty_internal_wrapper.php' @line 57


Love the new Smarty3 btw, I have it currently in my CMS, and it just works that much better.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4587
Location: Hamburg / Germany

PostPosted: Wed Apr 21, 2010 3:06 pm    Post subject: Reply with quote

See the README file.

$smarty->register->resource($resource_type, $function_names)
Back to top
View user's profile Send private message
yannickl88
Smarty n00b


Joined: 19 Apr 2010
Posts: 2

PostPosted: Wed Apr 21, 2010 3:48 pm    Post subject: Reply with quote

ah yes, I must have missed a function call somewhere.

Thanks Smile
Back to top
View user's profile Send private message
Hoover5555
Smarty Rookie


Joined: 25 Apr 2010
Posts: 7

PostPosted: Sun Apr 25, 2010 7:47 pm    Post subject: Reply with quote

Deleting a single cached page doesn't work

this command
$smarty->display('index.tpl', '123_1');

produces a valid cache file in the cache directory
123_1^90093ad09988b466f409a1871733c5589014713e.index.tpl.php

If I want to kill it (e.g. before expiration) then it won't get deleted
$smarty->cache->clear('index.tpl', '123_1');

However:
$smarty->cache->clearAll();
wipes the entire cache directory correctly.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP