Re: Nano - PHP7, MVC, PDO
Your Project looks very nice, I hope you'll pull through it!
Yours Sincerely,
Sonay:love:
Re: Nano - PHP7, MVC, PDO
I liked the design, 7/10. Only one concepts aren't good in my personal vision.
A little tip: Try doing smaller functions, big functions are against PSR-*.
See about PSR-0, PSR-2, PSR-4 and PSR-5 here: PHP-FIG â PHP Framework Interop Group
PSR's are the PHP Standards.
Re: Nano - PHP7, MVC, PDO
Quote:
Originally Posted by
ovflowd
I liked the design, 7/10. Only one concepts aren't good in my personal vision.
A little tip: Try doing smaller functions, big functions are against PSR-*.
See about PSR-0, PSR-2, PSR-4 and PSR-5 here:
PHP-FIG â PHP Framework Interop Group
PSR's are the PHP Standards.
Functions or methods in this case?
Re: Nano - PHP7, MVC, PDO
Quote:
Originally Posted by
3M1L
Functions or methods in this case?
Yes methods, if are in a class. Functions if not.
Re: Nano - PHP7, MVC, PDO
The code is very clean, although I'm not fond of the design but again, some aspects are nice!
Overall, seems good so I shall be following your development.
Re: Nano - PHP7, MVC, PDO
Thanks for the feedback! Just to note this development is still on-going even though there hasn't been much updates recently, I have my hands full at the moment with some other things but it will continue as soon as things are out of the way.
Yeah the design isn't too great, I used an already released theme and adapted it as I'm not really that good/interested in design although anyone who would like to develop a theme for the CMS would be welcome to do so.
Quote:
Originally Posted by
ovflowd
I liked the design, 7/10. Only one concepts aren't good in my personal vision.
A little tip: Try doing smaller functions, big functions are against PSR-*.
See about PSR-0, PSR-2, PSR-4 and PSR-5 here:
PHP-FIG â PHP Framework Interop Group
PSR's are the PHP Standards.
What do you mean by smaller functions, was there a specific function in the snippets provided which you could pick out?
Most of the code is quite minimal in this overall, I have also followed the majority of PSR standards which I believed were appropriate and appealed to me.
Re: Nano - PHP7, MVC, PDO
Quote:
Originally Posted by
Geo
Thanks for the feedback! Just to note this development is still on-going even though there hasn't been much updates recently, I have my hands full at the moment with some other things but it will continue as soon as things are out of the way.
Yeah the design isn't too great, I used an already released theme and adapted it as I'm not really that good/interested in design although anyone who would like to develop a theme for the CMS would be welcome to do so.
What do you mean by smaller functions, was there a specific function in the snippets provided which you could pick out?
Most of the code is quite minimal in this overall, I have also followed the majority of PSR standards which I believed were appropriate and appealed to me.
Code re-usability. I'm only giving a tip. Don't love so much your code. A good developer hate his own code. It's ironically good, because you see your code in a other way/angle. Improving code it's a endless to-do of a good developer.
Good luck.
Re: Nano - PHP7, MVC, PDO
Quote:
Originally Posted by
ovflowd
Code re-usability. I'm only giving a tip. Don't love so much your code. A good developer hate his own code. It's ironically good, because you see your code in a other way/angle. Improving code it's a endless to-do of a good developer.
Good luck.
How can you judge code re-usability with little information regarding those aspects of the inner workings behind the CMS? Yes, I'm always going back and forth improving certain parts of the CMS but a lot of the current functionality is pretty re-usable; a few examples below.
E.g. the same getArticle() function is used to display 3 articles for the (/me) page, contents of an article page (/article/welcome-to-habbo), articles navigation list and also within the housekeeping to list the articles (/admin/articles).
usernameTaken() is used on the registration and login, to check if the username already exists before processing the response based on the result appropriately, either registering the new user/error or signing the user in/error.
Administration/ArticleController:
https://i.imgur.com/yRme7lq.png
Admin articles view:
https://i.imgur.com/5pTICpB.gif
Articles view template:
Code:
{% if articles %}
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>#</th>
<th>Title</th>
<th>Preview</th>
<th>Slug</th>
<th>Published</th>
<th>Author</th>
<th>Category</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for article in articles %}
<tr>
<td>{{ article.id }}</td>
<td>{{ article.title }}</td>
<td>{{ article.preview }}</td>
<td>{{ article.slug }}</td>
<td>{{ article.published }}</td>
<td>{{ article.author }}</td>
<td>{{ article.category }}</td>
<td>
<div class="btn-group-vertical">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
Manage <span class="caret"></span>
</button>
<ul class="dropdown-menu" style="position:relative">
{% if article.live == true %}
<li><a href="/admin/articles/withdraw/{{ article.id }}">Withdraw</a></li>
{% else %}
<li><a href="/admin/articles/publish/{{ article.id }}">Publish</a></li>
{% endif %}
<li><a href="/admin/articles/edit/{{ article.id }}">Edit</a></li>
<li><a href="/admin/articles/delete/{{ article.id }}">Remove</a></li>
</ul>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
No articles have been published yet, <a href="/admin/articles/compose">compose</a> one?
{% endif %}
Re: Nano - PHP7, MVC, PDO
This looks smooth and fresh @Geo and who cares what ovflowd says. He says so many shit on every project about 'bad code'.
Re: Nano - PHP7, MVC, PDO
Which template engine you use? Looks interesting. This remember me Jinja (Python Template Engine)
Re: Nano - PHP7, MVC, PDO
Absolutely flawless coding style, quite nice project mate
Re: Nano - PHP7, MVC, PDO
Quote:
Originally Posted by
ovflowd
Which template engine you use? Looks interesting. This remember me Jinja (Python Template Engine)
Twig.
Re: Nano - PHP7, MVC, PDO
Quote:
Originally Posted by
ovflowd
Which template engine you use? Looks interesting. This remember me Jinja (Python Template Engine)
I'm using Twig as mentioned above and in my original post, it probably reminds you of Jinja because they are both template engines following the Django/like syntax.
Re: Nano - PHP7, MVC, PDO
Do you mind posting your event manager class? :)