Giter Site home page Giter Site logo

tintin's People

Contributors

agatapouglof avatar gabeta avatar missaconstant avatar papac avatar ritabear avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tintin's Issues

[3.x] Add %json tags

The %json should parse the parsed variable to json

%json(['name' => 'tintin'])

The output should be

<?php echo json_encode(['name' => 'tintin']); ?>;

or

<?= json_encode(['name' => 'tintin']); ?>;

[3.x] Add %isset and %endisset tags

The templating definition and rendering output

%isset($is_service_side)
    The content should be shown when $is_service_side variable is defined
%endisset

And the output should be:

<?php if (isset($is_service_side): ?>
    The content should be shown when $is_service_side variable is defined
<?php endif; ?>

[1.2.8] Fix the comment parser

  • Tintin Version: master
  • PHP Version: 7.2

Description:

The #string is parsed by tintin like comment syntax

Steps To Reproduce:

<a href="#" class="btn btn-primary" data-target="#createMember" data-toggle="modal">Add</a>

Is compile to:

<a href="#" class="btn btn-primary" data-target="" data-toggle="modal">Add</a>

[2.x] Add the #verbatim tag

The verbatim tag marks sections as being raw text that should not be parsed.

For example, to put Twig syntax as an example into a template you can use this snippet:

#verbatim
    <ul>
        #loop($collection as $item)
            <li>{{ item }}</li>
        #endloop
    </ul>
#endverbatim

And the output should be:

<ul>
    #loop($collection as $item)
        <li>{{ item }}</li>
    #endloop
</ul>

[3.x] Add %includeIf and %includeWhen tags

The templating definition and rendering output

%includeif($age > 18, 'name')

or

%includewhen($age > 18, 'name')

And the output should be:

<?php if ($age > 18): ?>
    <?php include('name'); ?>
<?php endif; ?>

[3.x] Add %lang and %endlang tag

The templating definition and rendering output

%lang('fr')
    Contenu en français
%endlang

And the output should be:

<?php if (client_locale() == 'fr'): ?>
    Contenu en français
<?php endif; ?>

[3.x] Add the %macro and %endmacro

macro should allow you to define reusable chunks of content. It is similar to a function in a programming language. Here's an example:

%macro('field', $type, $name, $value)
<div class="field">
  <input type="{{ $type }}" name="{{ $name }}" value="{{ $value }}"/>
</div>
%endmacro

Now field is available to be called like a normal function:

{{ field('text', 'username', 'bow') }}

[2.x] Add the #isset and #endisset tag

Add the new tag for #php #endphp

This tag should be used for executing the if isset PHP code:

#isset($name)
   {{ $name }}
#endisset

The output should be

if (isset($name)):
   echo $name;
endif

[3.x] Add the %verbatim tag

The verbatim tag marks sections as being raw text that should not be parsed.

For example, to put Twig syntax as an example into a template you can use this snippet:

%verbatim
    <ul>
        %loop($collection as $item)
            <li>{{ $item }}</li>
        %endloop
    </ul>
%endverbatim

And the output should be:

<ul>
    %loop($collection as $item)
        <li>{{ $item }}</li>
    %endloop
</ul>

Migrating to the GitHub actions

Description:

Since the Travis CI building is not friendly for the open source projects, I think it's time to migrate to the GitHub actions.

And the GitHub actions YAML file can also refer the build.yml.

Steps To Reproduce:

N/A

[3.x] Add %guest and %endguest tags

The templating definition and rendering output

%guest('admin')
    The content should be shown when the user is connected to the admin guard
%endguest

If the guard is not defined the template should be used as the default define a guard

%guest
    The content should be shown when the user is connected to the admin guard
%endguest

And the output should be:

<?php if (!auth()->check()): ?>
    The content should be shown when the user is connected to the admin guard
<?php endif; ?>

Or if the guard is defined as:

<?php if (!auth('admin')->check()): ?>
    The content should be shown when the user is connected to the admin guard
<?php endif; ?>

[3.x] Add %env, %endenv, %production and %endproduction tags

The templating definition and rendering output

%env

%env('production')
    The content should be shown on production env
%endenv

The production passed on argument could be development

And the output should be:

<?php if (app_mode() == 'production'): ?>
    The content should be shown on production env
<?php endif; ?>

%production

%production
    The content should be shown on production env
%endproduction

And the output should be:

<?php if (app_mode() == 'production'): ?>
    The content should be shown on production env
<?php endif; ?>

[2.x] Add the #macro and #endmacro

macro should allow you to define reusable chunks of content. It is similar to a function in a programming language. Here's an example:

#macro('field')
<div class="field">
  <input type="{{ $type }}" name="{{ $name }}" value="{{ $value }}"/>
</div>
#endmacro

Now field is available to be called like a normal function:

{{ field(['name' => 'username']) }}
{{ field(['name' => 'password', 'type' => 'password']) }}

[2.x] Add the #php #endphp tag

Add the new tag for #php #endphp

This tag should be used for executing the raw PHP code:

#php 
   $user = pdo()->exec('SELECT * FROM users');
#endphp 

The output should be

<?php
   $user = pdo()->exec('SELECT * FROM users');
?>

Tintin display comment tags

  • Tintin Version: 1.2.1
  • PHP Version: 7.2

Description:

When i add comment on all line. Tintin display the comment in the browser.

{# <script type="text/javascript" src="/js/app.js"></script> #}

[3.x] Add %auth and %endauth tags

The templating definition and rendering output

%auth('admin')
    The content should be shown when the user is connected to the admin guard
%endauth

If the guard is not defined the template should be used as the default define a guard

%guest('admin')
    The content should be shown when the user is connected to the admin guard
%endguest

And the output should be:

<?php if (auth()->check()): ?>
    The content should be shown when the user is connected to the admin guard
<?php endif; ?>

Or if the guard is defined as:

<?php if (auth('admin')->check()): ?>
    The content should be shown when the user is connected to the admin guard
<?php endif; ?>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.