Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7498999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:39:58+00:00 2026-05-29T19:39:58+00:00

I’ve taken on a symfony project that someone else built. As such I don’t

  • 0

I’ve taken on a symfony project that someone else built. As such I don’t know that much about how it works really. I’ve been doing various changes over the last 6 months, so have a vague idea… but this problem has stumped me.

I’m optimistically hoping that you guys will be able to help, just by going off of the filenames/directory structure. So I’ll try to keep it simple.

Something I know inside…

/apps/frontend/modules/search/actions.class.php

Needs to be visible to…

/apps/frontend/modules/contact/templates/_minicontact.php

These two files are output into this template:

/apps/frontend/templates/pageDetails.php

with the following two lines of code:

<?php echo $sf_content ?>

and...

<?php include_component('contact','minicontact'); ?>

I’ve tried setting $this->myvar in the first file, and checking both $this->myVar and $myVar in the second file, and I’ve had no luck.

BODGING IS FINE. I just want the quickest and simplest way to achieve this. The client will be getting a completely new site in the next few months, so there’s no need to do this “nicely”. Just give me the quick and dirty! 🙂

I’m sure the answer is very simple… I’ve spent quite a while with get_defined_vars trying to figure out where I need to be putting it, but to no avail.

THANK YOU!

edit: Symfony v1.2, though I doubt the version makes any difference to the question.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T19:39:59+00:00Added an answer on May 29, 2026 at 7:39 pm

    UPDATE:

    I just noticed your path for pageDetails. It msut be an alternate layout. In that case you need pass the variable up to the layout. Typically this would be done with a slot from withing the view being rendered. But you havent provided enough info to know if this is going to work because you may need this value passed up from multiple views from within multiple modules.

    Therefore the easiest solution is probably going to be to jsut duplicate whatever logic produces the value in the minicontact component.

    // in /apps/frontend/modules/contact/actions/components.class.php
    public function executeMinicontact() 
    {
       // add the logic to produce the value for $myVar here and then:
       $this->myVar = 'theValue';
    }
    

    Im confused as to why $sf_content would be echoed in pageDetails.php which should be a view for a given module. Normally $sf_content would only be seen layout.php.

    Any how you pass parameter to a component or a partial like so:

    <?php include_component('contact','minicontact', array('myVar' => 'yourValue'); ?>
    

    ofcourse that assumes that the value you want to pass to minicontact is already present in the pageDetails.php. If its not then you would need to add it to the view as a variable in your actions class – for example

    // note this is the method name by convention but it may not be whats actually
    // your pageDetails.php - you can get info about what action is being executed
    // from the debug bar in the dev environment.
    public function executePageDetails(sfRequest $request)
    {
       $this->myVar = 'the value';
    }
    

    then in pageDetails.php:

    <?php include_component('contact','minicontact', array('myVar' => $myVar); ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
Does anyone know how can I replace this 2 symbol below from the string
I need a function that will clean a strings' special characters. I do NOT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.