Quantcast
Viewing all 18717 articles
Browse latest View live

Loading a picture in yii 1

Hello, please I'm a yii newbie and I'm willing to load a picture to my browser unsuccessfully. I specified the path to the picture, this is the piece of code I'm using for that.

<?php

$path = Yii::app()->request->baseUrl."/"."images"."/"."pic1.jpg";

echo CHtml::image( dirname($path), "image not found", array('width'=>'100px','height'=>'100px','title'=>'image title here') );

?>

Loading a picture in yii 1

Hello, please I'm a yii newbie and I'm willing to load a picture to my browser unsuccessfully. I specified the path to the picture, this is the piece of code I'm using for that.

<?php

$path = Yii::app()->request->baseUrl."/"."images"."/"."pic1.jpg";

echo CHtml::image( dirname($path), "image not found", array('width'=>'100px','height'=>'100px','title'=>'alien') );

?>

Yii2 and PHP 7

Hello Friends,

I know it's too early to discuss but I think better this community start discussing on the near future.

I have already done many projects with Yii 1.1.x and a few with Yii 2 and when I look for my future projects I still find Yii 2 as better option. But still when I have PHP 7 with major performance overhauls and changes I definitely look for my applications to be PHP 7 compatible so that we all can take performance boosts expected.

I know YII Devs must have been thinking on this but I wish if you could share your future insights on the topic would be a great moral booster for YII community.


Regards,
Jai

Looking for Yii Developer (2-5 years)

We are a startup and looking for dedicated experienced Yii developer. Since we are at initial phase we can't give any monitoring benefits. This position will be on equity/shares basis.

We have already developed the base product and doing good in market, so we need a person/partner who can work with us as a part time and will get the secure position in the company.

Company profile: http://www.testunity.com

Interested person, please comment here or mail me at ranjan@testunity.com

Regards,
Ranjan

Image upload and clip extension

Hi all,

I am looking for an extension which allows a user to upload an image and then graphically clip an area on it. Is there currently one available for the 2.0 framework?

Thanks.

[Help] Fatal error: Class 'Controller' not found on PHP 7

I have existing Yii 1 project run on PHP 5.5.x and want to test on PHP 7.0.4 but have error "Fatal error: Class 'Controller' not found...".

I try add Yii::import('applications.components.*'); still error.
I use Ubuntu server and Yii 1.1.17

any one have same issue? and how to solve this error?

regards

Yii view displaying twice.

Hello, I have a problem can’t seems to fine solution. The website was working fine but one day it started displaying view twice. Where can the problem be? It takes 10s to load. Thanks

http://dox.flyavex.com

Need Help to resolve MultiFile is not a function. when using CMultiFileUpload

Uncaught TypeError: jQuery(...).MultiFile is not a function.

I am new to yii. i want to upload multiple images into db using CMultiFileUpload.I am using MultiFile plugin.

Code :

view :

<?php
$this->widget('CMultiFileUpload', array(
'model'=>$model,
'attribute'=>'imageurl',
'name' => 'imageurl',
'accept'=>'jpg|png',
'options'=>array(
// 'onFileSelect'=>'function(e, v, m){ alert("onFileSelect - "+v) }',
// 'afterFileSelect'=>'function(e, v, m){ alert("afterFileSelect - "+v) }',
// 'onFileAppend'=>'function(e, v, m){ alert("onFileAppend - "+v) }',
// 'afterFileAppend'=>'function(e, v, m){ alert("afterFileAppend - "+v) }',
// 'onFileRemove'=>'function(e, v, m){ alert("onFileRemove - "+v) }',
// 'afterFileRemove'=>'function(e, v, m){ alert("afterFileRemove - "+v) }',
),
'denied'=>'File is not allowed',
'max'=>10, // max 10 files
// 'maxFiles' => 14,
'htmlOptions' => array( 'multiple' => 'multiple', 'class' => 'form-control'),
));
?>

I already load js file before body ending

<script src="helper/js/jquery.multifile.js"></script>

LinxBooks - Open-source Accounting Software powered by Yii

Hi all

We've just released a beta version of our simple accounting software, for small and medium businesses. It's fully powered by Yii and Bootstrap. We're building our product website now, and will install an online demo soon. But meanwhile, you can download a version at GitHub (will post link soon, because I'm a new member to the forum, I'm not allowed to post link in my first post)

We'll be adding Developer Wiki to Github as well.

Hope to hear feedback from you guys!

Basic features include:
- Create and manage multiple users
- Manage customers
- Manage vendors
- Create, delete, edit Invoices, Quotations,
- Record invoice Payments,
- Manage, renew, terminate contracts,
- Keep track of company expenses…
- Manage bills and bill payments
- Generate Reports (Align Report, Cash Receipt, Invoice Journal, GST report, Sales Report, Customer Statement),
- Export to PDF.
- Send email reminder

Thanks!
Joseph Pham (Founder of LinxHQ Pte Ltd)

ajaxLink is calling function twice

Hello everyone, I want to add another form dynamically but this code creates it twice and I need only one when clicking on add another form and I tried to set 'enableAjaxValidation' = false but it didn't work either.

Yii2 developer on contract basis

Hello,

We are a startup and looking for dedicated experienced Yii2 developer.
We have already developed the base product, so we need a developer who can work with us for a month at our Mumbai office with immediate start to enhance the product.

Company profile: http://www.amigosec.com

Interested person, please comment here or mail me at paresh.jain@amigosec.com

Regards,
Paresh

[Extension] Yii2 Highcharts Widget

form

my code =>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-form',
	'enableAjaxValidation'=>false,
  	'htmlOptions'=>array('enctype'=>'multipart/form-data'),
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'username'); ?>
		<?php echo $form->textField($model,'username',array('size'=>20,'maxlength'=>20)); ?>
		<?php echo $form->error($model,'username'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'password'); ?>
		<?php echo $form->passwordField($model,'password',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'password'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'password2'); ?>
		<?php echo $form->passwordField($model,'password2',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'password2'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'email'); ?>
		<?php echo $form->textField($model,'email',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'email'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'avatar'); ?>
		<?php echo $form->fileField($model,'avatar',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'avatar'); ?>
	</div>
	
	<?php if (extension_loaded('gd')): ?>
        <div class="row">
            <?php echo CHtml::activeLabelEx($model, 'verifyCode') ?>
        	<div>
        		<?php $this->widget('CCaptcha'); ?><br/>
        		<?php echo CHtml::activeTextField($model,'verifyCode'); ?>
        	</div>
        	<div class="hint">Ketik tulisan yang ada pada gambar .
        	<br/>Tulisan tidak case sensitive</div>
        </div>
	<?php endif; ?>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div>&lt!-- form -->


Image may be NSFW.
Clik here to view.
: fileField Error.png

Задать url для actionColumn в gridView

Всем привет, подскажите, как можно задать свой url для actionColumn в gridView в yii2?

На сколько я понимаю для этого там есть две функции, первая:

'buttons' => [
   'update' => function ($url, $model, $key) {

      return Html::a('', $url, ['class' => 'glyphicon glyphicon-pencil']);

   }
],


Здесь можно для ссылки создать свой url или использовать url получаемый функцией в качестве параметра - по умолчанию он создается функцией urlCreator и равен /module/controller/action, либо можно в функции urlCreator, создать свой url:

'urlCreator' => function ($action, $model, $key, $index) {
   ...

   return $updateUrl;

}


Но я хочу создать url типа /test-1/question-1/answer-1, для этого мне не достаточно данных конкретной модели (answer), так как мне нужно знать не только id ответа (answer), но и id вопроса и теста. В само представление я эти параметры передаю, но как их передать в эти функции? В эти функции уже передаются другие параметры, и добавить новые не выходит, да и подменить тоже не получается, если допустим сделать так:

'buttons' => [
   'update' => function ($myUrl, $model, $key) {

      return Html::a('', $myUrl, ['class' => 'glyphicon glyphicon-pencil']);

   }
],

То все равно в функции $myUrl равен не тому url который я создал а url созданному по умолчанию функцией urlCreator. В общем вопрос в том, как в любую из этих функций передать дополнительные параметры?

Como me conecto a SQL SERVER

Un saludo a todos.
Soy nuevo en Yii, y necesito si alguien puede ayudarme a darme las indicaciones para conectarme desde Yii a SQL Server.

Muchas Gracias.

instalar libreria externa yii2

Hola, tengo el siguiente problema.
tengo el sdk o librería de payu y estoy intentado lograr que me funcione en yii2 y no he podido.
En yii1 es fácil solo se hace el require algo así:
require_once Yii::app()->getBasePath() . '/extensions/payu-php-sdk-4.5.6/lib/PayU.php';

PayU::$language = SupportedLanguages::ES; //Seleccione el idioma.
PayU::$isTest = true; //Dejarlo True cuando sean pruebas.

y funciona fácil, pero ahora estoy trabajando con yii2 y no me deja hacer eso. sale este error

<pre>PHP Fatal Error 'yii\base\ErrorException' with message 'Class 'app\controllers
\PayU' not found'

así hago el require

require_once \Yii::$app->basePath . '/vendor/librerias/payu-php-sdk-4.5.6/lib/PayU.php';




la verdad no se que hacer.

Mostar deficion de servicios WSDL

Buenas noches, una consulta y espero que me puedan ayudar estoy usando servicios y necesito la deficion de un servicios especifico pero no se como acceder al mismo, tengo la siguiente estructura:

SiteController.php
/**
	* @param string uname
	* @return string 
	* @soap
	*/
	    public function getExisteMateria($uname)
	    {
			
			$evaluacion = Yii::app()->db->createCommand("SELECT nombre_mat, descripcion, fecha_comienzo, fecha_fin, status, id_departamento, id_materia ".
			"FROM materia ".
			"WHERE nombre_mat ='".$uname."'")->queryAll();
			if($evaluacion)
				$result ='SI';
			else $result ='NO';
			
	        return $result;
	    }





Micliente.php

  class MiCliente extends CApplicationComponent
{
	
    private $client = null;
    public $ws_url;

    private function getClienteInt(){
    
        if($this->client == null)
        {
            // para que reconozca nuevas funciones del WS que vayas creando
            
            ini_set ( 'soap.wsdl_cache_enable' , 1);
			ini_set ( 'soap.wsdl_cache_ttl' , 3600 );
			error_log('Llene el cliente ');
            $this->client = new SoapClient('localhost/example/index.php/site/ws/');
            echo $this->client->getData("hallo");
            
			error_log('salio el cliente ');
			
        }else error_log('Cliente no NULL ');
        return $this->client;
    }
 public function existeMateria($uname){
		error_log('Username: '.$uname);
		return $this->getClienteInt()->getExisteMateria($uname);
	}}



Cuando ingreso en la url localhost/example/index.php/site/ws/existemateria me imprime todos los servios

<definitions name="SiteController" targetNamespace="urn:SiteControllerwsdl"><wsdl:message name="getObtenerMensajeRemotoRequest"><wsdl:part name="argX" type="xsd:string"/></wsdl:message><wsdl:message name="getObtenerMensajeRemotoResponse"><wsdl:part name="return" type="xsd:string"/></wsdl:message><wsdl:message name="getExisteLoginRequest"><wsdl:part name="uname" type="xsd:string"/></wsdl:message><wsdl:message name="getExisteLoginResponse"><wsdl:part name="return" type="xsd:string"/></wsdl:message><wsdl:message name="getExisteMateriaRequest"><wsdl:part name="uname" type="xsd:string"/></wsdl:message><wsdl:message name="getExisteMateriaResponse"><wsdl:part name="return" type="xsd:string"/></wsdl:message><wsdl:message name="getExistePensumRequest"><wsdl:part name="id" type="xsd:string"/></wsdl:message><wsdl:binding name="SiteControllerBinding" type="tns:SiteControllerPortType"><soap:binding style="rpc" transport=" schemas.xmlsoap.org/soap/http"/><wsdl:operation name="getObtenerMensajeRemoto"><soap:operation soapAction="urn:SiteControllerwsdl#getObtenerMensajeRemoto" style="rpc"/><wsdl:input><soap:body use="encoded" namespace="urn:SiteControllerwsdl" encodingStyle="
schemas.xmlsoap.org/soap/encoding/"/></wsdl:input><wsdl:output><soap:body use="encoded" namespace="urn:SiteControllerwsdl" encodingStyle="schemas.xmlsoap.org/soap/encoding/"/></wsdl:output></wsdl:operation><wsdl:operation name="getExisteLogin"><soap:operation soapAction="urn:SiteControllerwsdl#getExisteLogin" style="rpc"/><wsdl:input><soap:body use="encoded" namespace="urn:SiteControllerwsdl" encodingStyle="schemas.xmlsoap.org/soap/encoding/"/></wsdl:input><wsdl:output><soap:body use="encoded" namespace="urn:SiteControllerwsdl" encodingStyle="schemas.xmlsoap.org/soap/encoding/"/></wsdl:output></wsdl:operation><wsdl:operation name="getExisteMateria"><soap:operation soapAction="urn:SiteControllerwsdl#getExisteMateria" style="rpc"/><wsdl:input><soap:body use="encoded" namespace="urn:SiteControllerwsdl" encodingStyle=" schemas.xmlsoap.org/soap/encoding/"/></wsdl:input>!peration></wsdl:binding><wsdl:service name="SiteControllerService"><wsdl:port name="SiteControllerPort" binding="tns:SiteControllerBinding"><soap:address location="localhost/gestioncurricular/index.php/site/ws?ws=1"/></wsdl:port></wsdl:service></definitions>


Solo quiero la deficion del servicio ExisteMateria.Alguna idea?

Gracias

Legacy site, new pages in Yii?

I have an old (2009) legacy site, which brings income but it's done in a procedural style, not even oop. So my question is, would I benefit from using Yii2 to develop any *new* pages and/or any *updated* pages. I know just enough about "routing" to be dangerous but it seems like that part could be accomplished with proper naming conventions. I have about 25 years of programming, database design, and SQL but I'm new to frameworks. I do not wish to use any ORM - I don't like them because I know I can write efficient SQL and design efficient DBs. However, I am converting the "mysql" statements that I have to PDO (should have done that long ago, I know). Having said all that, if I were to use Yii2 is there a way to gradually work into it -- like, whenever I need a new "page" (which I now know is a "view" and a "controller"), could I do it without disturbing the current functionality of the site? Thanks!

Absen Baru

Gan.
Absen disini.
saya mau lihat seberapa users forum ini yang masih aktif.
dalam 2 Minggu lagi akan saya cek.
Mungkin yang paling aktif saya akan mintakan ke bro qiang biar jadi leader forum, gantiin saya.
mau pensiun saya bos, real life really - really get sucker, hahahaha


Pamit,

best regards

FREE Ebook Yii framework Bahasa Indonesia

Viewing all 18717 articles
Browse latest View live