Jump to content

Recommended Posts

Posted

Hello guy's,

E put in the directory("/public_html/core/modules/adicionar") this code:

<?php

class adicionar extends CodonModule
{
public function index()
{

	Template::Show('adicionar.tpl');

}
}
?>

.

now the problem is, when i put this(<?php echo $userinfo->firstname; ?>) in the file(adicionar.tpl), the pilot's name does not appear to me why? ho and i'm logged in....

Posted

YOu have to do $this->set('userinfo', Auth::$userinfo) to set the $userinfo variable to the view

I think its Auth::$userinfo

were in the ("/public_html/core/modules/adicionar") or in the(adicionar.tpl)??

Posted

were in the ("/public_html/core/modules/adicionar") or in the(adicionar.tpl)??

You would want to set your variables in the controller, so you would place it in "modules/adicionar/adicionar.php"

Another good tip if you are unsure whats being passed to your templates is run a simple vardump:

var_dump($userinfo);

This will give you a break down of the Objects/Variables being passed into your template.

Hope this helps,

Posted

You would want to set your variables in the controller, so you would place it in "modules/adicionar/adicionar.php"

Another good tip if you are unsure whats being passed to your templates is run a simple vardump:

var_dump($userinfo);

This will give you a break down of the Objects/Variables being passed into your template.

Hope this helps,

Hello,

When i do:

<?php

class adicionar extends CodonModule
{
public function index()
{

	Template::Show('adicionar.tpl');
	var_dump($userinfo);

}
}
?>

the <?php echo $userinfo->firstname; ?> still doesn't work but add a "NULL" in the bottom of the page:

See the image please.

How i can resolve that?

post-2173-053922800 1321833279_thumb.png

  • Administrators
Posted

You need to set the variable in the controller before you try to see what is in it.

Try this in your controller;

<?php
   class adicionar extends CodonModule  {

       public function index()        {  

            $this->show('adicionar.tpl');
            $this->set('userinfo', Auth::$userinfo);
        }
}
?>

then in your template use

<?php
  var_dump($userinfo);
?>

to see what is available. If the user is not logged in you are not going to get any data using this method, it should be only used on pages only available to logged in users.

Posted

Hello guy's,

<?php
   class adicionar extends CodonModule  {

       public function index()        {  

            $this->show('adicionar.tpl');
            $this->set('userinfo', Auth::$userinfo);
        }
}
?>

and on template

<style type="text/css">
#tabledlistcolor {
color: #069;
}
.style1 {color: #669900}
</style>
<?php
  Auth::$userinfo
?>
<h3>*Reservar um Oasis/Aldeia <?php echo $userinfo->firstname; ?>*</h3>
<p> </p>

and still doesn't work i and i m logged in

  • Administrators
Posted

Change;

$this->show('adicionar.tpl');
$this->set('userinfo', Auth::$userinfo);

to

$this->set('userinfo', Auth::$userinfo);
$this->show('adicionar.tpl');

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...