Re: Nano - PHP7, MVC, PDO
Quote:
Originally Posted by
3M1L
Do you mind posting your event manager class? :)
PHP Code:
<?php
declare(strict_types=1);
namespace Library\Components\Storage;
class Event {
protected $callbacks = [];
public function __construct(){}
/**
* [register is a function to register callback events]
* [MENTION=2000183830]para[/MENTION]m string $callback [The callback to register]
*/
public function register(string $callback){
$this->callbacks[] = $callback;
}
/**
* [fire is a function to fire a single or all callback events]
* [MENTION=2000183830]para[/MENTION]m string $call [The callback to fire] [Optional]
* [MENTION=850422]return[/MENTION] mixed [The respective fired callback event]
*/
public function fire(callable $call = null){
if(!$call){
foreach($this->callbacks as $callback){
call_user_func([$this, $callback]);
}
}else{
call_user_func([$this, $call]);
}
}
}
?>
Also some updates on the housekeeping, I worked a little more on the article management:
https://i.imgur.com/9SctRaL.png
Re: Nano - PHP7, MVC, PDO
Im interested in how the progress of this cms is going on.
Re: Nano - PHP7, MVC, PDO
Quote:
Originally Posted by
Geo
Good updates, but i don't recommend to use "hosted" images in cms, leave author decide url of image... (Of corse if hosted in own cms will make a faster site, but also heavier)
Re: Nano - PHP7, MVC, PDO
Quote:
Originally Posted by
rafa95123
Good updates, but i don't recommend to use "hosted" images in cms, leave author decide url of image... (Of corse if hosted in own cms will make a faster site, but also heavier)
Also, it would be good just if you could prevew what image you are picking. Choosing by name sucks.
Would prefer the size of the news in the home page being just like old school habbo. Already has a lot of images ready to be used in that square format.
Re: Nano - PHP7, MVC, PDO
Quote:
Originally Posted by
rafa95123
Good updates, but i don't recommend to use "hosted" images in cms, leave author decide url of image... (Of corse if hosted in own cms will make a faster site, but also heavier)
Do you mean article content images or the actual image of each article? Article images are stored in the CMS folder, but you are able to link any image URL for the content images e.g. the elphpant image above.
Quote:
Originally Posted by
Japaojp
Also, it would be good just if you could prevew what image you are picking. Choosing by name sucks.
Would prefer the size of the news in the home page being just like old school habbo. Already has a lot of images ready to be used in that square format.
You can preview the image, you select a name from the dropdown list and then select the blue "preview" text seen next to the "Image" label; this opens up a modal showing you details of the image such as it's name and the actual image preview.
Re: Nano - PHP7, MVC, PDO
The preview is to complicated like @Japaojp was saying. The link and modal is nice but not user friendly.
Re: Nano - PHP7, MVC, PDO
Quote:
Originally Posted by
Geo
Do you mean article content images or the actual image of each article? Article images are stored in the CMS folder, but you are able to link any image URL for the content images e.g. the elphpant image above.
The actual image of each article, cause if stay with CMS will make her heavier. I prefer leave author decides with a external link...
Re: Nano - PHP7, MVC, PDO
I noticed an inconsistency, it seems that you use array() in your first example and in your others you use []; I Think you should fix that inconsistency issue. Since it's 7 you should stick with [];
Re: Nano - PHP7, MVC, PDO
Quote:
Originally Posted by
rafa95123
The actual image of each article, cause if stay with CMS will make her heavier. I prefer leave author decides with a external link...
Yes that may make the author feel like they have more accessibility but it would also affect performance and security, it may also affect the appearance of the site as they may link an URL of an image which for example has different sizes to the standard articles images or even a dead/blocked image link.
Quote:
Originally Posted by
CodeDragon
I noticed an inconsistency, it seems that you use array() in your first example and in your others you use []; I Think you should fix that inconsistency issue. Since it's 7 you should stick with [];
I use a mixture of both syntax styles, mainly the short syntax for shorter logic such as returning data alongside a view whilst I mainly use the standard syntax style for larger arrays, sometimes even both syntax styles are used for things like hash tables.
Doesn't make much of a difference which is used on the current version as both are compatible, just more of a personal preference really.