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 1025077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:52:28+00:00 2026-05-16T11:52:28+00:00

I’m very newbie to php and codeigniter (and smarty too). I follow a lot

  • 0

I’m very newbie to php and codeigniter (and smarty too).

I follow a lot of tutorials and Now I’m confident with my smarty + CodeIgniter configuration, but now I have this escenario. I want to pass a couple of variables into a smarty include in order to show just two strings in the include ( the header, the strings are part of the title )

This is the include (header.tpl):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$Titulo} - {$NombreModulo} - Some Static text.com</title>
<link rel="stylesheet" type="text/css" media="screen" href="/sitio/contenido/css/Style.css" />
{literal}
<script type="text/javascript" src="/sitio/contenido/js/jquery-1.4.2.min.js" ></script>
<script type="text/javascript" charset="utf-8">
{/literal}
(some code omitted)

and my controller:

function index()
{
    //$this->load->view('welcome_message');
    $this->load->library('smarty_parser');
    $datos = array (
    'texto' => 'String de prueba',
    'elapsed_time',1500,
    'TituloPagina','Inicio',
    'Modulo','Dashboard'
    );
    $this->smarty_parser->parse('plantilla.tpl', $datos);
}

and the file Plantilla.tpl (the template)

{include file="head.tpl" Titulo=$TituloPagina NombreModulo=$Modulo }
<div id="cuerpo">
{include file="sidebars/dashboard.tpl"}
</div>
<div id="contenido"> {$texto} </div>
<!-- fin del contenido -->

</div>
<div id="footer"> </div>
</body></html>

The problem here is the first line on the last file (or a least I think so). I can put a static string here ({include file="head.tpl" Titulo="Static Title" NombreModulo="Another one"} ) and it works, but doesn’t work with the way the documentation says.

Clarifying, what I want to accomplish is to send some string variables to the smarty include to be printed on the tittle tags, from the controller.

UPDATE The code, when is set up like this, just display – – Some Static text.com

  • 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-16T11:52:29+00:00Added an answer on May 16, 2026 at 11:52 am

    Well, this part is incorrect:

    $datos = array (
    'texto' => 'String de prueba',
    'elapsed_time',1500,
    'TituloPagina','Inicio',
    'Modulo','Dashboard'
    );
    

    Should be:

    $datos = array (
    'texto' => 'String de prueba',
    'elapsed_time' => 1500,
    'TituloPagina' => 'Inicio',
    'Modulo' => 'Dashboard'
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a jquery bug and I've been looking for hours now, I can't
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.