Comments on: Zend Framework: Using Smarty as template engine https://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/ In my blog I'll try to describe about interesting technologies, my discovery in IT and some useful things about programming. Mon, 07 Sep 2015 23:33:45 +0000 hourly 1 https://wordpress.org/?v=6.7.1 By: strip club list https://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/comment-page-2/#comment-276456 Tue, 17 Mar 2009 17:33:55 +0000 http://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/#comment-276456 I’m against this method of incorporating smarty into ZF. This method assumes you will be rendering a smarty view with each action.

Also… this will produce an error with current versions on ZF that automatically render a view at the end of an action. With this method you must call $this->_helper->viewRenderer->setNoRender(true) in every action to disable zend from attempting to render a default view after the smarty display.

]]>
By: rate pics https://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/comment-page-2/#comment-276454 Tue, 17 Mar 2009 17:29:50 +0000 http://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/#comment-276454 This is a little outdated…

It works… but instead of using Zend::register(‘smarty’, $smarty) you should use Zend_Registry::set(‘smarty’, $smarty) and instead of using Zend::registry(‘smarty’) you should use Zend_Register::get(‘smarty’). And ofcourse you must: require_once ‘Zend/Registry.php’ in the bootstrap.

]]>
By: zendrej https://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/comment-page-2/#comment-275046 Tue, 10 Mar 2009 10:56:41 +0000 http://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/#comment-275046 I could not find ‘zend.php’ and failed to include this. I would be thankful if anyone can help me

The below index.phtml is not rendering values too

1
<?=$this->val?>

Regards,
rej

]]>
By: Getting started: Smarty View and first unit-tests | Quality matters https://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/comment-page-2/#comment-248378 Sun, 26 Oct 2008 17:17:52 +0000 http://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/#comment-248378 […] are number of Smarty_View implementations (see here, here, here and here). Personally I prefer combination of Zend’s example (see ZF manual) with some tweaks to read […]

]]>
By: phpnoise https://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/comment-page-1/#comment-241996 Wed, 01 Oct 2008 17:49:23 +0000 http://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/#comment-241996 Integrating Smarty with the Zend Framework…

Ralf Eggert wrote:

” Inspired by this article I started to play around a bit to integrate the Smarty template engine into the Zend Framework. My ambition was to minimize the required code in the controller actions but stay close to the given Zend_V…

]]>
By: clockworkbird https://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/comment-page-1/#comment-241963 Wed, 01 Oct 2008 14:36:50 +0000 http://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/#comment-241963 Использование Smarty целесообразно только в случае переноса готового проекта, использующего Smarty на ZF. Если говорить о новом проекте, то используйте Zend_Layout и Zend_View и забудьте о “лучшем шаблонном движке для PHP в мире”. Безусловно Смарти таковым и является, но при использовании ZF необходимость в нем просто отпадает.

]]>
By: arbol https://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/comment-page-1/#comment-231487 Mon, 18 Aug 2008 20:19:51 +0000 http://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/#comment-231487 Hi Amit Shah, I found this solution at Advanced Features/Objects, may be it will be useful for you.

I register the php object with an smarty method

1
2
// registering the object (will be by reference)
$smarty->register_object('foobar',$myobj);

and then use it on .tpl file like this

1
{foobar->method}

Bye

]]>
By: Amit Shah https://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/comment-page-1/#comment-219404 Fri, 04 Jul 2008 11:15:34 +0000 http://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/#comment-219404 How could I pass form element with server side validation functions through smarty?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$this->setName('frmDrawing');
$this->setName('frmDrawing');
$this->setView(new Zend_View());
        $this->getView()->headScript()->appendFile('/zenddemo/public/js/Zend/Form.js');
       
$id = new Zend_Form_Element_Hidden('id');
$name = new Zend_Form_Element_Text('name');
$drawing_name->setLabel('Drawing Name')
           ->setRequired(true)
           ->addFilter('StripTags')
           ->addFilter('StringTrim')
           ->addValidator('NotEmpty');
           
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
        $this->addElements(array($id, $name, $submit));

With default template we can create form element in model and we can pass to template.

1
<?php echo $this->form ;?>

Through above code we can show compete form and on submit method we can also check server validation which we provide in model declaration.

Is any similar way available through smarty? from where we can directly assign server validation function in model and on submit it will execute that function and return appropriate value.

Thanks

]]>
By: PHP Framework Resource Guide « Ammasajan’s Weblog https://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/comment-page-1/#comment-216533 Thu, 26 Jun 2008 08:36:23 +0000 http://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/#comment-216533 […] Using Smarty as template engine […]

]]>
By: Martin Rusev Blog about web development and graphic design » Blog Archive » Loading Smarty on Demand in Zend Framework https://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/comment-page-1/#comment-214538 Wed, 18 Jun 2008 18:25:49 +0000 http://kpumuk.info/php/zend-framework-using-smarty-as-template-engine/#comment-214538 […] in Zend Framework and i search through the web to find proper resolution for my problem. I found this article and another one inspired by the first. I tested both approaches but they were not what i […]

]]>