yii2mod / base Goto Github PK
View Code? Open in Web Editor NEWYii2 application template
License: MIT License
Yii2 application template
License: MIT License
hi , I have problem to run the app I did all of the CONFIGURATION setting in
but I don't know what I am do in step 4 :
4- Set document root of your web server to /path/to/application/web/ folder.
If I enter http://localhost/base-app/web/ -> then the site/index loaded but when I click In another link or I want to entire in admin module this redirect me to http://localhost/dashboard/
after click
what can I do to solve this problem?
hi
thanks for your extension, i init the application with dev environment but the yii2 debug toolbar not shown
i update my project with composer update and yii version update to 2.0.12 and yii2mod/yii2-user update to version 2.1, now when i update migration with "php yii migrate --migrationPath=@vendor/yii2mod/yii2-user/migrations" , i got the below error:
PHP Warning 'yii\base\ErrorException' with message 'strncmp() expects parameter 1 to be string, array given' in /var/www/html/test/vendor/yiisoft/yii2/BaseYii.php:133 Stack trace: #0 [internal function]: yii\base\ErrorHandler->handleError(2, 'strncmp() expec...', '/var/www/html/test', 133, Array)
Not clear where to install this??
1-Install yii2 basic app first using composer, and then install your app (base) within that basic app??
If I run the command given here in documentation, it adds a folder within basic app named application.
2-Is your base app complete package having everthing in it?? If I look into code it does not include vendor directory. (means have not framework). It has all other directories that make it complete app.
3- other option is to set up basic app, download your app, and merge things and configure???
Replace php -r copy() on copyFiles
func, docs
Update php version to 7.1.7 in docker web container
thanks for your great extension i have a question about requirements, dose this extension work in php 7.0?
and another question can i use this extension in production? cause in production we can't change php version all time's for example if php 7.2 finally released it takes time to update php version of server and sometimes in production it is not possible to change php version frequently. yii2 will require php 7 in the yii 2.1 but you all time update php version. how we can sustain the project when you update php versions all time?
When running "yii migrate", I get this error:
Yii Migration Tool (based on Yii v2.0.14.2)
PHP Warning 'yii\base\ErrorException' with message 'strncmp() expects parameter 1 to be string, array given'
in C:\xampp\htdocs\test\yii2mod-app\vendor\yiisoft\yii2\BaseYii.php:133
Stack trace:
#0 C:\xampp\htdocs\test\yii2mod-app\vendor\cyberz\yii2-multipath-migrations\src\controllers\MigrationsController.php(57): yii\BaseYii::getAlias()
#1 C:\xampp\htdocs\test\yii2mod-app\vendor\cyberz\yii2-multipath-migrations\src\controllers\MigrationsController.php(28): cyberz\migrations\controllers\MigrationsController->lookupMigrations()
#2 C:\xampp\htdocs\test\yii2mod-app\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(166): cyberz\migrations\controllers\MigrationsController->getNewMigrations()
...
I was able to fix these two lines in at line 55 in vendor\cyberz\yii2-multipath-migrations\src\controllers\MigrationsController.php:`
foreach ($this->migrationLookup as $migrationPath) {
if(is_array($migrationPath) and count($migrationPath)==1) // NEW
$migrationPath = $migrationPath[0]; // NEW
$basePath = Yii::getAlias($migrationPath);
Regards
Joachim
there is problem in ''relatedTo' => $this->string(500)->notNull(),'
http://www.yiiframework.com/doc-2.0/guide-db-migrations.html#applying-migrations
migrationPath: string|array (defaults to @app/migrations), specifies the directory storing all migration class files. This can be specified as either a directory path or a path alias. Note that the directory must exist, or the command may trigger an error. Since version 2.0.12 an array can be specified for loading migrations from multiple sources.
I had to remove the class from console-local.php and set it to yiisoft's.
'controllerMap' => [
'migrate' => [
'class' => 'yii\console\controllers\MigrateController',
'migrationPath' => [
'@vendor/yii2mod/yii2-cms/migrations',
'@vendor/yii2mod/yii2-cron-log/migrations',
'@vendor/yii2mod/yii2-user/migrations',
'@vendor/yii2mod/yii2-comments/migrations',
'@vendor/yii2mod/yii2-settings/migrations',
'@yii/rbac/migrations',
],
],
I am working on my local machine using a MAMP setup which has multiple other Yii2 projects running.
Created new project with yii2mod/base, initiated the project, updated db config and then running - php yii migrate
I get an SQL error after about 4-5 minutes of running the command
Exception 'yii\db\Exception' with message 'SQLSTATE[HY000] [2006] MySQL server has gone away'
Below is log after running the command -
Yii Migration Tool (based on Yii v2.0.15.1)
Exception 'yii\db\Exception' with message 'SQLSTATE[HY000] [2006] MySQL server has gone away' in /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/db/Connection.php:624
Stack trace:
#0 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/db/Connection.php(996): yii\db\Connection->open()
#1 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/db/Connection.php(983): yii\db\Connection->getMasterPdo()
#2 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/db/Command.php(253): yii\db\Connection->getSlavePdo()
#3 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/db/Command.php(1143): yii\db\Command->prepare(true)
#4 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/db/Command.php(399): yii\db\Command->queryInternal('fetchAll', NULL)
#5 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/db/mysql/Schema.php(312): yii\db\Command->queryAll()
#6 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/db/mysql/Schema.php(125): yii\db\mysql\Schema->findColumns(Object(yii\db\TableSchema))
#7 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/db/Schema.php(744): yii\db\mysql\Schema->loadTableSchema('migration')
#8 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/db/Schema.php(194): yii\db\Schema->getTableMetadata('{{%migration}}', 'schema', true)
#9 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/console/controllers/MigrateController.php(210): yii\db\Schema->getTableSchema('{{%migration}}', true)
#10 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(875): yii\console\controllers\MigrateController->getMigrationHistory(NULL)
#11 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(166): yii\console\controllers\BaseMigrateController->getNewMigrations()
#12 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)
#13 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#14 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#15 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('', Array)
#16 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('', Array)
#17 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate', Array)
#18 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('migrate', Array)
#19 /Applications/MAMP/htdocs/ryberg/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(yii\console\Request))
#20 /Applications/MAMP/htdocs/ryberg/yii(25): yii\base\Application->run()
#21 {main}
Any chance I can get some help resolving this.
In order to make the CMS admin pages work, it is required to have these changes in config/main.php:
'modules' => [
'cms' => [
'class' => 'yii2mod\cms\Module',
],
'admin' => [
'class' => 'app\modules\admin\Module',
'controllerMap' => [
'cms' => 'yii2mod\cms\controllers\ManageController', // Instead of CmsController !
Regards
Joachim
Hi, first thanks for putting this together its saved me some time, I have installed the app and on my pc (xampp) and got it working perfectly, however im having problems on my live site, the problem is that when I login I am stuck in a redirect loop.
I have narrowed it down to when I have the remember me ticked on the login form, if it is not ticked the login works great and I am redirected to the home page, however this login only lasts for the session.
I have this on a shared hosting server so I have had to do a redirect from the root to the web folder and I think this may be the cause, I have tried many variations of the htaccess file in both the root and the web folder but still a redirect loop whenever I have the remember me ticked.
I have to delete the _identity cookie to be able to see the site again, I must point out that the redirect loop is on every page not just the index page.
If you have any ideas or suggestions on how to fix this I would appreciate it.
Kind regards
Wayne
yii2mod/yii2-user : dev-master
version to composer.json"bin-dir": "bin"
to config
sectionThe installation migration produces column names with dashes like created_at, auth_key,
The data in tests/_data reflects column names in camel case.
I changed the column names in the _data scripts to the ones using dashes; then the yii fixture "*"
script runs.
But then opening web/index.php/admin throws an error on "Getting unknown property: app\models\UserModel::createdAt".
Regards
Joachim
hi
i want to change dev environment to production after application completed in developing, how can i push the app in the production server? can be done automatically?(for example is it possible that dependency install automatically in the production server)
thanks for your extensions. is it possible adding an extension to manage theme in yii2 easily for exmple changing template from admin panel or sth similar to cms theme manager. it is really good and make yii2 and your extension make sense and amazing? this is really good cause adding an extra extension in your extension is really easy and make development of new features in the project faster which dont need to use cms and ... for regular features which take time to write from starting point.
I have tried to download the yii2 mod base but there is a problem ... the vendor file is lost
Thank you
In Configuration Step 3 Apply migrations when do
php yii migrate
PHP Warning 'yii\base\ErrorException' with message 'strncmp() expects parameter 1 to be string, array given'
in {project_path}\vendor\yiisoft\yii2\BaseYii.php:133
Stack trace:
#0 {project_path}\vendor\cyberz\yii2-multipath-migrations\src\controllers\MigrationsController.php(56): yii\BaseYii::getAlias()
#1 {project_path}\vendor\cyberz\yii2-multipath-migrations\src\controllers\MigrationsController.php(28): cyberz\migrations\controllers\MigrationsController->lookupMigrations()
#2 {project_path}\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(155): cyberz\migrations\controllers\MigrationsController->getNewMigrations()
#3 {project_path}\vendor\yiisoft\yii2\base\InlineAction.php(57): yii\console\controllers\BaseMigrateController->actionUp()
#4 {project_path}\vendor\yiisoft\yii2\base\InlineAction.php(57): ::call_user_func_array:{{project_path}\vendor\yiisoft\yii2\base\InlineAction.php:57}()
#5 {project_path}\vendor\yiisoft\yii2\base\Controller.php(156): yii\base\InlineAction->runWithParams()
#6 {project_path}\vendor\yiisoft\yii2\console\Controller.php(128): yii\base\Controller->runAction()
#7 {project_path}\vendor\yiisoft\yii2\base\Module.php(523): yii\console\Controller->runAction()
#8 {project_path}\vendor\yiisoft\yii2\console\Application.php(180): yii\base\Module->runAction()
#9 {project_path}\vendor\yiisoft\yii2\console\Application.php(147): yii\console\Application->runAction()
#10 {project_path}\vendor\yiisoft\yii2\base\Application.php(380): yii\console\Application->handleRequest()
#11 {project_path}\yii(25): yii\base\Application->run()
#12 {main}
In config/console.php
Add migrationPath to the $config['controllerMap']['migrate']
like below
'migrate' => [
'class' => 'cyberz\migrations\controllers\MigrationsController',
'migrationLookup' => [
'@vendor/yii2mod/yii2-cms/migrations',
'@vendor/yii2mod/yii2-cron-log/migrations',
'@vendor/yii2mod/yii2-user/migrations',
'@vendor/yii2mod/yii2-comments/migrations',
'@vendor/yii2mod/yii2-settings/migrations',
'@yii/rbac/migrations',
],
'migrationPath' => '@app/migrations'
],
Thats because BaseMigrateController->migrationPath default value is an array, and when we apply the migration String expected
Q | A |
---|---|
Yii version | 2.0.12 |
PHP version | 5.6.30 |
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.