How to create a back link using the Yii Framework
In the view that you wish to use add the following code for the back link. CHtml::link('Back',Yii::app()->request->urlReferrer);
In the view that you wish to use add the following code for the back link. CHtml::link('Back',Yii::app()->request->urlReferrer);
In the view that you wish to use add the following code for the Email link. CHtml::mailto($data->email) NOTE: $data->email contains the email address, replace this variable with the relevant email address or variable that contains the email address.
To delete all Cookies execute the following command: Yii::app()->request->cookies->clear(); To delete a specific cookie execute the command below, only replacing cookie_name with the name of your cookie: unset(Yii::app()->request->cookies['cookie_name']);
git branch -D branch1 branch2 branch3 The above command will delete branch1, branch2 and branch3 in your local repository
NOTE: This can only be done within iTunes ‘Tested in iTunes 10’ Plugin your iPhone Open iTunes Under DEVICES click on your iPhone At the Top Menu select Summary On the open page under Options check the checkbox next to Manually manage music and videos On the right menu under DEVICES expand the iPhone device by clicking on the arrow and click once on Music A list of your songs will appear on the main screen. Right click on the song that you wish to delete and select Delete and the selected song will be deleted from your iPhone.
The data type of a PHP variable can be detected by using the built-in PHP function****gettype() (PHP 4, PHP 5) Example: $var ="This is a sentence" echo $var; //This will return "string" The following possible values can be returned: boolean integer double string array object resource NULL unknown type
Include the following code anywhere in your application [js]<span id="urn:enhancement-f9965c67-8856-e15b-a96a-9ae613690f5b" class="textannotation">Yii</span>::<span id="urn:enhancement-0ff1ff82-84ee-005a-2d01-4a27dedfa994" class="textannotation">app</span>()->clientScript->scriptMap=array( 'jquery.js'=>false, );[/js]
I have the following JavaScript code that I need to display as plain content on a page and when I add it the page handles it as code instead of content. The code below I need to display as content <script src="/fancybox/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script> Answer: Use the ‘htmlspecialchars’ PHP function tdisplay the code as content htmlspecialchars - Convert special characters to HTML entities (PHP 4 & 5) See the example below ...
This can be done using the registerCss() method of the CClientScript class. CClientScript manages JavaScript and CSS stylesheets for views. registerCss()registers a piece of CSS code. Place code similar to the example code below in your View Yii::app()->clientScript->registerCss('customCSS',<<<CSS li { font-weight: normal; } CSS ); In the code above the first parameter is a string and ID that uniquely identifies this piece of CSS code. The second Parameter contains the CSS code. ...
Use the AddEmbeddedImage method provided by the PHPMailer class. eg. $mail->AddEmbeddedImage(’test.gif’,’testImage’,’test.gif’); Parameters for AddEmbeddedImage($path, $cid, $name = ‘’, $encoding = ‘base64’, $type = ‘application/octet-stream’) $path = Path to the attachment $cid = Content ID of the attachment. Use this to identify the Id for accessing the image in an HTML form. $name = Overrides the attachment name. $encoding = File encoding $type = File extension (MIME) type. Example: <?php //Include the PHPMailer class include = 'class.phpmailer.php'; $mailer=new phpmailer(); $mailer->From =’[email protected]’; $mailer->FromName=’TechPortal'; $mailer->Subject =’TechPortal Example’; $mailer->AddAddress(’[email protected]’); $mailer->IsHTML(true); $mailer->AddEmbeddedImage(’test.gif’,'testImage’,'test.gif’); $mailer->Body =’<img src=”cid:testImage”>’; $mailer->Send(); ?> DOWNLOAD PHPMailer Class (Version: 2.0.4)