• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with parser

#11
(09-01-2018, 08:41 AM)Decibel150 Wrote: It's still not working. I don't know how to get out of this, I'm thinking of having 2 different views and directly pass the values of parse hay, so as not to have to save anything in the database, Since I think it'll be easier and this is taking up a lot of my time.

Try this without the Parser:
// Controller/Controller_Name.php
PHP Code:
<?php 
// "Fails Fast" and ONLY applies to this file
   
declare(strict_types=1);

// applies to this file and ALL included files   
   
error_reporting(-1);
   
ini_set('display_errors''TRUE');


$ConfigurationSite $this->MainModel->Configuration();
$SeoBooks $this->Books->bookSeo();

$data = [
    
'seo_book_title' => '$SeoBooks->title'// QUOTES REQUIRED???
    
'site_name' => $ConfigurationSite->name,
    
'seo_title' => $ConfigurationSite->title,
    
'seo_description' => $ConfigurationSite->description,
    
'site_logo' => $ConfigurationSite->logo,
    
'site_url' => base_url(),
    
'site_categories' => $siteCategories
];

// adds line feeds to $data and makes it easier to read
// remove when $data is correct   
   
echo '<pre>'print_r($data); echo '</pre>';   die;

  return 
view('page-name'$data);   

// $this->parser->parse('template/default/libreria_head', $data); 

// View/page-name.php
PHP Code:
// "Fails Fast" and ONLY applies to this file
   
declare(strict_types=1);

// prefixed parameters with $

$tmp = <<< ____TMP
<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>
$seo_title</title>
        <meta name="description" content="
$seo_description"/>
        <meta name="robots" content="noodp" />
        <link rel="canonical" href="
$site_url" />
        <meta property="og:locale" content="es_ES" />
        <meta property="og:type" content="website" />
        <meta property="og:title" content="
$seo_title" />
        <meta name="og:description" content="
$seo_description" />
        <meta property="og:url" content="
$site_url" />
        <meta property="og:site_name" content="
$site_name" />
____TMP;
echo 
$tmp

Use the Browser's Source View to ensure the parameters have been passed correctly
download and make your system directory strict
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.