htaccess in yii2 basic app

By: http://www.codematrics.com/ .htaccess is a configuration file, by which apache can handle redirects which are not written in php code. So for e.g.  if you want to redirect your users to specific page when 404 error comes, you can do it with a line of code in .htaccess file. In Yii2 basic app, if you have chose prettyContinue reading “htaccess in yii2 basic app”

Yii2 htaccess – How to hide frontend/web and backend/web COMPLETELY

By: mohit   Step 1 Create .htaccess file in root folder, i.e advanced/.htaccess and write below code. Options +FollowSymlinks RewriteEngine On # deal with admin first RewriteCond %{REQUEST_URI} ^/(admin) <—— RewriteRule ^admin/assets/(.*)$ backend/web/assets/$1 [L] RewriteRule ^admin/css/(.*)$ backend/web/css/$1 [L] RewriteCond %{REQUEST_URI} !^/backend/web/(assets|css)/ <—— RewriteCond %{REQUEST_URI} ^/(admin) <—— RewriteRule ^.*$ backend/web/index.php [L] RewriteCond %{REQUEST_URI} ^/(assets|css) <—— RewriteRule ^assets/(.*)$Continue reading “Yii2 htaccess – How to hide frontend/web and backend/web COMPLETELY”

Error 500 and 404 when using .htaccess for removing index.php

By: Sochinda Enable mod_rewrite in apache Enable ReWrite mode in Apache2 $ sudo a2enmod rewrite $ sudo service apache2 restart Edit site-enable configuration <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny allow from all </Directory> Add .htaccess Options +FollowSymLinks IndexIgnore */* <IfModule mod_rewrite.c> RewriteEngine on #RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRuleContinue reading “Error 500 and 404 when using .htaccess for removing index.php”

Installing the PHP mcrypt extension on OSX 10.9

By:  Jens segers on Nov 05 2013 The following steps will explain you how to install the mcrypt extension for the default PHP version (5.4.24) that is shipped with OSX Mavericks. You need this extension for stuff like Laravel and phpMyAdmin. Otherwise you will get this error: Mcrypt PHP extension required. Step 1: Install autoconfContinue reading “Installing the PHP mcrypt extension on OSX 10.9”

Yii: use ajax function via htmlOptions attribute

By: lars If you want to trigger an ajax call on a Yii form element onchange, you can pass an array of ajax attributes as one of the “htmlOptions” like so: <?php echo $form->textField($model,’my_input_field’,array( ‘ajax’ => array( ‘type’=>’POST’, //request type ‘url’=>$this->createUrl(‘site/ajaxAction’), // url to call controller action ‘success’=>’ function(data) { $(\’#my_output_field\’).val(data) }’,// function to callContinue reading “Yii: use ajax function via htmlOptions attribute”

Creating a CSS Driven Drop Down Menu using CMenu

By: Yii CMenu offers great functionality and the ability to customize just about every aspect of the output. There are many times when I need to create a drop down menu or simply modify the look to make the designers happy. Because this seems to be a common task for me, I figured I would shareContinue reading “Creating a CSS Driven Drop Down Menu using CMenu”

How to create a Custom Pagination Widget for Yii Framework

By: Agile Web Application Development with Yii 1.1 and PHP5Yii Framework is great, I truly like this framework, makes complicated things an easy task and its learning curve quite easy. But… yeah man, is always a but… what happens to all those fellow programmers, like me, that do not like the way ‘automated things’ are? WhereContinue reading “How to create a Custom Pagination Widget for Yii Framework”

How to create a breadcrumb widget

By: Here’s a simple way to create a breadcrumb widget to be used in your templates. The idea is just to isolate how the breadcrumb is generated based on an array of crumbs. Info: Please note, that new versions of Yii Framework already contain a bulit-in breadcrumbs widget. See this class reference chapter for more information. Information inContinue reading “How to create a breadcrumb widget”