Codxplore.com

Latest news: New android application Islamic Video has been released. its a free islamic video application for android smartphone. Download now!


We will use the same three methods from the previous page to set content: text() - Sets or returns the text content of selected elements html() - Sets or returns the content of selected elements (including HTML markup) val() - Sets or returns the value of form fields The following example demonstrates how to set content with the jQuery text(), html(), and val() methods: Example $("#btn1").click(function(){     $("#test1").text("Hello world!"); }); $("#btn2").click(function(){     $("#test2").html("<b>Hello world!</b>"); }); $("#btn3").click(function(){     $("#test3").val("Dolly Duck"); });

Views: 1591


Pagination represents information relevant to pagination of data items. When data needs to be rendered in multiple pages, Pagination can be used to represent information such as total item count, page size, current page, etc. These information can be passed to pagers to render pagination buttons or links. The following example shows how to create a pagination object and feed it to a pager. Controller action: public function actionSearch($q = '') {         $this->layout = 'site_main';         $q = trim($q);         $sql = "SELECT * FROM (select p.product_id as 'sid',p.name_en,p.name_ar,p.description_en,description_ar,p.imag....

Views: 2842


something like SELECT id, email, IF(actived = 1, 'enabled', 'disabled') AS account_status FROM users this allow you to make operations and show it as columns. EDIT: you can also use joins and show operaitons as columns: SELECT u.id, e.email, IF(c.id IS NULL, 'no selected', c.name) as country FROM users u LEFT JOIN countries c ON u.country_id = c.id See the http://stackoverflow.com/questions/455261/how-to-create-virtual-column-using-mysql-select for refference

Views: 1407


leftJoin() $query = new Query; $query    ->select(['tbl_user.username AS name', 'tbl_category.type as Category'])           ->from('tbl_user')         ->leftJoin('tbl_category', 'tbl_category.createdby = tbl_user.userid')         ->limit(2);         $command = $query->createCommand(); $data = $command->queryAll();

Views: 1658


innerJoinWith() $model = User::find()     ->innerJoinWith('comments', false)     ->all(); // equivalent to the above $model = User::find()     ->joinWith('comments', false, 'INNER JOIN')     ->all(); SYNTAX: $query = new Query; $query    ->select(['SELECT COLUMNS'])           ->from('TABLE_NAME_1')         ->join(    'JOIN_TYPE',                 'TABLE_NAME_2',                 'TABLE_NAME_2.COLUMN =TABLE....

Views: 1848


joinWith() Sample 1: $model = User::find()     ->joinWith('comments')     ->all(); Sample 2: $model = User::find()     ->joinWith('comments')     ->orderBy('tbl_comments_id.id, tbl_user.id')     ->all();

Views: 1775


Relation Model $model = User::find()         ->with('comments')         ->all();     foreach ($model as $user) {         // get data from relation model         $comments = $user->comments;         ......         foreach($comments as $comment){             ........         }     }

Views: 1044


<?php use yiiwidgetsPjax; ?> Add above line in the beginning of your view. <?php Pjax::begin(); ?> <?= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yiigridSerialColumn'], 'id', 'branch:ntext', 'version:ntext', 'release_date:ntext', [ 'class' => 'yiigridActionColumn', 'template' => '{view}', ], ], ]); ?> <?php Pjax::end(); ?>  

Views: 1402


Use the following. we can change the oracle system password. SQL> connect / as sysdba SQL> alter user <username> identified by <password>;  

Views: 664


First, let's enable Yii2's pretty URLs with mod_rewrite. On the Yii home page, if you click on the About menu option, the URL will be something like http://localhost/hello/web/index.php?r=site%2Fabout. We'd like to change that to http://localhost/hello/web/site/about. The config subdirectory includes environment configurations for your web and console applications as well as the future database settings. Edit /config/web.php to add urlManagement to the current web application. Add the following urlManager section within the components array: 1 2 3 4 5 6 7 8 &#....

Views: 937


Sample 1: $model = Yii::$app->db->createCommand('select * from tbl_service_categories where category_id  = ' . $id)->queryOne(); Sample 2: $model = Yii::$app->db->createCommand('select * from users)->queryAll();

Views: 661


Sample Code :

Views: 1293

Subscribe Us


Follow Us