Welcome Guest, Not a member yet? Register   Sign In
Really Simple Smarty 3 Library for Codeigniter
#31

[eluser]irrg[/eluser]
gotcha. Thanks for your speed on this. Hope the protected thing gets fixed in Reactor soon, 'cause that sounds like a bad idea.
#32

[eluser]Vheissu[/eluser]
[quote author="irrg" date="1304932751"]gotcha. Thanks for your speed on this. Hope the protected thing gets fixed in Reactor soon, 'cause that sounds like a bad idea.[/quote]

Yeah man, it's even broken Modular Extensions apparently and a few other things as well. I might go trawling through the commits looking for who made the change and why.
#33

[eluser]kristapsv[/eluser]
Hi, first of all thank you for the smarty CI integration, but I have some trouble putting it together with Phil Sturgeon's template library.

The problem is that in layout file the php code gets executed, but in view file only smarty code.

I want that in all view and layout files only smarty language code gets executed.

Codeigniter 2.0.2
Ci-Smarty
Phil Sturgeon's template library

I have 1 controller, 1 layout and 1 view file

Controller:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Home extends MY_Controller {
    public function index()
    {        
        $this->template->title('test');
        $this->template->set_layout('default.tpl','main')->build('main/home.tpl');
    }
}

/* End of file home.php */
/* Location: ./application/controllers/home.php */


layout file default.tpl
Code:
<!DOCTYPE html>
&lt;html&gt;&lt;?php die('This shoudnt happen'); ?&gt;
    &lt;head&gt;
        &lt;title&gt;{$template.title}&lt;/title&gt;
        {$template.metadata}
    &lt;/head&gt;
    &lt;body&gt;
        <h1>{$template.title}</h1>
        {$template.body}
    &lt;/body&gt;
&lt;/html&gt;

view file home.tpl
Code:
{assign var=foo value='baa'}{$foo}&lt;?php echo 'PHP is ingored here'; ?&gt;

Template library config:
parser_enabled = TRUE
parser_body_enabled = TRUE

May I shoudn't use then layout feature in template library as Smarty provide capabilities for layouts via template inheritance anyway ?
#34

[eluser]eggzy[/eluser]
I'm having problems with this library working with phil's template library.
I have front_controller which loads layout:

Code:
$this->template
->set_theme('default')
->set_layout('default.html');

and I have modules and in every module view is passed like this:

Code:
$this->template
->title('Posts')
->build('posts', $data);

and view:

Code:
&lt;?php foreach ($query as $row): ?&gt;

    <h2>&lt;?php echo $row['title']; ?&gt;</h2>

    &lt;?php echo $row['content']; ?&gt;

&lt;?php endforeach; ?&gt;

When I upload MY_Parser.php everything breaks but when I remove it posts are shown normally.

I'd like in front layout to use smarty tags like {body} or similar to show modules.




Theme © iAndrew 2016 - Forum software by © MyBB