[Solved] Error with resolution operator while referencing model type depending on dynamic variable (PHP 5.2)

I have found the answer here: http://php.net/manual/en/language.oop5.paamayim-nekudotayim.php The Scope Resolution Operator (also called Paamayim Nekudotayim) or in simpler terms, the double colon, is a token that allows access to static, constant, and overridden properties or methods of a class. When referencing these items from outside the class definition, use the name of the class. As … Read more

[Solved] Sql injections may be possible

It is difficult to ans your query without source code, but still try this: Try binding parameters which you pass in query instead of directly passing in it. for example: $query = UserMaster::model()->findAll(’email = :email ‘, array(‘:email’ => “[email protected]”)); Here email id is binded in an array, this will prevent sql injection to much extent. … Read more

[Solved] The system is unable to find the requested action “name1”. in yii how to solve it [closed]

NameFormController should extend from Controller, not Controlle In your NameFormController, add the function: public function actionName1() { echo ‘action Name1()’; } Don’t forget to update the access rules to allow access to your new action: public function accessRules() { return array( array(‘allow’, ‘actions’ => array(‘index’, ‘view’, ‘name1’), ‘users’ => array(‘*’), ), array(‘deny’, ‘users’ => array(‘*’), … Read more

[Solved] How to get these array values using foreach? [closed]

Have a loop inside a loop if you are unsure how many results you will have. For instance… $YourArray = array(); //Add to array here. foreach($YourArray as $LevelOne): foreach ($LevelOne as $LevelTwo): echo $LevelTwo . ‘ – ‘; endforeach; echo ‘<br>’; endforeach; Would output for you. priyaa – aarthy testa – test member 1 5 … Read more

[Solved] Modules in yii – explain [closed]

From the docs: A module is a self-contained software unit that consists of models, views, controllers and other supporting components. In many aspects, a module is similar to an application. The main difference is that a module cannot be deployed alone and it must reside inside of an application. Users can access the controllers in … Read more

[Solved] How To Count Views On Click Of A Button Or Web Page Is There Any Extension

I think , there is no need of any extension. Make a Ajax call on click button or image you are interested. Improved: I supposed you have Site as controller and index as action. then, please keep this code on views/site/index.php . Yii::app()->clientScript->registerScript(‘logo_as_image_script’, ‘$(document).ready(function() { $(“#logo_as_image”).click(function() { $.post(“‘.Yii::app()->createAbsoluteUrl(‘site/index’).'”, { clicked: “1” }, function(data, status) { … Read more

[Solved] how to check, if authenticated user in array from db

Use LIKE query for checking your user id exist or not in users column. $user = Yii::app()->user->id; $result = Yii::app()->db->createCommand(‘SELECT * FROM project WHERE users LIKE “%’.$user.’%”‘)->queryAll(); if(count($result)){ //Your other scripts to show in grid view } If you have a Project model class then you also can use: $user = Yii::app()->user->id; $criteria = new … Read more