A small doubt (haXe php target, how to add other pages)

classic Classic list List threaded Threaded
4 messages Options
alx
Reply | Threaded
Open this post in threaded view
|

A small doubt (haXe php target, how to add other pages)

alx
Hi,

This thing is killing me!

I've made a php project and it compiles to a specific directory which is mywebpage.com/haxe/index.php

I want to put a webpage on mywebpage.com/haxe/thisone.html, so far, I've been copying it manually, is there a way to specifiy that as a "resource" or something? So that it automatically gets copied to the same directory where the project builds.

Best.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: A small doubt (haXe php target, how to add other pages)

Jason O'Neil-2
Is this what you're looking for:

# Compile index.php
-php php/
-main MyMainClass
-cp src/

# Compile otherpage.php
--next
-php php/
--php-front otherpage.php
-main OtherPage
-cp src/

Or are you looking for a way to copy static html files to the output directory?  I'm a little unsure because you used "index.php" and "thisone.html"

Let me know :)

Jason

On Sat, Oct 8, 2011 at 7:01 AM, alx <[hidden email]> wrote:
Hi,

This thing is killing me!

I've made a php project and it compiles to a specific directory which is mywebpage.com/haxe/index.php

I want to put a webpage on mywebpage.com/haxe/thisone.html, so far, I've been copying it manually, is there a way to specifiy that as a "resource" or something? So that it automatically gets copied to the same directory where the project builds.

Best.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: A small doubt (haXe php target, how to add other pages)

Jason O'Neil-2
If you're looking for a way to copy static files to the output, I usually structure my PHP projects like this:
  • MyProject/
    • src/
      • SomePackage/
      • AnotherPackage/
      • Main.hx
    • out/
      • css/
      • js/
      • doc/
      • readme.html
    • build.hxml
And your build.html should look something like this:

#
# Compile from src/, to out/, using PHP and the Main class.
#
-php out/
-cp src/
-main Main

When your run "haxe build.hxml" you should get something like:
  • MyProject/
    • src/
      • SomePackage/
      • AnotherPackage/
      • Main.hx
    • out/
      • css/
      • js/
      • doc/
      • lib/ (PHP files and classes are generated into here)
      • index.php (Main class gets launched from here)
      • readme.html
    • build.hxml
If you're still looking for a way to copy other content after the compile, you can put a line like this at the end of your hxml file:

# Run "cp" to copy included files
-cmd cp thisone.html out/thisone.html

# Run "rsync" to copy all included files from "includes/" to "out/"
-cmd rsync -a --delete "includes/" "out/"

Hope that helps!
Jason

On Sat, Oct 8, 2011 at 10:57 AM, Jason O'Neil <[hidden email]> wrote:
Is this what you're looking for:

# Compile index.php
-php php/
-main MyMainClass
-cp src/

# Compile otherpage.php
--next
-php php/
--php-front otherpage.php
-main OtherPage
-cp src/

Or are you looking for a way to copy static html files to the output directory?  I'm a little unsure because you used "index.php" and "thisone.html"

Let me know :)

Jason

On Sat, Oct 8, 2011 at 7:01 AM, alx <[hidden email]> wrote:
Hi,

This thing is killing me!

I've made a php project and it compiles to a specific directory which is mywebpage.com/haxe/index.php

I want to put a webpage on mywebpage.com/haxe/thisone.html, so far, I've been copying it manually, is there a way to specifiy that as a "resource" or something? So that it automatically gets copied to the same directory where the project builds.

Best.

--
haXe - an open source web programming language
http://haxe.org



--
haXe - an open source web programming language
http://haxe.org
alx
Reply | Threaded
Open this post in threaded view
|

Re: A small doubt (haXe php target, how to add other pages)

alx
Thanks, didn't know about php-front neither -cmd.

I'll try with those ;D !

On Friday, October 7, 2011, Jason O'Neil <[hidden email]> wrote:
> If you're looking for a way to copy static files to the output, I usually structure my PHP projects like this:
>
> MyProject/
>
> src/
>
> SomePackage/
> AnotherPackage/
> Main.hx

>
> out/
>
> css/
> js/
> doc/
> readme.html
>
> build.hxml
>
> And your build.html should look something like this:
>
> #
> # Compile from src/, to out/, using PHP and the Main class.
> #

> -php out/
> -cp src/
> -main Main
>
> When your run "haxe build.hxml" you should get something like:
>
> MyProject/
>
> src/
>
> SomePackage/
> AnotherPackage/
> Main.hx
>
> out/
>
> css/
> js/
> doc/
> lib/ (PHP files and classes are generated into here)
> index.php (Main class gets launched from here)
> readme.html
>
> build.hxml
>
> If you're still looking for a way to copy other content after the compile, you can put a line like this at the end of your hxml file:
>
> # Run "cp" to copy included files
> -cmd cp thisone.html out/thisone.html
>
> # Run "rsync" to copy all included files from "includes/" to "out/"
> -cmd rsync -a --delete "includes/" "out/"
>
> Hope that helps!
> Jason
>
> On Sat, Oct 8, 2011 at 10:57 AM, Jason O'Neil <[hidden email]> wrote:
>>
>> Is this what you're looking for:
>>
>> # Compile index.php
>> -php php/
>> -main MyMainClass
>> -cp src/
>>
>> # Compile otherpage.php
>> --next
>> -php php/
>> --php-front otherpage.php
>> -main OtherPage
>> -cp src/
>>
>> Or are you looking for a way to copy static html files to the output directory?  I'm a little unsure because you used "index.php" and "thisone.html"
>>
>> Let me know :)
>>
>> Jason
>>
>> On Sat, Oct 8, 2011 at 7:01 AM, alx <[hidden email]> wrote:
>>>
>>> Hi,
>>> This thing is killing me!
>>> I've made a php project and it compiles to a specific directory which is mywebpage.com/haxe/index.php
>>> I want to put a webpage on mywebpage.com/haxe/thisone.html, so far, I've been copying it manually, is there a way to specifiy that as a "resource" or something? So that it automatically gets copied to the same directory where the project builds.
>>> Best.
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>
>
>
--
haXe - an open source web programming language
http://haxe.org