elisdn / seokeys Goto Github PK
View Code? Open in Web Editor NEWSEO service on Yii2 Framework
License: Other
SEO service on Yii2 Framework
License: Other
Непонятно откуда взялся такой пользователь ?
https://github.com/ElisDN/seokeys/blob/master/tests/unit/models/LoginFormTest.php
public function testLoginCorrect()
{
$this->model = new LoginForm([
'username' => 'demo',
'password' => 'demo',
]);
....
Добрый день, Дмитрий.
Почитала ваши обучающие материалы.
Там этого еще нет - попыталась в исходниках разобраться.
Мне понравилась идея перенести переводы в модули.
И я смотрю у Вас идея эта реализована.
Но судя по коммитам, были метания между разными решениями.
Вот идея с AdminModule:t('admin', 'MESSAGE') у меня заработала.
папки переводов лежат в modules\admin\messages\en|ru
В модуле прописано следующее
public function registerTranslations() {
Yii::$app->i18n->translations['modules/admin/*'] = [
'class' => 'yii\i18n\PhpMessageSource',
'sourceLanguage' => 'en',
'basePath' => '@app/modules/admin/messages/',
'fileMap' => [
'modules/admin/admin' => 'admin.php',
],
];
}
public static function t($category, $message, $params = [], $language = null) {
return Yii::t('modules/admin/'.$category, $message, $params, $language);
}
Но я догадываюсь почему вы отказались от этого метода.
Писать каждый раз
use app\modules\admin\Module as AdminModule;
не очень хочется.
PS. в идеале хотелось бы использовать конструкцию внутри модуля
Yii::t('admin', .......
или Yii::t('admin-error', .......
при этом хранить файлы admin.php и admin-error.php внутри модуля admin
Как же всё таки реализовано у Вас сейчас.
Хотя настройки, я смотрю, вы выкинули, но файлы сообщений все же в модулях.
Спасибо, заранее
Composer вылетает с ошибкой:
Installation failed, deleting ./composer.json.
[ReflectionException]
Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist
[ErrorException]
Declaration of Fxp\Composer\AssetPlugin\Repository\AbstractAssetsRepository
::whatProvides() should be compatible with Composer\Repository\ComposerRepo
sitory::whatProvides(Composer\DependencyResolver\Pool $pool, $name, $bypass
Filters = false)
Fix:
composer global require "fxp/composer-asset-plugin:~1.1.1"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.