Jump to content

Modules


Joaogl

Recommended Posts

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....

Link to comment
Share on other sites

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,

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Administrators

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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...