0
Guys is the following, I have a standard html file, which contains :
<header data-color="<?php echo $client->client_color; ?>">
<h1>
<?php if($client->client_image != ''): ?>
<img src="<?php echo $client->client_image; ?>" alt="<?php echo $client->name; ?>"/>
<?php else: ?>
<?php echo lang('client_title'); ?></h1>
<?php endif; ?>
...
But I did a function in the controller, so the client has the option to pass the image and color by parameter in the url :
private function SetImageAndColor($client_id) {
if(isset($_GET['color']) AND isset($_GET['image'])) {
$dados['client'] [$client_id] ['image'] = $this->input->get('image');
$dados['client'] [$client_id] ['color'] = $this->input->get('color');
$this->session->set_userdata('client', $dados);
}
}
How do I check if the $_GET
exist, it puts the image and the color selected by the client, if not, it puts the pattern?
Here you use
$client->client_color
and here you use$dados['client'] [$client_id] ['image']
, that is, you’re using some framework and we don’t know what it is, or the right one should be$client->color;
. I suppose it’s not a problem with GET. What framework is this? Something else the color is going to the attributedata-color
, this attribute does nothing unless it is used by a Javascript library. You have viewed the source code, suddenly the color is in the attributedata-color
, but the javascript library is the problem.– Guilherme Nascimento
A simple
if
andelse
??– Lucas
Exactly, I want to know how to mount if and Else within the html structure, whether or not to include $_GET data
– GWER