• Как подключить css к шаблону tpl?

    // Создаем и настраиваем Смарти
    		$this->smarty = new Smarty();
    		$this->smarty->compile_check = $this->config->smarty_compile_check;
    		$this->smarty->caching = $this->config->smarty_caching;
    		$this->smarty->cache_lifetime = $this->config->smarty_cache_lifetime;
    		$this->smarty->debugging = $this->config->smarty_debugging;
    		$this->smarty->error_reporting = E_ALL & ~E_NOTICE;
    
    		// Берем тему из настроек
    		$theme = $this->settings->theme;
    		
    
    		$this->smarty->compile_dir = $this->config->root_dir.'/compiled/'.$theme;
    		$this->smarty->template_dir = $this->config->root_dir.'/design/'.$theme.'/html';		
    
    		// Создаем папку для скомпилированных шаблонов текущей темы
    		if(!is_dir($this->smarty->compile_dir))
    			mkdir($this->smarty->compile_dir, 0777);
    						
    		$this->smarty->cache_dir = 'cache';


    <link rel="stylesheet" href="design/{$settings->theme|escape}/css/base.css">


    вот вариант для понимания, вообще все описано в самом смарти....
    Ответ написан
    Комментировать
  • Как исправить Uncaught SyntaxError: Unexpected end of input?

    как правило эта ошибка вызвана ошибкой синтаксиса:

    $(function() {
    	// Script to select all checkboxes
    	$state.on('change', function(ev) {
    		var $chcks = $("#example tbody input[type='checkbox']");
    		if($state.is(':checked')) {
    			$chcks.prop('checked', true).trigger('change');
    		}else	{
    			$chcks.prop('checked', false).trigger('change');
    		}
    	});	
    });


    если править код, то иногда последние кавычки и скобки просто удаляются и тогда $(function() { остается не закрытым и отсюда баг... нужно быть внимательным....
    Ответ написан
    Комментировать