Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Prefilter ?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
ouioui2
Smarty n00b


Joined: 31 Oct 2003
Posts: 2

PostPosted: Tue Nov 04, 2003 9:20 am    Post subject: Prefilter ? Reply with quote

I use smarty to generate php file for xoops system. For example,
here is a template :
Code:

<?php
// ClassSystem.php,v 1
include_once XOOPS_ROOT_PATH."/class/xoopsobject.php";

class <{$table_id}>System extends XoopsObject
{
   var $db;

// constructor
   function <{$table_id}>System($id=null)
   {
      $this->db =& Database::getInstance();
<{section name=field loop=$fields}>
$this->initVar("<{$fields[field].field_name}>",<{$fields[field].field_type}>);<{/section}>
      if ( !empty($id) ) {
         if ( is_array($id) ) {
            $this->assignVars($id);
         } else {
            $this->load(intval($id));
         }
      }
      
   }
....

for a existing database names "dossier", the generated files is (Ultraedit view):

Code:

<?php

// ClassSystem.php,v 1

include_once XOOPS_ROOT_PATH."/class/xoopsobject.php";



class dossiersSystem extends XoopsObject

{

   var $db;



// constructor

   function dossiersSystem($id=null)

   {

      $this->db =& Database::getInstance();


$this->initVar("dossier_id",XOBJ_DTYPE_INT,null,false,10);
$this->initVar("user_id",XOBJ_DTYPE_INT,null,false,10);
$this->initVar("consultant_id",XOBJ_DTYPE_INT,null,false,10);
$this->initVar("status",XOBJ_DTYPE_INT,null,false,10);
$this->initVar("priorite",XOBJ_DTYPE_INT,null,false,10);
$this->initVar("dossier_language",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("proprio_nom",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("proprio_prenom",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("proprio_adresse1",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("proprio_adresse2",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("proprio_codepostal",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("proprio_ville",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("proprio_pays",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("patient_nom",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("patient_espece",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("patient_race",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("patient_age",XOBJ_DTYPE_INT,null,false,10);
$this->initVar("patient_unit_age",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("patient_sexe",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("contents_motif",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("contents_nature_signe",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("contents_duree_signe",XOBJ_DTYPE_INT,null,false,10);
$this->initVar("contents_unit_duree_signe",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("contents_appar_signe",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("contents_resultat",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("contents_diagnostique",XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar("date_creation",XOBJ_DTYPE_INT,null,false,10);
$this->initVar("date_reponse",XOBJ_DTYPE_INT,null,false,10);
$this->initVar("date_derniere_modif",XOBJ_DTYPE_INT,null,false,10);
      if ( !empty($id) ) {

         if ( is_array($id) ) {

            $this->assignVars($id);

         } else {

            $this->load(intval($id));

         }

      }

      

   }


The file work but there is too much new line in this generate file.
How can i have a file without this new lines ?

Best regard
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP