Questions tagged [yii2-basic-app]

Yii 2 Basic Project Template is a skeleton Yii 2 application best for rapidly creating small projects.

Yii 2 Basic Project Template is a skeleton Yii 2 application best for rapidly creating small projects.

The template contains the basic features including user login/logout and a contact page. It includes all commonly used configurations that would allow you to focus on adding new features to your application.

GitHub

Official Site

800 questions
2
votes
1 answer

Model relations not recognized in Yii2

I have 2 models created called User and ReferralsForm where Users is the parent and ReferralsForm is the child. There are two foreign keys I am assigning to ReferralsForm from Users but with different names. I am using Gii to generate my models…
codex
  • 432
  • 2
  • 7
  • 18
2
votes
2 answers

Yii2 Change id in URL

Is it possible to change id in URL in Yii2 basic to something else my URL actual is http://localhost:8585/yii40/wfp/web/post/view?id=368 I want to change it to http://localhost:8585/yii40/wfp/web/post/view?post=368 My View is public function…
Bynd
  • 675
  • 1
  • 15
  • 40
2
votes
0 answers

How to override/extend the namespace methods, with using \Yii::$classMap

How to override/extend the namespace methods, with using \Yii::$classMap I want to override/extend the beforeAction($action) method for yii\base\Controller, like this. namespace yii\web; class Controller extends \yii\web\Controller { public…
2
votes
3 answers

How to create horizontal scroll bar in Admin LTE in yii2?

I am using yii2 basic. I have installed Admin LTE and is working. Now I have Employee CRUD. When admin views the view of particular employee, then the details are going out of the screen horizontally i.e, there is no horizontal scrollbar to scroll…
Questions
  • 69
  • 1
  • 12
2
votes
1 answer

yii2 select column from relation table trouble

i want choose all devlopers table data , with only "username" column in User table i write this but i get error $model = Developers::find()->select('*')->with(['users' => function($q){ $q->select('username'); …
moh
  • 433
  • 10
  • 33
2
votes
1 answer

access controller variable in NavBar items

in my layout file at navbar i have item called message . i want to show number of message above it actually i can build a hidden element and acho my variabe inside it and get it again and append it to empety element in item with Jquery ... but i…
moh
  • 433
  • 10
  • 33
2
votes
1 answer

How to add custom controller to extension in vender folder in yii2?

I have an extension yii2-admin for RBAC, and I would like to add to this extension another controllers, views, models etc. Because in this module I would like to keep all operations who admin like CRUD for User table and for another. What is the…
2
votes
1 answer

How to get value of selected option of yii2 select2 widget

I am trying to get the value of selected option within same page. I am using select2 widget. Group'; $data = ['1' => 'option1', '2' => 'option2']; echo Select2::widget([ 'name'=> 'group', …
snew
  • 25
  • 1
  • 4
2
votes
2 answers

yii2 conditional validation on server side

I have one form that form have below fields i)Book ii)Amount Controller action: public function actionBook() { $model = new Book(); if ($model->load(Yii::$app->request->post()) && $model->validate()){ print_r($model);exit; …
Vishva G
  • 399
  • 7
  • 25
2
votes
2 answers

Yii2 formatter locale not working

I'm having a problem with the yii2 date formatter, it doesn't use the locale that I have set. The global language is set to de-DE, it seems to take effect everywhere except for the date formatter. I've tryed to set the formatter locale in the config…
user1563232
  • 361
  • 3
  • 17
2
votes
2 answers

yii2 rest api basic auth throws 401 unauthorized

I am developing an api using yii2 REST Api basicauth. I have successfully developed in my local xampp server. I have deployed the code to a vps running centos. But i am getting the following unathorized response: { "name": "Unauthorized", "message":…
Chamindar2002
  • 223
  • 3
  • 15
2
votes
2 answers

Yii2 basic template to make separate session for frontend & backend

I am using the Yii2 basic template to create an admin panel. For the admin login I have used the useridentity class and the default user model of yii. Now I have to create the login for the frontend. What should I do to make the separate login so…
2
votes
1 answer

yii2:Call to undefined method Closure::allows() in denyCallback

i use Yii2 framework this is my behaviors function in ShippingController public function behaviors() { return [ 'access' => [ 'class' => \yii\filters\AccessControl::className(), 'rules'…
Saltern
  • 1,305
  • 2
  • 16
  • 42
2
votes
1 answer

Yii2. Apply Custom URL rule class

I have created a custom URL rule and want to put some logic there, but parseRequest and createUrl methods are not executing.
D.R.
  • 2,540
  • 3
  • 24
  • 49
2
votes
1 answer

yii migrate/up always running from start

when I run below command after creating new migration on postgres driver, I am getting errors migration table already exists. ./yii migrate But the first migration that created "migration" table already completed succesfully. Error Info: Array ( …
Shrikant
  • 384
  • 2
  • 10