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
3
votes
2 answers

Error in accessing post json data in yii2

Am passing data to yii2 using ajax request but i keep on getting a 500 error This is the ajax request code:
Geoff
  • 6,277
  • 23
  • 87
  • 197
3
votes
2 answers

Filter result Pagination not working in yii2 gridview

im using Pjax gridview,After I search the results,when I click pagination ,the results changed to default results page not search result. and my search function is like public function search($params) { $query = UserLogs::find(); …
Jackhad
  • 411
  • 3
  • 8
  • 19
3
votes
2 answers

Invalid JSON data in request body: Syntax error POST Call Rest API YII2

When I try to post using Postman,I get this error {"name":"Bad Request","message":"Invalid JSON data in request body: Syntax error.","code":0,"status":400,"type":"yii\\web\\BadRequestHttpException"} My controller is `class CountryController…
Jackhad
  • 411
  • 3
  • 8
  • 19
3
votes
1 answer

Two different layouts for Guest User & Logged in User- Yii2

Previously, I was having main.php where header & footer were declared. Which is Ok. Now, I am looking for 2 different layouts for Guest User & Registered User. In which Registered User and Admin will have different header & footer. I am using Yii2…
Nana Partykar
  • 10,556
  • 10
  • 48
  • 77
3
votes
1 answer

Yii2 grid view filter sql

Hi every one I have a grid view with SQLDataProvider and I'm doing the ModelSearch. Every tutorial on internet are with ActiveDataProvider and I don't want to use ActiveRecord because of the way I'm using my database. So my question is : how can I…
Samaël Villette
  • 318
  • 3
  • 25
3
votes
3 answers

How to create a directory inside a directory in yii2 and upload file into that directory

I have a form ['enctype' => 'multipart/form-data']]); ?> field($userformmodel, 'user_image')->fileInput(); ?> 'btn btn-primary']) ?> …
3
votes
1 answer

Yii 2 installation error

I am installing new yii2 project.I have already installed the controller .but when i run following command in terminal php composer.phar create-project --stability=dev yiisoft/yii2-app-basic my_yii2_trial and for php composer.phar create-project…
Rshingate
  • 53
  • 6
3
votes
1 answer

How to Extend Yii2-user dektrium profile model to be able to adding more fields

I need to override the default Profile model. I have managed to add the fields i need but there is something i am missing since. On insert and update these fields are not getting update to the database. I have created the necessary migrations so i…
chapskev
  • 972
  • 9
  • 27
3
votes
1 answer

Call to undefined method app\models\Message::model()

I am new with Yii2, using Gii tool,I have created the model and CRUD components for simple 'Message' class with one field 'content' mapped to tbl_message. I am getting error, When trying to retrieve one message object by using findByPk function as…
M_Idrees
  • 2,080
  • 2
  • 23
  • 53
3
votes
1 answer

How to use display data from two tables in yii2

i have 2 tables in my project MainAds and AdsImage and its structure is as follow MainAds AdsImage id id category main_ads_id description image title price and I have the following listview
Bhavuk Suthar
  • 101
  • 1
  • 12
3
votes
1 answer

On First Click, Original Page Coming. But, On Second Click, 'Page Not Found' Error Coming. - Yii2-App-Basic

I got one awkward issue. My views/layout/main.php is: echo Nav::widget([ 'options' => ['class' => 'navbar-nav navbar-right'], 'items' => [ Yii::$app->user->isGuest ? ['label' => 'Register', 'url'…
Nana Partykar
  • 10,556
  • 10
  • 48
  • 77
3
votes
2 answers

URL not accepting alpha numeric parameter - Yii2-app-basic

As soon, i'm passing 41 in URL. confirm.php prints 41. http://localhost/yii2-app-basic/web/site/confirm/41 But, when i pass "cfeb70c4c627167ee56d6e09b591a3ee" or "41a" in URL, http://localhost/yii2-app-basic/web/site/confirm/41a it shows error NOT…
Nana Partykar
  • 10,556
  • 10
  • 48
  • 77
3
votes
5 answers

Custom Validation Not Working- Yii2-app-basic-Yii2

I Posted one question yesterday regarding custom validation for radio button Textfield Mandatory On Radio Button. I got answer. But, that was not exact answer. But, it solved one problem of mine. Actually, I've 2 radio…
Nana Partykar
  • 10,556
  • 10
  • 48
  • 77
3
votes
3 answers

Sending Mail - Yii 2.0

I'm trying to send mail, but getting error like. Unknown Property – yii\base\UnknownPropertyException Getting unknown property: yii\web\Application::mail After changing Yii::$app->mail->compose() to Yii::$app->mailer->compose() I got this…
Nana Partykar
  • 10,556
  • 10
  • 48
  • 77
3
votes
2 answers

Protected Directory existence and creating custom validator in Yii2

I was searching for password strength meter for Yii2. I found this article for Yii1. I saw protected directory mention there. I'm unable to find this folder. Is it available in Basic Application Template or Advanced Application Template?
Nana Partykar
  • 10,556
  • 10
  • 48
  • 77