PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, May 18, 2022

[FIXED] How to include a partial in app template (symfony)

 May 18, 2022     partial, php, symfony1     No comments   

Issue

I have created a template home.php in app/frontend/templates/home.php

I include this template if my user isn't connected. I try to include 2 partials :

<?php echo get_partial('sfGuardAuth/signin_form', array('form' => $form)) ?>
<?php echo get_partial('news/listNews', array('listNews' => $listNews)) ?>

But when I want to use variables $form and $listNews, I have errors :

Notice: Undefined variable: form

Notice: Undefined variable: listNews

Why ?


Solution

Using components resolves the problem



Answered By - Elorfin
Answer Checked By - Mildred Charles (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing