Questions tagged [yii]
Use for questions about any version of Yii, an open-source MVC framework for writing web 2.0 applications in PHP5+
16,771
questions
0
votes
0
answers
14
views
Add CORS Headers to HumHub restfull apis
I am using HumHub with humhub restapis module. HumHub is using yii framework so I am following its Documentation but no luck so far.
Following the docs I added:
public function behaviors()
{
...
0
votes
0
answers
18
views
Yii server on local
guys. Good day.
I have an issue with Yii server on local.
I had to launch the Yii server on local and I typed command like below
> php yii serve --port=8081
Server started on http://localhost:8081/
...
0
votes
0
answers
15
views
Does Yii mock the components during http requests?
Seems like Yii doesnt mock the components during http requests like Laravel.
But how do that? Example is below
test's content
public function test_test()
{
$request = $this->...
0
votes
0
answers
16
views
yii:format array of number
can any body help me why autonumiric didn't work if I replace this code
<?php //ehco $form->field($modelDocs,"[{$i}]amount")->textInput (['maxlength' =>true,'dir'=>'rtl'])?>...
0
votes
1
answer
28
views
Yii2 CSS to asset folder
I have my site.css in my web/css/
which i declared here
namespace frontend\assets;
use yii\web\AssetBundle;
class AppAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl =...
0
votes
1
answer
20
views
yii select outputs only first column
I have this php code:
$categories = Yii::app()->db->createCommand()
->select('dt_add, name, domain, category, promo_type, hash, link')
->from('webmaster_links')
->where('...
0
votes
0
answers
15
views
How to create dynamic Checkboxlist in Yii?
I would like a help to solve this problem. I'm using Yii 1.1 and trying to create a dynamic CheckBox list in which its elements change depending on the value selected in a DropDown element.
I created ...
0
votes
1
answer
18
views
Yii2 How to get all values from column (DB)
I've been sitting for hours trying to find how to get values from table's iab_categories column category_name. I've found only the way to echo all table names:
$connection = Yii::app()->db;//get ...
0
votes
0
answers
13
views
how to call function from controller in view YII2? [duplicate]
I have controller in controllers/lk/reps/RepController
in controller I have a function
function printSomething(){
echo "Print something";
}
How I can to call this function in ...
0
votes
1
answer
10
views
Yii2 GridView convert date format from mm/dd/yyyy
I am trying to convert a date from yyyy-mm-dd to mm-dd-yyyy Yii2 GridView; however I don't know how the date function requires a timestamp, and I can't get a timestamp from this string.
0
votes
1
answer
25
views
How to modify migration column data type in Yii
so I've got a pipeline setup on Bitbucket, where the deployments occur. Last week we setup this migration:
public function up()
{
$this->addColumn('asset', 'running_hours','DECIMAL(...
0
votes
2
answers
17
views
Enabling pretty URLs / urlManager completely breaks Yii 2 application runnikg as a REST micro-framework
tl;dr My Yii 2 app, running as a micro-framework, works just fine when using standard ("not pretty") URLs. However when the urlManager application component is enabled in the configuration, ...
-1
votes
0
answers
16
views
Is there any way I can host views on different server and rest on another server in yii framework?
I am looking for solution in yii project where i can host the Views folder of yii framework on one server and the rest(controllers and modules) on another server. Is it possible with Yii framework php?...
0
votes
1
answer
24
views
How to use column of mPDF on Yii2?
I am using mPDF to convert my reports to PDF. I need two columns for my table but I am generating this error.
enter image description here
I already used different ways to add columns
<columns ...
0
votes
0
answers
33
views
Yii2 - yiisoft-queue listen to multiple channels
In my project, I want to use multiple queue channels and listen to each channel individually.
I used this way to handle it.
This code from config/main.php
This is a use of queue
is it a correct way to ...
0
votes
1
answer
60
views
Internal Server Error after login applicatioin
I am using docker for my yii1 application. And everything works. But after I login on my application. I get this error:
Internal Server Error
The server encountered an internal error or ...
0
votes
1
answer
31
views
running existing yii1 application in docker
I have a existing yii1 application. And I am using local xampp.
So I try to dockerise the existing yii1 application.
So This is my dockerfile in root folder:
FROM php:8.1-apache as dev
ENV ...
0
votes
1
answer
26
views
how do I change the validation message from 'required' on max character limit?
I keep getting the message 'required' when the character validation of 'max'is exceeded, but I have specified 'message' /'tooLong' to say "max character limit is 2.
Any help?
My model:
/**
* ...
-4
votes
1
answer
30
views
Integrate SCORM In PHP YII Framework With PHP Version 5.4
I Am Working On YII Framework In Which I Have To Integrate SCORM, And I Am Not Able To Understand That What Will Be The Best Way To Get This Done, I Am Totally New To SCORM I Have No Idea About SCORM.
...
0
votes
1
answer
98
views
How to connect Mysql database over SSL in php?
I have a YII 1 application. And I try to connect with the Azure database.
I can connect with the azure database if I disable the option: Enforce SSL connection
But of course I want to enable this ...
1
vote
0
answers
63
views
Yii2: How do I pass a PHP variable that is assigned in Grid table to a Modal?
I have an issue that I have to retrieve the PHP Variable from the Grid to the Modal.
The situation is like this:
This is one of my columns which I name as 'flag', there is a condition state in the ...
0
votes
0
answers
9
views
Alias "ext.bootstrap.components.Bootstrap" is invalid. yii1
I have a yii1 application and I try to run it. But I get this error:
Alias "ext.bootstrap.components.Bootstrap" is invalid.
C:\xampp\htdocs\websuite_test\protected\vendor\yiisoft\yii\...
0
votes
0
answers
22
views
What is the correct .gitignore folder for a Yii1 application?
I am struggeling with a git repository for a YIi1 application. Because I Have a Yii1 application with the following folders:
css
protected
assets
themes/AdminLTE
And this is my .gitignore file:
....
0
votes
1
answer
19
views
How to install composer.json in Yii1 project?
i have an existing Yii1 project but without the assets folder. So only the folders: css, images, protected.
So I made just an empty composer.json file in the root directory. And I did a
composer ...
0
votes
0
answers
28
views
How to run yii applicatioin from repo?
I have a repo where you can clone a yii 1 application. But after I checked everything in. I just wanted to test if you can run the application. So I donwloaded the project and I tried to run the ...
0
votes
0
answers
21
views
Yii1 DB transaction timeout is ignored when selecting for update and the row is locked longer than the timeout
When the DB transaction is timeouted the transaction is still active and seems to only finish executing after PHP transaction timeout
If I lock the table outside of Yii and do not commit
START ...
0
votes
1
answer
44
views
yii2 and mssql insert varbinary into model
Hi everyone I have a sql server table that contains fields that are of type varbinary.
The table model sees the field as a string, when it tries to save it it gives me the following error
SQLSTATE[...
0
votes
1
answer
17
views
How to do logging in yii 1application?
I have a YII 1 application. And I try to activate the logging. So I have this class:
config/main.php
<?php
use Grabber\GrabberModule;
use Monitor\MonitorModule;
use Scrape\ScrapeModule;
use Trends\...
0
votes
0
answers
32
views
Debug CController class in Yii1 app with Xdebug
I have a Yii1 application and I am trying to debug the application with Xdebug.
The part that I want to debug is a controller action:
<?php
namespace Scrape\controllers;
use Google\AdsApi\AdWords\...
0
votes
2
answers
111
views
Fatal error on Yii framework page on PHP 8.1
I just had this error when I updated to PHP 8.1:
Fatal Error: Cannot use 'Object' as a class name as it is reserved on line 77
I guess it used a reserved word as an actual class. How can I solve this?...
0
votes
0
answers
33
views
Select2 Not Showing options
I'm updating two websites both built within YII framework, one has the older version installed and has the new version. I'm facing almost similar problem regarding the Select2 plugin. when using ajax ...
0
votes
0
answers
133
views
How to debug a Yii application in Visual Studio Code?
I've installed Xdebug. And I'm trying to debug a Yii application (version: 1.1.24). But if I put a breakpoint on the method nothing happens.
But if I make a very simple example script file in another ...
0
votes
1
answer
81
views
.gitignore file with yii framework
I have a yii 1 application. And I have a .gitignore file in the folder: Yii/sdi. The file .gitignore looks like this:
assets/*
!assets/.gitignore
protected/runtime/*
!protected/runtime/.gitignore
...
0
votes
0
answers
30
views
Why the default rule does not work in Yii2?
I created a model with the following content:
class User extends \yii\db\ActiveRecord implements IdentityInterface
{
const STATUS_DELETED = 0;
const STATUS_ACTIVE = 10;
public static ...
0
votes
1
answer
31
views
Yii2 redirect to previous page after update review
I have a page comp/computer?id=15
it has reviews that can be edited through link
http://comp/computer/update?id=3 = with FORM and submit button
how to go back after sumbit
public function ...
0
votes
0
answers
47
views
require vendor/autoload taking 14 seconds
In our development teams, a decision has been made to not use composer (Not sure why yet). So whenever we want to use a package from 3rd party, we just use composer but copy and paste the files ...
0
votes
0
answers
64
views
Fatal error: Uncaught Error: Class "YiiBase" not found in Yii.php
I have an existing yii 1 web application. And I want to upgrade from yii 1.1.24 to 2.0.45.
The upgrade is in this case necessary. Because In the old application they use
PHPExcel
But this doesn't ...
1
vote
0
answers
21
views
How do I add selecting of tasks in this code rather than performing all Yii
I have a page where 'Tests' are done on tasks. Currently it will load the tasks and clicking Perform it would run the tests on these tasks. But I need to modify in such way that instead of it ...
0
votes
1
answer
205
views
MySQL on Xampp localhost very slow
I have a local instance of a large SQL and Yii application. The db is 2.6gb. On the server there is no issue and the site loads with no problems however on local host its crawling to get certain ...
0
votes
1
answer
104
views
Yii2: Controller action parameters with a dash?
If I have a URL like https://example.com/controller/action?customer-id=7414 how do I get customer-id in my action parameters? Since a dash is not allowed in variables names I cannot do the following!
...
0
votes
0
answers
72
views
How to upgrade from yii1 to yii2
I have a old YII1 project, version: 1.1.24.
And I want to upgrade to YII2. And of course I have read the official documentation:
https://www.yiiframework.com/doc/guide/2.0/en/intro-upgrade-from-v1
So ...
1
vote
1
answer
44
views
Non-static method common\components\DirectoryHelpers::mimeType() should not be called statically
totally php newbie here.
need help about our library program here.
i try to upload our book cover to our webserver, but get this error instead.
the problem lines here
got this task to connecting our ...
0
votes
0
answers
35
views
How to call multiple sql stored procedures when the previous one has finished in yii
I am working on an application in which the user can generate work shifts for his employees. Usually this action is based on a lot of past information and it executes in midnight on three cron jobs (...
0
votes
1
answer
21
views
Delete all model queries in yii
AllAdjustments::deleteAll(['plan_year_id' => $plan_year_id, 'column_type' => array_keys($allAdjustment), 'is_auto' => $is_auto,
['NOT',['column_id'=>1]],
]);
...
0
votes
0
answers
40
views
JSON encode foreach loop array from $this->data
$myArray = array();
$myArray[] = array(
"id" => 1,
"floorunit" => isset($this->data['addstop_floorunit1'])?$this->data['...
0
votes
1
answer
40
views
Create form input using modal in yii2 does not validate
controller
public function actionCreate() {
$model = new Ceremonia();
if ($this->request->isPost) {
if ($model->load($this->request->post()) && $model->save()){ ...
0
votes
0
answers
30
views
Set method in Yii 1.1 data caching system always returns false value
We have a web application which is based on Yii 1.1 . I want to cache some data so I found Yii documentation about data caching and I did it step by step but set method always return false when I ...
0
votes
1
answer
33
views
Writing htaccess that points to a file in the sub-directory
I have a order page in the following path
https://example.com/backend/web/order
And I want to display it as
https://example.com/order
What should be the htaccess code (please let me know of every ...
1
vote
0
answers
33
views
Yii 1.1 : Loading data (coming from API) in Yii Grid View
I have an API endpoint which will give a response json when queried.
Here is the response object:
[
{
"number": 1,
"name": "ABC"
},
{
&...
0
votes
1
answer
35
views
Best Approach for Multi-Tenant Caching with Yii 1.1 on X2 CRM
I am working on a CRM project using the X2 Engine CRM. The app has File based caching built in and it works well when deployed as a single tenant application. However, I am using this in a multi-...