{"id":6301,"date":"2013-01-13T13:13:33","date_gmt":"2013-01-13T04:13:33","guid":{"rendered":"http:\/\/nanoappli.com\/blog\/?p=6301"},"modified":"2013-01-13T13:13:33","modified_gmt":"2013-01-13T04:13:33","slug":"smartycall-of-unknown-method-assign_by_ref%e3%82%a8%e3%83%a9%e3%83%bc%e3%81%8c%e5%87%ba%e3%82%8b%e7%90%86%e7%94%b1","status":"publish","type":"post","link":"http:\/\/nanoappli.com\/blog\/archives\/6301","title":{"rendered":"[Smarty]&#8221;Call of unknown method &#8216;assign_by_ref&#8221;\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u7406\u7531"},"content":{"rendered":"<p>\nPHP\u3067\u3001Smarty\u3092\u4f7f\u3063\u305f\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u5834\u5408\u304c\u6709\u308a\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/nanoappli.com\/blog\/wp-content\/uploads\/2013\/01\/20130113_01.jpg\"><img loading=\"lazy\" src=\"http:\/\/nanoappli.com\/blog\/wp-content\/uploads\/2013\/01\/20130113_01-500x65.jpg\" alt=\"\" title=\"20130113_01\" width=\"500\" height=\"65\" class=\"alignnone size-large wp-image-6305\" srcset=\"http:\/\/nanoappli.com\/blog\/wp-content\/uploads\/2013\/01\/20130113_01-500x65.jpg 500w, http:\/\/nanoappli.com\/blog\/wp-content\/uploads\/2013\/01\/20130113_01.jpg 647w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><br \/>\n<pre lang=\"x\">\n(!) Fatal error: Uncaught exception 'SmartyException' with message \n'Call of unknown method 'assign_by_ref'.' \n\nin ...\\php\\pear\\Smarty\\sysplugins\\smarty_internal_templatebase.php on line 806\n<\/pre>\n<br \/>\n\u3053\u308c\u306f\u3001Smarty\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u306e\u30b3\u30fc\u30c9\u304cassign_by_ref()\u3092\u30b3\u30fc\u30eb\u3057\u3066\u3044\u308b\u304c\u3001\u305d\u306e\u30e1\u30bd\u30c3\u30c9\u3092Smarty\u304c\u7528\u610f\u3057\u3066\u3044\u306a\u3044\u3068\u3044\u3046\u30a8\u30e9\u30fc\u3067\u3059\u3002Smart\u3067\u306fVer2\u4ee5\u524d\u3067\u306f\u3001assign_by_ref()\u30e1\u30bd\u30c3\u30c9\u304c\u6709\u308a\u307e\u3057\u305f\u304c\u3001ver3\u304b\u3089\u306fassignByRef()\u306b\u540d\u524d\u304c\u5909\u308f\u3063\u305f\u306e\u304c\u7406\u7531\u3067\u3059\u3002<br \/>\n<br \/>\n\u5bfe\u51e6\u3059\u308b\u306b\u306f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u306e\u30b3\u30fc\u30c9\u3092\u5909\u66f4\u3059\u308b\u304b\u3001\u4f7f\u7528\u3059\u308bSmarty\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30922.x\u306b\u623b\u3057\u307e\u3059\u3002<br \/>\n<br \/>\n<br \/>\n<h2>Smarty3\u306e\u30e1\u30bd\u30c3\u30c9\u540d\u547d\u540d\u898f\u5247\u306e\u5909\u66f4<\/h2>\nSmarty\u306f\u30d0\u30fc\u30b8\u30e7\u30f33\u3067\u95a2\u6570\u306e\u547d\u540d\u898f\u5247\u304c\u3001\u30a2\u30f3\u30c0\u30fc\u30d0\u30fc\u3067\u3064\u306a\u3050\u5f62\u5f0f\u304b\u3089\u30ad\u30e3\u30e1\u30eb\u30b1\u30fc\u30b9\u306b\u5909\u66f4\u3055\u308c\u305f\u3088\u3046\u3067\u3059\u3002\u3053\u306e\u8fba\u306e\u8a73\u3057\u3044\u8a71\u306fREADME\u306b\u8f09\u3063\u3066\u308b\u306e\u3067\u3001\u5f15\u7528\u3057\u3066\u304a\u304d\u307e\u3059\u3002<br \/>\n<br \/>\n<pre lang=\"x\">\nThe Smarty 3 API has been refactored to a syntax geared\nfor consistency and modularity. The Smarty 2 API syntax is still supported, but\nwill throw a deprecation notice. You can disable the notices, but it is highly\nrecommended to adjust your syntax to Smarty 3, as the Smarty 2 syntax must run\nthrough an extra rerouting wrapper.\n\nBasically, all Smarty methods now follow the \"fooBarBaz\" camel case syntax. Also,\nall Smarty properties now have getters and setters. So for example, the property\n$smarty->cache_dir can be set with $smarty->setCacheDir('foo\/') and can be\nretrieved with $smarty->getCacheDir().\n\nSome of the Smarty 3 APIs have been revoked such as the \"is*\" methods that were\njust duplicate functions of the now available \"get*\" methods.\n<\/pre>\n<br \/>\n<br \/>\n\u3056\u3063\u304f\u308a\u65e5\u672c\u8a9e\u306b\u8a33\u3059\u3068\u4ee5\u4e0b\u306e\u69d8\u306a\u611f\u3058\u3067\u3059\u3002<br \/>\n<pre lang=\"x\">\n\u4e00\u8cab\u6027\u3068\u30e2\u30b8\u30e5\u30fc\u30eb\u5316\u306e\u89b3\u70b9\u304b\u3089\u3001Smarty3 API\u306e\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u3092\u3057\u307e\u3057\u305f\nSmarty2\u306eAPI\u95a2\u6570\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u975e\u63a8\u5968\u306eNotice\u304c\u51fa\u307e\u3059\u3002\nNotice\u3092\u7121\u52b9\u306b\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001Smarty3\u3078\u306e\u5909\u66f4\u3092\u884c\u3063\u3066\u304a\u304f\u4e8b\u3092\u5f37\u304f\u63a8\u5968\u3057\u307e\u3059\u3002\n\n\u57fa\u672c\u7684\u306b\u3001Smarty3\u306e\u30e1\u30bd\u30c3\u30c9\u306ffooBarBaz()\u307f\u305f\u3044\u306a\u611f\u3058\u3067\u3001\u30ad\u30e3\u30e1\u30eb\u30b1\u30fc\u30b9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\n\u3042\u3068\u3001\u30d7\u30ed\u30d1\u30c6\u30a3\u306fgetter\/setter\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\n\u4f8b\u3048\u3070\u3001\u30d7\u30ed\u30d1\u30c6\u30a3\"$smarty->cache_dir\"\u306f\u3001\u4ee5\u4e0b\u306e\u30e1\u30bd\u30c3\u30c9\u3067set\/get\u3067\u304d\u307e\u3059\u3002\n   $smarty->setCacheDir('foo\/')\n   $smarty->getCacheDir()\n\n\u307e\u305f\u3001Smarty2\u307e\u3067\u5b58\u5728\u3057\u3066\u3044\u305fisXxxx()\u7684\u306a\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u4e00\u90e8getXxxx()\u7684\u306a\u611f\u3058\u306b\u5909\u308f\u3063\u3066\u305f\u308a\u3082\u3057\u307e\u3059\u3002\n<\/pre>\n<br \/>\n<br \/>\n\u5177\u4f53\u7684\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30e1\u30bd\u30c3\u30c9\u540d\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n<pre lang=\"x\">\nHere is a rundown of the Smarty 3 API:\n\n$smarty->fetch($template, $cache_id = null, $compile_id = null, $parent = null)\n$smarty->display($template, $cache_id = null, $compile_id = null, $parent = null)\n$smarty->isCached($template, $cache_id = null, $compile_id = null)\n$smarty->createData($parent = null)\n$smarty->createTemplate($template, $cache_id = null, $compile_id = null, $parent = null)\n$smarty->enableSecurity()\n$smarty->disableSecurity()\n$smarty->setTemplateDir($template_dir)\n$smarty->addTemplateDir($template_dir)\n$smarty->templateExists($resource_name)\n$smarty->loadPlugin($plugin_name, $check = true)\n$smarty->loadFilter($type, $name)\n$smarty->setExceptionHandler($handler)\n$smarty->addPluginsDir($plugins_dir)\n$smarty->getGlobal($varname = null)\n$smarty->getRegisteredObject($name)\n$smarty->getDebugTemplate()\n$smarty->setDebugTemplate($tpl_name)\n$smarty->assign($tpl_var, $value = null, $nocache = false)\n$smarty->assignGlobal($varname, $value = null, $nocache = false)\n$smarty->assignByRef($tpl_var, &$value, $nocache = false)\n$smarty->append($tpl_var, $value = null, $merge = false, $nocache = false)\n$smarty->appendByRef($tpl_var, &$value, $merge = false)\n$smarty->clearAssign($tpl_var)\n$smarty->clearAllAssign()\n$smarty->configLoad($config_file, $sections = null)\n$smarty->getVariable($variable, $_ptr = null, $search_parents = true, $error_enable = true)\n$smarty->getConfigVariable($variable)\n$smarty->getStreamVariable($variable)\n$smarty->getConfigVars($varname = null)\n$smarty->clearConfig($varname = null)\n$smarty->getTemplateVars($varname = null, $_ptr = null, $search_parents = true)\n$smarty->clearAllCache($exp_time = null, $type = null)\n$smarty->clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null)\n\n$smarty->registerPlugin($type, $tag, $callback, $cacheable = true, $cache_attr = array())\n\n$smarty->registerObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())\n\n$smarty->registerFilter($type, $function_name)\n$smarty->registerResource($resource_type, $function_names)\n$smarty->registerDefaultPluginHandler($function_name)\n$smarty->registerDefaultTemplateHandler($function_name)\n\n$smarty->unregisterPlugin($type, $tag)\n$smarty->unregisterObject($object_name)\n$smarty->unregisterFilter($type, $function_name)\n$smarty->unregisterResource($resource_type)\n\n$smarty->compileAllTemplates($extention = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null)\n$smarty->clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null)\n$smarty->testInstall()\n\n\/\/ then all the getters\/setters, available for all properties. Here are a few:\n\n$caching = $smarty->getCaching();      \/\/ get $smarty->caching\n$smarty->setCaching(true);             \/\/ set $smarty->caching\n$smarty->setDeprecationNotices(false); \/\/ set $smarty->deprecation_notices\n$smarty->setCacheId($id);              \/\/ set $smarty->cache_id\n$debugging = $smarty->getDebugging();  \/\/ get $smarty->debugging\n<\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP\u3067\u3001Smarty\u3092\u4f7f\u3063\u305f\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u5834\u5408\u304c\u6709\u308a\u307e\u3059\u3002 (!) Fatal error: Uncaught exception &#8216;SmartyException&#8217; with message &#8216;Call of unknown method &#8216;assign_by_ref&#8217;.&#8217; in &#8230;\\php\\pear\\Smarty\\sysplugins\\smarty_internal_templatebase.php on line 806 \u3053\u308c\u306f\u3001Smarty\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u306e\u30b3\u30fc\u30c9\u304cassign_by_ref()\u3092\u30b3\u30fc\u30eb\u3057\u3066\u3044\u308b\u304c\u3001\u305d\u306e\u30e1\u30bd\u30c3\u30c9\u3092Sm\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[22],"tags":[177],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":6682,"url":"http:\/\/nanoappli.com\/blog\/archives\/6682","url_meta":{"origin":6301,"position":0},"title":"[Smarty]PHP\u3067\u30bb\u30c3\u30c8\u3057\u305fdefine(&#8220;KEY&#8221;, &#8220;value&#8221;)\u306e\u5b9a\u6570\u3092Smary\u3067\u8868\u793a\u3059\u308b","date":"2016\u5e741\u670813\u65e5","format":false,"excerpt":"PHP\u3067\u306f\u3001\u5b9a\u6570\u3092define()\u95a2\u6570\u3067\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 view\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306bSmart\u2026","rel":"","context":"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5459,"url":"http:\/\/nanoappli.com\/blog\/archives\/5459","url_meta":{"origin":6301,"position":1},"title":"[PHP]goto\u6587\u3092\u4f7f\u7528\u3059\u308b\u3068\u300csyntax error, unexpected T_STRING\u300d\u30a8\u30e9\u30fc\u304c\u767a\u751f","date":"2012\u5e7411\u67084\u65e5","format":false,"excerpt":"PHP\u3067goto\u6587\u3092\u4f7f\u7528\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3044\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u624b\u5143\u306e\u958b\u767a\u74b0\u5883\u3060\u3068\u52d5\u4f5c\u3059\u308b\u306e\u306b\u3001\u30b5\u30fc\u30d0\u306b\u2026","rel":"","context":"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7801,"url":"http:\/\/nanoappli.com\/blog\/archives\/7801","url_meta":{"origin":6301,"position":2},"title":"WordPress\u306e\u66f4\u65b0\u3067&#8221;Maximum execution time of 30 seconds exceeded &#8220;\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u3068\u304d\u306b\u3059\u3079\u304d\u4e8b","date":"2016\u5e7412\u670830\u65e5","format":false,"excerpt":"WordPress\u306e\u66f4\u65b0\u3092\u884c\u3046\u3068\u304d\u306b\u3001\"Maximum execution time of 30 s\u2026","rel":"","context":"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7520,"url":"http:\/\/nanoappli.com\/blog\/archives\/7520","url_meta":{"origin":6301,"position":3},"title":"[Xamarin] *.xaml.cs\u306b\u66f8\u3044\u305fInitializeComponent()\u30e1\u30bd\u30c3\u30c9\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u5834\u5408","date":"2016\u5e745\u670822\u65e5","format":false,"excerpt":"Xamarin\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3057\u3066\u3044\u308b\u3068\u304d\u3001InitializeComponent\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u2026","rel":"","context":"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2042,"url":"http:\/\/nanoappli.com\/blog\/archives\/2042","url_meta":{"origin":6301,"position":4},"title":"C#\u3067\u958b\u767a\u3092\u884c\u3046\u969b\u306b\u5b88\u308b\u3079\u304d18\u306e\u30eb\u30fc\u30eb","date":"2012\u5e744\u67082\u65e5","format":false,"excerpt":"StackOverFlow\u3067\u7d39\u4ecb\u3055\u308c\u3066\u3044\u305fC#\u3067\u958b\u767a\u3092\u884c\u3046\u969b\u306b\u5b88\u308b\u3079\u304d18\u306e\u30eb\u30fc\u30eb\u304c\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3057\u2026","rel":"","context":"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7976,"url":"http:\/\/nanoappli.com\/blog\/archives\/7976","url_meta":{"origin":6301,"position":5},"title":"[PHP]mcrypt_module_open()\u3067\u30a8\u30e9\u30fc\u201dCall to undefined method&#8221;\u304c\u51fa\u308b\u3068\u304d","date":"2017\u5e742\u67086\u65e5","format":false,"excerpt":"php\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3001mcrypt_module_open()\u30e1\u30bd\u30c3\u30c9\u3092\u30b3\u30fc\u30eb\u3057\u305f\u3068\u304d\u3001Call t\u2026","rel":"","context":"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/posts\/6301"}],"collection":[{"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/comments?post=6301"}],"version-history":[{"count":9,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/posts\/6301\/revisions"}],"predecessor-version":[{"id":6312,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/posts\/6301\/revisions\/6312"}],"wp:attachment":[{"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/media?parent=6301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/categories?post=6301"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/tags?post=6301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}