Codxplore.com

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


If you want to show error message when checkbox is not checked, try this rule ['acordul_tc', 'required', 'on' => ['register'], 'requiredValue' => 1, 'message' => 'my test message'] This means that the attribute is required and must be equal to 1, else display error with your message.

Views: 87


Try DISABLE KEYS before SET FOREIGN_KEY_CHECKS=0; make sure to SET FOREIGN_KEY_CHECKS=1; after. [NOTE] It's not a good idea to set a foreign key constraint to 0, because if you do, your database would not ensure it is not violating referential integrity. This could lead to inaccurate, misleading, or incomplete data. You make a foreign key for a reason: because all the values in the child column shall be the same as a value in the parent column. If there are no foreign key constraints, a child row can have a value that is not in the parent row, which would lead to inaccurate data. For instance, let's say you have a website for students to login and every student must register for an account as a user. You have one table for user ids, with user id as a pri....

Views: 62


$begin = new DateTime( '2010-05-01' ); $end = new DateTime( '2010-05-10' ); $interval = DateInterval::createFromDateString('1 day'); $period = new DatePeriod($begin, $interval, $end); foreach ( $period as $dt ) echo $dt->format( "l Y-m-d H:i:s\n" ); This will output all days in the defined period between $start and $end. If you want to include the 10th, set $end to 11th. You can adjust format to your liking. See the PHP Manual for DatePeriod.

Views: 2559


Use this: for ($m=1; $m

Views: 2564


You might want to look at the strtotime and date functions.

Views: 2458


We can find these by looking at Bootstrap's stylesheet, Bootstrap.css. Each {number} represents a hexadecimal value, so 2a is equal to 0x2a or &#x2a;. As for the font, that can be downloaded from http://glyphicons.com. <pre> .glyphicon-asterisk:before { content: "2a"; } .glyphicon-plus:before { content: "2b"; } .glyphicon-euro:before { content: "20ac"; } .glyphicon-minus:before { content: "2212"; } .glyphicon-cloud:before { content: "2601"; } .glyphicon-envelope:before { content: "2709"; } .glyphicon-pencil:before { content: "270f"; } .glyphicon-glass:before { content: "e001"; } .glyphicon-music:before { content: "e002&q....

Views: 2963


When we need to to call another controller function,we can simply use the below code Yii::$app->runAction('publish/commit',[                     'r' => 'ws' ]); write it in Controller A index method and you can get the value of $r  in Controller Publish commit method.    

Views: 2985


If your generating a CSV with PHP you may have stumbled upon the same problem as me where any special character such as £ becomes ASCII in your CSV, this is because the encoding of your CSV is wrong and you will need to output your CSV in UTF8 to be able to use special ASCII characters in your document. Using my example below you can encode UTF8 your CSV file, you will notice a header with “Content-Encoding: UTF-8” and also in the “Content-Type” header you will see an extra parameter “; charset=UTF-8”. You will also notice the weird echo “xEFxBBxBF” – this is the BOM for the UTF-8 encoding, if your not sure what this is don't worry, it will not display in your document. Please Note! UTF-8 is not supported by Macinto....

Views: 3164


  Its called 'scenarios': http://www.yiiframework.com/doc-2.0/guide-structure-models.html#scenarios in model: public function rules() { return [ ['title', 'required', 'on' => 'create'] ]; } in controller: public function actionCreate() { $model = new Item(); $model->scenario = 'create'; ... } You'd better define scenario as a constant though.   source : http://stackoverflow.com/questions/29449019/yii2-validate-only-create-action

Views: 3300


Have a look at http://www.webmasterworld.com/forum88/7382.htm I believe that it will work OK if you escape the ' character thus: ' You can easily create a Javascript function to replace each instance of ' by '. str = str.replace(/'/g, "\'");

Views: 3279


Answer In a layout you can access the current controller via $this->context, and so the current action id by $this->context->action->id For reference http://stackoverflow.com/questions/28769719/yii2-get-current-action-id-in-main-php

Views: 2431


Assumption here is that you're referencing the script incorrectly and the web server is serving a 404 html page. Make sure the js file is where you're referencing it from. for reference https://github.com/carhartl/jquery-cookie/issues/347#event-230595231

Views: 3662

Subscribe Us


Follow Us