In my view, when I call inline execution <?php echo $this->Html->script('forms/contact');?> it executes okay, but when I want the script to be loaded within the head tags it generates the code twice.
In my view:
<?php $this->Html->script('forms/contact', array('inline' => false));?>
Output:
<script type="text/javascript" src="/animalmedica/js/forms/contact.js"></script>
<script type="text/javascript" src="/animalmedica/js/forms/contact.js"></script>
Any ideas why?
I can't answer your question as to why, but I had exactly the same issue. After some trial and error I came up with this solution:
In my default layout I was using both the fetch script method and scripts for layout. I only needed one
echo $this->Html->charset();
echo $this->Html->meta('icon');
echo $this->Html->css('cake.generic');
echo $this->Html->css('grid_layout');
echo $this->Html->css('style');
echo $this->Html->css('jquery-ui-1.10.3.custom');
echo $this->Html->script('countdown');
echo $this->Html->script('page');
echo $this->fetch('meta');
echo $this->fetch('css');
echo $this->fetch('script');
echo $this->Js->writeBuffer(array('cache'=>FALSE));
//echo $scripts_for_layout;
scripts for layout is now deprecated:
http://book.cakephp.org/2.0/en/views.html#using-blocks-for-script-and-css-files
Related
Following is the hybrid batch script:
<!-- :: Batch section
#echo off
setlocal
echo Select an option:
for /F "delims=" %%a in ('mshta.exe "%~F0"') do set "HTAreply=%%a"
echo End of HTA window, reply: "%{HTAreply}%"
pause
goto :EOF
-->
<HTML>
<HEAD>
<HTA:APPLICATION SCROLL="no" SYSMENU="no" >
<TITLE>HTA Buttons</TITLE>
<SCRIPT language="JavaScript">
window.resizeTo(374,100);
function closeHTA(reply){
var fso = new ActiveXObject("Scripting.FileSystemObject");
fso.GetStandardStream(1).WriteLine(reply);
window.close();
}
</SCRIPT>
</HEAD>
<BODY>
<button onclick="closeHTA(1);">First option</button>
<button onclick="closeHTA(2);">Second option</button>
<button onclick="closeHTA(3);">Third option</button>
</BODY>
</HTML>
Output:
I obfuscated it as stated here : [Post#21]
https://www.dostips.com/forum/viewtopic.php?t=7990&start=15
but then the HTA app output isn't as before. It is as follows:
The entire batch content is displayed in the HTML window.
I want to know why this happens and secondly is there any way to obfuscate this hybrid batch script
Same happens when I try to convert the batch file to exe.
Edit
Problem solved. There was an error in html code. apologies. I would have edited to show the problem but I guess it was too trivial to do that.
Is there a way I can make the output display the proper text. When I have tried this the inequality sign do not show up unless you put " around it and it displays the quotes too. Is there a way it can not print the parenthesis and still display the > or < sign?
The code I am trying to use looks like the following...
set /p projectname=Enter Project Name:
cd %USERPROFILE%\Desktop\Output
echo <html> >>%projectname%.html
echo <head> >>%projectname%.html
echo <link rel="stylesheet" href="%projectname%.css">">>%projectname%.html
echo </head> >>%projectname%.html
I want the output to look like the following...
<html>
<head>
<link rel="stylesheet" href="(project name).css">
Escape each redirector that is to be echoed as text with ^ Thus: ^< or ^>
for instance
echo ^<head^> >>%projectname%.html
or better (no trailing space)
>>%projectname%.html echo ^<head^>
or better still
(
echo whatever
echo whatever else
echo whatever else again
)>filename
where > becomes >> to append (> means 'create file anew')
(only need to redirect to file once)
I am making a batch Application to open other Applications and Websites, I ran into a problem when making it, the application does not open unless it is within the same folder as the batch file, however upon later inspection it seems this is an incompatibility with one of the programs within it.
CD "%userprofile%\Desktop\MultiBatch\Place applications here"
start Glyph.exe
This code works, only if it is within the same folder.
if %selector% == 7 start GlyphClient.exe
How do I launch it from an external folder?
Here is the full code.
#echo off
#title Multi Tool
color 0c
:title
echo ---------------------------------------------------------------
echo -------------------MultiTool by michaelukz---------------------
echo ---------------------------------------------------------------
pause
:select1
echo ---------------------------------------------------------------
echo ------------------------Selection tool-------------------------
echo ---------------------------------------------------------------
echo [1] Website selection
echo [2] Application selection
echo [3] Calculator
echo [4] Clock [Updates every minute]
echo [E] Exit
CHOICE /C:1234E
goto action%errorlevel%
:action1
echo Website selection chosen
goto websel
:websel
echo ---------------------------------------------------------------
echo ----------------------Choose your Website----------------------
echo ---------------------------------------------------------------
echo [1] Google.com
echo [2] Minecraft.net
echo [3] Kryptocraft.net
echo [4] Amazon.co.uk
echo [5] Virmach.com Client area
echo [6] xpaw.ru
echo [7] twitter.com
echo [8] Youtube
echo [9] Exit prompt
CHOICE /C:123456789
goto web%errorlevel%
cls
:web1
echo Starting Google.com
start www.google.com
goto title
:web2
echo Starting Minecraft.net
start www.minecraft.net
goto title
:web3
echo Starting kryptocraft.net
start www.kryptocraft.net
goto title
:web4
echo Starting Amazon.co.uk
start www.amazon.co.uk
goto title
:web5
echo Starting Virmach Client panel
start www.virmach.com/manage/clientarea.php
goto title
:web6
echo Starting xpaw.ru
start www.xpaw.ru/mcstatus
goto title
:web7
echo Starting Twitter.com
start www.twitter.com
goto title
:web8
echo Starting Youtube.com
start www.youtube.com
goto title
:web9
echo Going to Exit prompt
goto extprompt
:action2
echo Application selection chosen
goto appsel
:appsel
echo ---------------------------------------------------------------
echo --------------------Choose your application--------------------
echo ---------------------------------------------------------------
echo [1] Glyph
echo [2] Photoshop
echo [3] Nero video 2015
echo [4] Mozilla firefox
echo [5] Task manager
echo [6] Notepad++
echo [7] Minecraft
echo [8] FTB Launcher
echo [9] ATLauncher
echo [Q] Exit Prompt
CHOICE /C:123456789Q
goto app%errorlevel%
cls
:app1
echo Launching Glyph
PUSHD "%userprofile%\Desktop\MultiBatch\Place applications here"
START GlyphClient.exe
POPD
goto title
You can change your cd command to cd /d ... as in the first form the current drive is not changed and if the program and batch file are in different drives the program will not be found.
Or if you know the full path to the application, you can use
start "" "x:\some\where\something.exe"
The more normal way to start programs is to specify full paths. In fact that is the only SECURE way.
So to start notepad (and start is only needed because it's in a bat file - omit start if typing - why? type start /?)
start c:\windows\system32\notepad.exe
or if using paths with spaces (have to specify window title if using quotes in command line)
start "My Window Title" "C:\Program Files\Movie Maker\DVDMaker.exe"
There is no need to change directories in Windows to run programs. It is designed that way.
Your question is not very clear on what's not working (or possibly you didn't provide enough code).
However, the code below might solve your problem:
PUSHD "%userprofile%\Desktop\MultiBatch\Place applications here"
START Glyph.exe
POPD
echo $this->Html->meta('icon');
echo $this->Html->css('cake.generic');
echo $this->Html->css('style_variation');
echo $this->Html->css('style');
echo $this->Html->css('suggest');
echo $this->Html->css('jquery.lightbox-0.5');
echo $javascript->link('jquery.js');
echo $javascript->link('jquery.lightbox-0.5.js');
echo $javascript->link('suggest.js');
i am using this code but this is not working.
Include css with
echo $this->Html->css('example');
and javascript with
echo $this->Html->script('example');
Do not write the .js extension when including javascript.
I have this code in cake php but it generates a bunch of labels along with the input that I do not like. How can I get rid of them? I just want the input.
echo $this->Form->hidden('user_role', array('value'=> '2'));
echo $this->Form->input('user_username');
echo $this->Form->input('user_password', array('type' => 'password'));
echo $this->Form->input('user_fname');
echo $this->Form->input('user_lname');
echo $this->Form->input('user_email');
echo $this->Form->input('user_phone');
echo $this->Form->input('user_cellphone');
echo $this->Form->input('user_address1');
echo $this->Form->input('user_address2');
echo $this->Form->input('user_city');
echo $this->Form->input('user_zip');
echo $this->Form->end('Submit');
Thank you
Labels are good for usability. But you can remove them in each form field adding the following:
$this->Form->input('user_username', array( 'label' => false ));
You can also disable labels by default when creating the form:
$this->Form->create('User', array('inputDefaults' => array('label' => false)));
Futher information available at their site:
http://book.cakephp.org/view/1398/options-label
http://book.cakephp.org/view/1616/x1-3-improvements