Quantcast
Channel: Yii Framework Forum
Viewing all 18717 articles
Browse latest View live

include(CJavaScriptExpression.php): failed to open stream: No such file or directory

$
0
0
Hi,

Am using Yii 1.1.8 Version Got error like,

include(CJavaScriptExpression.php): failed to open stream: No such file or directory

When add Below Code
<?php
echo CHtml::ajaxButton('ButtonName',Yii::app()->createUrl('/admin/m3sections/search'),
array(
'type'=>'POST',
'data'=> 'js:$("#fliter-form").serialize()',
'success'=>'js:function(data){ alert("teetee"); }' ,
'error'=>'js:function(data){ alert("comment NOT Submitted");}',
),array('class'=>'someCssClass',));
?>

Error al instalar adminlte

$
0
0
Buenos dias,

quiero instalar el AdminLTE pero al ingresar este siguiente codigo me sale el sifuiente error:

'view' => [
'theme' => [
'pathMap' => [
'@app/views' => '@vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-app'
],
],
],

Agradeceria su gran ayuda

  • : Captura.PNG

CButtonColumn Ajax Post button?

$
0
0
Hi All,
I need to add a button to my CButtonColumn that calls an action in my controller via AJAX/POST.
This button will simply change a field in a table from unpaid to paid.
I have the following in my view right now.
		array(
			'class'=>'CButtonColumn',
			'template'=>'{view}{update}{delete}{pay}',
			'buttons'=>array(
				'pay'=>array(
					'label'=>'Pay',
					'imageUrl'=>Yii::app()->request->baseUrl.'/images/pay.png',
					'url'=>'Yii::app()->createUrl("commissions/pay", array("rep"=>$data->salesrep_id, "id"=>$data->id))',
				),
			),
		),

But i want to have any editing request done via POST and not GET.
I've looked over the forum and Google and haven't been able to find any clear examples documented.
Any thoughts would be appreciated.
Thanks in advanced!!

Oliver

multilingual site with language code at the beginning of routes

$
0
0
Hi everyone,

I've searched, without success unfortunately.

I have a yii 1.1.14 website that needs to be extended in other languages. I would to know if is possible to have routes like:

- mydomain.com/en/...
- mydomain.com/de/...
- mydomain.com/fr/...

Anyone knows some extensions or whatsoever integration?

Thanks a lot

Yii 1.1.17 is released

Yii 2.0.13 is released

$
0
0
We are very pleased to announce the release of Yii Framework version 2.0.13. Please refer to the instructions at http://www.yiiframework.com/download/ to install or upgrade to this version.

Version 2.0.13 is a minor release of Yii 2.0 which containsmore than 90 enhancements and bug fixes.

There are minor changes that may affect your existing applications and also an important change about compatibility with PHP 7.2, so make sure to check the UPGRADE.md file.

Huge thanks to the Yii community for all the valuable contributions!

For more details about the release, see the related release news announcement.

User city for profile

$
0
0
Hello,
I'd like to allow the user to enter his home town in his profile (using Yii2-user) and get it's coordinates (to later show how far appart users are).
I tried getting the geonames database, but it's very slow for the user to select a city.
I was hoping to be able to query google maps api for a quick autocomplete input field or something similar (ideally free).
Any ideas ?
I've see there are google maps extensions, but I don't need to display maps or anything, just to select the city and get it's latitude and longitude to calculate distances.

Thanks !

Cheers

Bennn

Not Found (#404) Page not found.

$
0
0
Hi. I'm a beginner. I have a when to open CRUD or to create table fields at link address
: 404 not found.jpg
my table is WsbNewsCategory.
i have declared namespace backend\models;
Do you have this problem like this when installing yii 2

create short object

$
0
0
hi guys
i saw some one use app() instead of Yii::$app
How is this possible? and how to use it

how to bind stored procedure to yii2

$
0
0
this is my stored procedure plz any one help me to slove using mysql/mssql

ALTER PROCEDURE [dbo].[Emp]
-- Add the parameters for the stored procedure here

@empcode varchar(250)

AS
BEGIN


-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
declare @qry varchar(50);

--set @emp_id=1;
SET NOCOUNT ON;

-- Insert statements for procedure here
set @qry=(
SELECT empcode from acerp_employee_details
where empcode=@empcode);
return @qry
--execute Emp



END
this is my search part


$empcode='AI000064';
$query = Yii::$app->db->createCommand("CALL Emp(:empcode)")
->bindValue(':empcode' , $empcode)

Yii2 app with CraftCMS (built on YII1.1)

$
0
0
Hey guys/gals,

I'm beginning the process of breaking our PHP app that is built inside CraftCMS out into a Yii2 app. Before I get into my question(s) here are some background details:

Tech stack:
CraftCMS 2.6.2993 (uses Yii 1.1.19)
AngularJS (1.6)
PHP 7.0.x
Ubuntu 16.04 (Apache 2.4.18)

How it works:
1.) User visits a URL and Craft determines that's a URL we have defined (non 404).
2.) CraftCMS serves up the HTML via a template which we plug our angular app/partials into.
3.) User interacts with something on the screen (ie: submit button) that requires us to go get data from an external source (another REST api).
4.) JS function called which runs an $http.post() to the backend (same server so just posting to index.php).
5.) CraftCMS controller receives request and processes then returns JSON back to the AngularJS app.

What I need to do:
Run Yii along side CraftCMS on the same server and have them differentiate which one should be receiving given request.
Move template loading into YII (that's phase 2).

The end goal is to have CraftCMS run as "headless/content as a service" where it's essentially just a content management API to request content from and serve up on the page. Yii will then be handling all of the template loading and PHP business logic instead of having them as CraftCMS plugins.

Technical details:

Currently the way we call CraftCMS to get session data/etc is to do an $http.post() to /index.php and the postbody contains an "action" key that specifies which counter should receive this request.

Unfortunately I'm having trouble calling a Yii controller using the same logic. We have a "validate" plugin that contains a controller "Validate_AddressController.php" with a function "actionValidateAddress()". This action receives a JSON body with the address and it then calls out to an external vendor to actually validate the address.

However, when I try to post to this controller action I'm unable to hit it. It appears that CraftCMS is receiving the request first and then returning a 404 immediately and/or YII is never receiving the request.

Folder Structure:
<project folder>
    <craft>
    <backend>
        <yii files>
            <controllers>
                 - AddressController.php (the file I want to call).
    <src>
        <js files>



How can I set this up to differentiate which requests should go to CraftCMS and which ones should go to Yii2? Am I attempting to post incorrectly to Yii? I've tried to do $http.post('/address/validateAddress', {body}) but this doesn't seem to work.


TL;DR -- I want to treat Yii2 almost like a restful API but it needs to exist on the same server as another YII app.

Zależności standardowo dołączonych bibliotek JS

$
0
0
Witam.

W pliku: yii/framework/web/js/packages.php są zadeklarowane zależności bibliotek JS ale deklaracje te u mnie nie są respektowane przez Yii. Dlaczego?

Presentator.io

$
0
0
Hi everyone,

I've recently launched the beta version of a new and free online web design and collaboration platform - www.presentator.io (of course it is powered by the latest Yii version).

Hope you find it useful :)

Class 'yii\web\CHttpException' not found

$
0
0
I am trying to generate 404 error using the following call:
throw new \yii\web\CHttpException(404, 'User not found')


I get error 500 sent to the browser. When I look into nginx logs I see:

Quote

PHP Fatal error: Class 'yii\web\CHttpException' not found in /path/to/file/...


Any ideas how to fix?

Yii 2.0 Beta Is Released

$
0
0
Hi all,

After nearly half a year of intensive development, we finally reached the beta milestone. We are very glad to announce that Yii 2.0 beta is released. You may find more details about what this release includes here: http://www.yiiframework.com/news/77/yii-2-0-beta-is-released/

We would like to say thank you to all for making this possible. Cheers!

- The Yii developer team

Yii2 app with CraftCMS (built on YII1.1)

$
0
0
Hey guys/gals,

I'm beginning the process of breaking our PHP app that is built inside CraftCMS out into a Yii2 app. Before I get into my question(s) here are some background details:

Tech stack:
CraftCMS 2.6.2993 (uses Yii 1.1.19)
AngularJS (1.6)
PHP 7.0.x
Ubuntu 16.04 (Apache 2.4.18)

How it works:
1.) User visits a URL and Craft determines that's a URL we have defined (non 404).
2.) CraftCMS serves up the HTML via a template which we plug our angular app/partials into.
3.) User interacts with something on the screen (ie: submit button) that requires us to go get data from an external source (another REST api).
4.) JS function called which runs an $http.post() to the backend (same server so just posting to index.php).
5.) CraftCMS controller receives request and processes then returns JSON back to the AngularJS app.

What I need to do:
Run Yii along side CraftCMS on the same server and have them differentiate which one should be receiving given request.
Move template loading into YII (that's phase 2).

The end goal is to have CraftCMS run as "headless/content as a service" where it's essentially just a content management API to request content from and serve up on the page. Yii will then be handling all of the template loading and PHP business logic instead of having them as CraftCMS plugins.

Technical details:

Currently the way we call CraftCMS to get session data/etc is to do an $http.post() to /index.php and the postbody contains an "action" key that specifies which counter should receive this request.

Unfortunately I'm having trouble calling a Yii controller using the same logic. We have a "validate" plugin that contains a controller "Validate_AddressController.php" with a function "actionValidateAddress()". This action receives a JSON body with the address and it then calls out to an external vendor to actually validate the address.

However, when I try to post to this controller action I'm unable to hit it. It appears that CraftCMS is receiving the request first and then returning a 404 immediately and/or YII is never receiving the request.

Folder Structure:
<project folder>
    <craft>
    <backend>
        <yii files>
            <controllers>
                 - AddressController.php (the file I want to call).
    <src>
        <js files>



How can I set this up to differentiate which requests should go to CraftCMS and which ones should go to Yii2? Am I attempting to post incorrectly to Yii? I've tried to do $http.post('/address/validateAddress', {body}) but this doesn't seem to work.


TL;DR -- I want to treat Yii2 almost like a restful API but it needs to exist on the same server as another YII app.

TbExtendedGridView - row colors

$
0
0
Hi,

I have an application calling the TbExtendedGridView widget.

I added 'rowCssClassExpression' => 'ticketassignments->color($this->ticket_id)',

Then created

public function color($myid) {
$color = 'green'; // testing
return $color;

This is supposed to pass the 'green' value to the css script.
The problem I'm having is determining which css file to use.

in the .\public\assets\9e142ad5\gridview\styles.css I've added

tr.green
{
background: #CEF6D8;
}
.grid-view table.items tr.green
{
background: #CEF6D8;
}

this has had no affect.

I've attempted modifying the override.css, and main.css in the public/css folder as well, to no affect.

I have searched thru my controllers, looking for a statement registering any css files, but have been unable to locate them so far.

Any help would be highly appreciated.

Thanks,
Randy

Pasar una variable del Modelo a la Vista!

$
0
0
Antes que nada saludos cordiales, bueno amigos actualmente estoy trabajando con Yii 1.1.3 y estoy llamando una función en mi models desde mi controlador. la función es esta.

$disp_ing = LocProceso::model()->ReclamoPermitido($localizador);


dentro de esta función en mi modelo tengo varias consultas a distintos modelos y una variable que pasa de 0 a 1 si se cumple la condicion.:

public function ReclamoPermitido($loc=null, $ed=false)
{
$pasa = 0;
if(si esto se cumple){$pasa = 1}
}


ahora bien lo que quiero es traerme esa variable $pasa a mi vista pero no he logrado hacerlo soy nuevo con este frameworks y no había hecho uso de otro antes.

si pueden ayudarme se lo agradecería.!

Saludos,

Problema extraño con envío de correos

$
0
0
Hola a todos.

Tengo un extraño problema relacionado con el envío de correos.

Estoy en ambiente local y por consola puedo enviar el token de restablecimento de contraseñas, pero si intento restablecer la contraseña desde web (con el formulario), me genera un error de usuario y contraseña no aceptados.

El problema es que la configuración del correo es exactamente el mismo para los dos lados por lo que no entiendo cuál es el problema.

La configuración es esta:

'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            'viewPath' => '@common/mail',
            'useFileTransport' => false, //for the testing purpose, you need to enable this
            'transport' => [
                'class' => 'Swift_SmtpTransport',
                'host' => 'smtp.googlemail.com', // e.g. smtp.mandrillapp.com or smtp.gmail.com
                'username' => 'miemail@gmail.com',
                'password' => "micontraseña",
                'port' => '587', // Port 25 is a very common port too
                'encryption' => 'tls', // It is often used, check your provider or mail server specs
            ],
        ]

Proyecto de Yii no funciona, ayuda!

$
0
0
Primero me presento, soy nuevo en la comunidad y agradezco por cualquiera quien me pueda ayudar!
Desarrolle una aplicación en yii 1.1.14 y la ando montando en producción, pero cuando intento ejecutarla, la página se queda en blanco!
Entonces cree un nuevo proyecto de yii desde cero en ese ambiente y cuando intento ejecutar la primera aplicación de ejemplo que genera me sale la página de la siguiente forma (ver archivo captura1.png)
: captura1.png

Revisando, logre percatarme que cuando comento la línea donde ejecuta el metodo widget ($this->widget) la pagina se renderiza correctamente, excepto los widgtes.

El ambiente de producción corre php 5.6.31 sobre apache 2.4 64 bits

Alguna idea de que podría ser?
Viewing all 18717 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>