I've been having success with the Yii2-sphinx extension, but now I'm looking to implement distance search using sphinx. Specifically, I need to set latitude and longitude filters for a given postcode on my index. How can I go about setting up the ...
As per the instructions provided in the Yii2 documentation, the recommended way to construct a URL is as follows: $appUrl = Yii::$app->urlManager->createUrl([Yii::$app->controller->id . '/' . Yii::$app->controller->action->i ...
I am looking to integrate a shared controller directory into my Yii2 project. Inside my frontend/config/main.php file, I have the following setting: 'controllerNamespace' => 'frontend\controllers', My goal is to include both ...
After spending some time trying to figure it out, I finally realized the solution, which was a bit obvious. I am sharing my answer here so that others can benefit from it and also to see if there is a more efficient way to handle this issue. The problem I ...
Hello there, I am seeking guidance on how to implement an ajax function in yii2. I am currently developing a product within the yii2 framework and wish to incorporate charts such as chartJs, googleChart, or d3. In the index file of the backend area (xx/xx ...
I recently created a bespoke response class and attempted to integrate it within a module. Despite returning an array of results in the controller action, the custom response class failed to be utilized as expected. Instead, the default yiiwebResponse ...
I am looking to create draggable elements in a Yii2 advanced application. I have tried using PHP and HTML examples similar to http://jqueryui.com/draggable, but so far it has not been successful. Can anyone provide assistance? Below is the code from the vi ...
Essentially, I employ standard AJAX methods on action1 to transmit a request to action2, retrieve the produced data, and exhibit it on action1. In action2, which is accessed via a basic JS AJAX request, I return a page that has been rendered by renderAjax ...
I am attempting to extract data from a Bootstrap modal (which contains a table of Kartik GridView) and pass the selected value to the parent form (an action create form). Can anyone provide guidance on how to achieve this? The modal form includes fields su ...
Currently, I am using the Yii2.0 search functionality and have encountered a situation where the ajax search works effectively when displaying the grid as is. However, I need to modify the layout (refer to the screenshot below) in order to conduct the sear ...
My predicament revolves around a certain checkbox that lacks any distinguishing attributes for identification. Despite my attempts with xpath, I have not been able to successfully interact with it. Below, you will find the complete HTML code snippet where ...
Dealing with a model that includes a captcha has been challenging. I am able to successfully create new records using a form with captcha, but encountering an issue when attempting to update the data. An error message stating "The verification code is in ...
One of the elements in my project is a checkbox: <div class="checkbox"> <label> <?= Html::checkbox('chocolate', false) ?> Chocolate </label> </div> In addition to that, I also have a span ta ...
I recently stumbled upon a piece of code that I am currently working with. It is a Yii2 Gridview integrated with Pjax and action buttons. One interesting feature is that when the delete button is clicked, the pjax loads the delete route which in turn delet ...
I'm encountering an issue with a Modal popup that contains two fields. The first field is used to submit information and perform an internal database query, while the second field should display the returned data. Oddly enough, when testing the functionali ...
Is there a way to specify the width for a certain column, such as 'file_name', in my Yii2 GridView? I've tried some suggestions from here, but none of them seem to work for me. I have also considered making columns resizable, but I'm unsure about how to i ...
I am just starting to learn React js and I am using Yii2 as my backend. When I make an API request to Yii2, it returns a 500 error. I am not sure where I have gone wrong in my code. Below is my ReactJs code for the API call: fetch('localhost/learning-rea ...
Initialize() method : public function initialize() { } Constructor() method: public function constructor() { } Therefore, what sets them apart and which one should be employed? ...
As a newcomer to Yii2, I appreciate your understanding. I am currently using MariaDB as my database engine. For instance, if I input 'bosiljcic' in the queryParams and there is no exact match in the database, I receive an empty string response from the A ...
I found a helpful post on Stack Overflow about creating a Yii2 Gridview with a fixed first column (Yii2 : Gridview with fixed first column), and now I'm looking to add a horizontal scrollbar at the top of the grid. My users really appreciate being able to ...
I have experience creating apps using Yii2, but I am encountering an issue with the login functionality. It seems that the passwords are not matching up. _form.php <?= $form->field($model, 'first_name')->textInput(['maxlength' => true]) ?> ...
I'm currently working with the Yii2 PHP framework and utilizing Kartik's FileInput widget in my project. I followed this guide on handling multiple file uploads, but unfortunately, it didn't function as expected in my setup. MongoDB serves a ...
I'm currently facing a challenge with forms in Yii2. My objective is to design a form that includes three dropdown menus, inquiring about the user's preferred time(s) during the week. The first menu will focus on selecting days of the week, while ...
Having an issue with yii2 and in need of assistance: I have two databases, db1 and db2, both on MsSQL. In db2, there is a view linked to a table in db1. The problem arises when I try to insert into db2 as I am unable to retrieve the transaction id using ...
Are you looking to update the selected value of a dependent drop-down menu? Even after using ajax to load values into the dependent drop-down, the following code does not seem to be working: $("#dependentDropDownID").select2("val", data); This code appea ...
I recently started using the Yii2 framework. I have successfully displayed data for a table using DetailView::widget. Now, I am trying to call another DetailView::widget for a different table and display it on the same view. Can someone help me with this? ...
Within my Yii2 application, I have a contact form that utilizes Swift to send emails. The configuration of my application is set up as follows: Below are the configurations found in web.php: 'mailer' => [ 'class' => &ap ...
When working in SQL, I was able to select records where their IDs are divisible by 4 using the following query: SELECT id FROM table_name WHERE id%4 = 0; However, when attempting this in Yii2 active record, it resulted in an error: $model = Verses::find() ...
After installing the Yii2 framework, I decided to run requirements.php to check if all PHP extensions were loaded properly. To install icu4c, I used brew: brew install icu4c I also installed intl using PECL like this: /Applications/MAMP/bin/php/php5. ...
Can anyone suggest an alternative to using bootstrap.css and bootstrap.js? I've attempted the following: 'assetManager' => [ 'bundles' => [ 'yiiootstrapBootstrapAsset' => [ 'css' => [], ], ], ], While th ...
I am attempting to query my database in Yii framework. $query = Task::find() ->where([Task::tableName().'.parent_id' => 0]); $query->leftJoin(TaskModel::tableName(), [TaskModel::tableName().'.task_id' => Task::table ...
Within my database, there exists a table known as 'vehicle master' that contains various fields related to vehicles. vhcl_no department vhcl_type vhcl_make fuel_type chassis_no engine_no manufacture_on cubic_capacity rcbook_no rcbook_valid_till ...
File Manager - Home Normal https://i.stack.imgur.com/7C5lH.png I primarily utilize AJAX callbacks for most of my content. Whenever I click a link button on the page, it triggers a modal pop-up using jQuery events and a specific class. The Tour Guide implem ...
I have encountered an issue where, while receiving data from an ajax call, I am also getting unnecessary data such as all the contents of my PHP files. The problem is illustrated in the image below. How can I resolve this issue? https://i.stack.imgur.com ...
Looking to pass an array to my view that includes headings and corresponding content lists. The structure of my array is as follows: Array ( [0] => Array ( [trimester] => Trimester1 [subject] => ABC ) ...
After successfully logging in to my Yii2 + angularjs page, I store user data in a cookie using the following code snippet: $jwt = JWT::encode(array(1,2,3), 'myKey123') setcookie('myData', $jwt, time() + 3600); In order to access this ...
As a beginner in Yii, I am seeking guidance on applying image validation for .svg and .png files only when the user selects an image. public function rules() { return [ [['logo'], 'file', 'extensions'=&g ...
I'm currently working on the Yii2 Bootstrap active form and I have a requirement to group multiple inputs within one form group. For example: <div class="form-group field-phn required"> <label class="control-label" >Home ...
When sending an array using $http post, I follow this approach: var results = services.transaction('orderdetails/insert', {customer_id: $scope.order.customer_id, data: $scope.orderDetail}); The variable $scope.orderdetail ...
After implementing the following code: this.http.post('http://l.example/angular/create/', {name: 'test'}).subscribe( (response) => console.log(response), (error) => console.log(error) ); I encountered an error on ...
There are 3 tables: Network, Company, Departments Information for Network id Name 1 Network1 2 Network2 Details for Company id network_id name 1 1 Company 1 2 1 Company 2 Departments Summary id company_id name 1 1 Dep 1 2 ...
I'm currently using Yii2-advanced-app and I have encountered an issue. I want to pass the selected value from a dropdown menu to a PHP code that displays a list with checkboxes on the same page. Here is an image for reference on what I am trying to achieve ...
I included the following code in my form: <?php echo Html::fileInput('imageFile', '', array('id' => 'contentForm_imageFile' )) ?> Then, I attempted to retrieve the file in the controller using this code: $newsModel->imageFile=UploadedFile::g ...
In our current project, we are customizing graphs to meet a specific client requirement. The majority of the graphs we are working on involve a combination of line and column charts. Each graph requires a dropdown with a minimum of two levels, sometimes ex ...
I am working on a button functionality that increases the button id when clicked. Below is the HTML code for the button: <input type="button" id="repeataddon-1" name="repeataddon" class="repeataddon" value="add" > Accompanied by the following scr ...
Currently, I am facing an issue with my Yii2 setup where I have 2 modules and I want to enable users to log in separately to each module using a different IdentityClass. However, once a user logs into one module (let's say Module A), they are automati ...
When I selected the Id Province, I couldn't select the Id City. How can I fix this issue? Controller code snippet to address this: View code snippet for the same: ...
My application is built using the Yii2 framework. Within my application, there is a view.php file that consists of an element and a button. The element, <div id="userId">, contains the user's login ID, and I aim to use the button to re ...
When an AJAX request is received, I need to provide feedback to the user before the PHP script completes its process which could take a long time. I attempted to use the send() method of the yiiwebResponse object for this purpose. Here's what I tried wi ...
I understand how the migration process works and have previously created migration files. I began by creating a migration file using the following command: php yii migrate/create implants_type This resulted in the following code being generated: <?ph ...
I have a complex query that I need assistance with. select t.id, t.ad_id, sum(t.impression) total_impression, sum(t.view) total_views, sum(t.clicks) total_clicks, t.publisher_id, i.budget, i.name_of_campaign from (select id, ad_id, ...
I am currently utilizing Yii2 along with Select 2. I have attempted to implement examples involving optgroup that are loaded through ajax. The browser sends requests, but unfortunately nothing is displayed when I attempt to print the results. Below is the ...
Let me begin by outlining the setup I currently have: --A database table named "cases" This table stores all the cases to be displayed in a grid view --Three tables: Category, Subcategory, and ChildCategory The cases in the "cases" table are linked to ...
I'm looking to create a table gridview with a floating header, where the tbody and thead are not the same. The image appears after refreshing the page, before the modal is refreshed. After refreshing the modal, this modal is inside pjax and it sets t ...
I am trying to update the timestamp column in my Grid view to display the date and time in my local timezone. [ 'format' => [ 'class' => 'yiii18nFormatter', 'timeZone' => 'Asia/Singapore', ], 'attribute' => 'created_ ...