Category archive

MVC

Explore every article in MVC, with preserved WordPress-friendly URLs.

12 articles

javascript

Custom Validation for Ninja Form – wordpress

Suppose you have used Ninja Form Plugin in your wordprss website. Ninja form provide you the option to validate the fields like email address, phone numbers format and required validation. But in case you have to add any custom validation then Ninja form provide you the hook to implement custom client side validation.

Jan 10, 2025

Read article

CMS

Yii2 how to set custom value for checkbox in gridview widget

In Yii2, while you use gridview widget to display your table data, for performing any operation on the record by selecting the checkbox, gridview assign the value of the first column retrieved from your the result set. But you need to set some different value to the checkbox, so to do that you can use […]

Aug 4, 2019

Read article

CMS

How to wrap data column in Gridview widget in yii or yii2 framework

The column which you want to wrap should be added the property called “contentOptions” where you can apply the css property to suits your needs and requirements as below. [ ‘attribute’ => ‘column name’, ‘format’ => ‘html’, ‘noWrap’ => false, ‘mergeHeader’=>true, ‘contentOptions’ => [‘style’ => ‘width: 50%; overflow: sc

Nov 20, 2017

Read article

MVC

How to get raw sql query in yii or yii2 framework

If you have used the query builder in yii 2.0.8 framework then to get the raw sql generated use the below statement. $query->andFilterWhere([‘like’, ‘username’, $this->username]) ->andFilterWhere([‘like’, ’email_id’, $this->email]) ->andFilterWhere([‘registration_date’ => $this->register_date]); // This is echo the raw

Nov 15, 2017

Read article

Laravel

how to get sql query from facade DB::table in laravel 5

Normally we fetch the data as below $dataresult = DB::table(‘sometable’) ->select(‘sometable.column1’, ‘sometable.column2’, ‘sometable.column3’, ‘sometable.column4’, ‘sometable.column5’) ->get(); Now if we want to get the actaul query from $dataresult using $dataresult->toSql(); // it will not work The solution for thi

Oct 7, 2017

Read article

CMS

Set widget label from action file in symfony 1.4

In Action File ========================================================== $this->form = new youFormclassname(); To set individual Label $this->form->getWidget(‘widgetname’)->setLabel(‘widget Custom label’); To set multiple field label $this->form->getWidgetSchema()->setLabels(array( ‘field_name_1’ => ‘Field 1 Custom La

Aug 31, 2012

Read article

MVC

Self join criteria in symfony

For Example : SELECT tbl1.id FROM tbl1 a LEFT JOIN tbl1 b ON a.somecolumnname = b.somecolumn ORDER BY a.somecolumn DESC The criteria would be as follow $c=new Criteria(); $c->addAlias(‘a’, ‘tbl1’); $c->addAlias(‘b’, ‘tbl1’); $c->addSelectColumn(‘b.id’); $c->addSelectColumn(‘a.tbl1_id’); $c->addDescendingOrderByColumn(‘

Nov 21, 2011

Read article

MVC

select multiple column from multiple table in cakePHP

$markers = $this->Post->find(‘all’, array( ‘joins’ => array( array( ‘table’ => ‘cp_user’, ‘alias’ => ‘users’, ‘type’ => ‘left’, ‘foreignKey’ => false, ‘conditions’=> array(‘Post.postauthor = users.id’) ) ), ‘conditions’=>’Post.poststatus = 1’, ‘fields’=>array(‘Post.postid’, ‘Post.postdate’, ‘Post.posttitle’, ‘Post.post

Nov 27, 2010

Read article