• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

FelonyAAC official discussion and showoff thread

Cornex

Web Developer
Staff member
Global Moderator
Joined
Jun 15, 2008
Messages
3,444
Solutions
5
Reaction score
1,166
Location
Sweden
Hello, since Felony has been going really good I have decided to make an AAC based on it.

The main goal with this AAC is to make it simple, very very simple for user to edit the layout as wanted.
With that said, I mean that barely no PHP logic will be placed into the pages.

Some example is, this code:

PHP:
<div class="panel panel-default">
    <div class="panel-heading">
        <div class="panel-title">
            Register
        </div>
    </div>
    <div class="panel-body">
        <form action="post_requests/register.php" method="POST">
           
            <h4>Account name</h4>
            <input type="text" name="username" class="form-control">

            <h4>Password</h4>
            <input type="password" name="password" class="form-control">

            <h4>Password again</h4>
            <input type="password" name="password_again" class="form-control">

            <input type="submit" value="Register" class="btn btn-success">

        </form>
    </div>
</div>

Will pretty much produce this fully working register page

Mr3wEQgOr.png


To edit the alerts, just include them where you want them in the layout.php etc

PHP:
include __DIR__.'/pages/alerts.php';

And how the alerts.php looks like:

PHP:
if ($errors->errorHas())
{
    echo '<div class="alert alert-danger">';
    echo 'Following errors has occured:';
    foreach ($errors->errorGet() as $error) {
        echo '<li>'.$error;
    }
    echo '</div>';
}

if ($errors->successHas())
{
    echo '<div class="alert alert-success">';
    echo $errors->successGet();
    echo '</div>';
}

This functions are Felony based, and can be viewed on our documentation page.

Please post some feedback here, muche macho lovelic <3
 
Loops are also outside the layout logics now, for example this code:

PHP:
<div class="panel panel-default">
    <div class="panel-heading">
        <div class="panel-title">
            <?php echo $n['title']; ?>
            <div class="pull-right">
                <i class="fa fa-clock-o"></i> <?php echo $felony->ago($n['created']) ?>
            </div>
        </div>
    </div>
    <div class="panel-body">
        <?php echo $n['content']; ?>
    </div>
</div>

Will produce the whole news loop, like:

yhRNAfH5E.png


The view has to be in pages/index.php tho, the way I did this is like when subtopic is index we load from the loop_objects/news.php (outside the layout) that looks like

PHP:
if (!$felonyAAC->allNews())
{
    $errors->errorSet(['No news exist yet.']);
}

if ($felonyAAC->allNews())
{

    foreach ($felonyAAC->allNews() as $n)
    {

        include __DIR__."/../layouts/$layout/pages/index.php";

    }

}
 
Are you planning to use jQuery, or are you building your own app for client-sided inclusion of the divs to display functionality on the run?
 
Are you planning to use jQuery, or are you building your own app for client-sided inclusion of the divs to display functionality on the run?

Everything is loaded from the layout you decide to use, for example

./layouts/default/pages
./layouts/tibiacom/pages

Every page is located inside the layout folder, jQuery is included by default.
Every page inside the layout/pages are able to use the Felony, Felony Mysql, FelonyAAC and opentibiaac toolkit functionality with

$felony->..
$mysql->..
$errors->..
$felonyAAC->..

More short answer is, yes we use jQuery and will not build any own.
jQuery is barely not used tho, only for the bootstrap layout functionality. :)
 
If you are planning on making something new and more modern, please use PHP mixed with HTML in this way:

PHP:
<?php if ($errors->errorHas()): ?>
    <div class="alert alert-danger">
    Following errors has occured:
    <?php foreach ($errors->errorGet() as $error): ?>
        <li> <?php echo $error; ?> </li>
    <?php endforeach; ?>
    </div>
<?php endif; ?>

<?php if ($errors->successHas()): ?>
    <div class="alert alert-success">
        <?php echo $errors->successGet(); ?>
    </div>
<?php endif; ?>

You don't want to mix the HTML/PHP but some times you have to, and it should be based on HTML, including PHP, not the other way around.
 
If you are planning on making something new and more modern, please use PHP mixed with HTML in this way:

PHP:
<?php if ($errors->errorHas()): ?>
    <div class="alert alert-danger">
    Following errors has occured:
    <?php foreach ($errors->errorGet() as $error): ?>
        <li> <?php echo $error; ?> </li>
    <?php endforeach; ?>
    </div>
<?php endif; ?>

<?php if ($errors->successHas()): ?>
    <div class="alert alert-success">
        <?php echo $errors->successGet(); ?>
    </div>
<?php endif; ?>

You don't want to mix the HTML/PHP but some times you have to, and it should be based on HTML, including PHP, not the other way around.

Acutally this is already rewrited, this codes I have posted is not even close the final ones.
We have added own syntax to Felony, based on same structure as Laravel use. Example:

PHP:
@if ($errors->errorHas())
    <div class="alert alert-danger">
    Following errors has occured:
    @foreach ($errors->errorGet() as $error)
        <li> {{ $error }} </li>
    @endforeach
    </div>
@endif

@if ($errors->successHas())
    <div class="alert alert-success">
        {{ $errors->successGet() }}
    </div>
@endif
 
Acutally this is already rewrited, this codes I have posted is not even close the final ones.
We have added own syntax to Felony, based on same structure as Laravel use. Example:

PHP:
@if ($errors->errorHas())
    <div class="alert alert-danger">
    Following errors has occured:
    @foreach ($errors->errorGet() as $error)
        <li> {{ $error }} </li>
    @endforeach
    </div>
@endif

@if ($errors->successHas())
    <div class="alert alert-success">
        {{ $errors->successGet() }}
    </div>
@endif

Alright nice.
Altho, in my experience, using a framework for templates costs so much resources in relation to what you actually get from it.
I always used the default syntax because I want my applications to run as fast as possible.
 
Alright nice.
Altho, in my experience, using a framework for templates costs so much resources in relation to what you actually get from it.
I always used the default syntax because I want my applications to run as fast as possible.

All this syntax is layout sided, so you can create a own layout with default syntax if so.
But yeah, it would be faster, ofcourse, to use default syntax but this is more experimental because I want to test everything added in Felony.

I hace optimized it as much I can, and will keep improve it to make it fast as possible.
Talked and got some tips/tricks from @Chris to make it smooth as possible.

But yeah, thanks for feedback :)
 
Reworked the Felony pagination class

y5IhsKRS4.png
 
Alright nice.
Altho, in my experience, using a framework for templates costs so much resources in relation to what you actually get from it.
I always used the default syntax because I want my applications to run as fast as possible.
All this syntax is layout sided, so you can create a own layout with default syntax if so.
But yeah, it would be faster, ofcourse, to use default syntax but this is more experimental because I want to test everything added in Felony.

I hace optimized it as much I can, and will keep improve it to make it fast as possible.
Talked and got some tips/tricks from @Chris to make it smooth as possible.

But yeah, thanks for feedback :)

do you know any view can be cached as pure php ? there's no reason to parse view in your template language(laravel or whatever) every time
the same performence
 
do you know any view can be cached as pure php ? there's no reason to parse view in your template language(laravel or whatever) every time
the same performence

The view is currently beeing cached as pure php :p
 
how about pandaac + felony? do you have a github or something?

Sorry for not answering, didn't saw your post last time I visit this thread lulz ;oo
Anyway, what do you mean with pandaac + felony? And no, Felony AAC itself do not have a github page, only the FelonyAAC package does https://github.com/FelonyPHP/Felonyaac

Not the best layout, but the it works :D
37DSEJC8E.png
 
How do you find this function based?
It might be wrapped around a object but the way its used, it would be the same to just include a file with its functions.
The entire point of OOP has been ignored in this file.
 
It might be wrapped around a object but the way its used, it would be the same to just include a file with its functions.
The entire point of OOP has been ignored in this file.

The entire point with OOP has absolutely not been ignored in this file.
You are free to contribute to the github as well.

Anyhow, I link Chris your answer once he gets on and see if he can lead me into some good solutions.
Dis Chris is just my god. xD
 
I kind of like the layout tbh. So basic, just put in a clean and goodlooking header and I would like it alot! :)
 
Back
Top