2

I have one question. I just want to be sure when i set some value in request variable whitout storing in database to not lost that value. This work fine but what if i come after 10 days that value stay or will be removed?

Ok simple example with option field:

<field name="bg" type="list" label="Set Background">
     <option value="1"> Black </option>
     <option value="2"> Red </option>
     <option value="3"> Green </option>
</field>

What i want say: When in administration i set in list Black background of current element is changed.

But what is confused? That value is not stored in databas.Can I lose the current value if it is not stored in the database.

This now work fine. But where joomla store that value? memory:memory?

I just want to be sure that the value does not change. Bcs is faster whitout database

Its simply make model

    // Get Background

public function getBackground()
{
    if(!isset($this->bg)) 
    {
        $bg = JFactory::getApplication()->input->get('bg', 1, 'INT');

        switch($bg)
        {
            case 1: $this->bg = 'black';  break;
            case 2: $this->bg = 'red'; break;
            case 3: $this->bg = 'green'; break;

            default: $this->bg = 'white';
        }

    }

    return $this->bg;
}

And view render

<h1 style="background:<?php echo $this->bg;?>"> <?php echo $this->msg;?> </h1>
1
  • Do the options belong to a template parameter?
    – Lodder
    Aug 18, 2013 at 17:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.